/* ==========================================================================
   Cookie Consent Widget — styles
   All classes are prefixed `cc-` to avoid collisions with host site CSS.
   ========================================================================== */

.cc-hidden {
  display: none !important;
}

/* ---------- Overlay (used behind the modal only) ---------- */
.cc-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 3, 3, 0.7);
  z-index: 999998;
  animation: cc-fade-in 0.2s ease-out;
}

@keyframes cc-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ---------- Banner (full-width bar at the bottom of the page) ---------- */
.cc-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 999999;
  background: #0a0a0a;
  color: #e0e0e0;
  box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.5);
  padding: 18px 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-family: "Kanit", sans-serif;
  animation: cc-slide-up 0.3s ease-out;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

@keyframes cc-slide-up {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.cc-banner__text {
  font-size: 13.5px;
  line-height: 1.6;
  margin: 0;
  color: #b0b0b0;
  flex: 1 1 0;
  min-width: 200px;
}

.cc-banner__text a {
  color: var(--cc-accent, #a30000);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cc-banner__text a:hover {
  color: #d40000;
}

.cc-banner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex-shrink: 0;
}

.cc-banner__actions .cc-btn {
  flex: 1 1 0;
  text-align: center;
}

/* ---------- Buttons ---------- */
.cc-btn {
  font-family: "Inter", sans-serif;
  font-size: 14px;
  font-weight: 600;
  border-radius: 6px;
  padding: 11px 22px;
  border: 1px solid transparent;
  cursor: pointer;
  transition:
    filter 0.15s ease,
    background-color 0.15s ease,
    transform 0.15s ease;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.cc-btn:focus-visible {
  outline: 2px solid var(--cc-accent, #a30000);
  outline-offset: 2px;
}

.cc-btn:hover {
  filter: brightness(0.88);
}

.cc-btn:active {
  transform: scale(0.97);
}

.cc-btn--primary {
  background: var(--cc-accent, #a30000);
  color: #ffffff;
}

.cc-btn--primary:hover {
  background: #c40000;
}

.cc-btn--ghost {
  background: transparent;
  color: #d0d0d0;
  border-color: rgba(255, 255, 255, 0.15);
}

.cc-btn--ghost:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.25);
}

.cc-btn--text {
  background: transparent;
  color: var(--cc-accent, #a30000);
  padding: 11px 8px;
}

.cc-btn--text:hover {
  color: #d40000;
}

/* ---------- Modal ---------- */
.cc-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(720px, 92vw);
  max-height: 86vh;
  background: #111111;
  border-radius: 12px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
  z-index: 999999;
  display: flex;
  flex-direction: column;
  font-family: "Kanit", sans-serif;
  animation: cc-pop-in 0.2s ease-out;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

@keyframes cc-pop-in {
  from {
    opacity: 0;
    transform: translate(-50%, -46%);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

.cc-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.cc-modal__title {
  font-family: "Phudu", sans-serif;
  font-size: 22px;
  font-weight: 600;
  margin: 0;
  color: #f0f0f0;
  letter-spacing: -0.01em;
}

.cc-modal__close {
  background: transparent;
  border: none;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: #666;
  padding: 4px;
  transition: color 0.15s ease;
}

.cc-modal__close:hover {
  color: #fff;
}

.cc-modal__body {
  padding: 20px 28px;
  overflow-y: auto;
}

.cc-modal__intro {
  font-size: 14px;
  line-height: 1.65;
  color: #999;
  margin: 0 0 18px;
}

.cc-modal__intro .cc-more-toggle {
  color: var(--cc-accent, #a30000);
  cursor: pointer;
  background: none;
  border: none;
  font: inherit;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cc-modal__intro .cc-more-toggle:hover {
  color: #d40000;
}

.cc-modal__intro-extra {
  margin-top: 8px;
  color: #888;
}

/* ---------- Category rows ---------- */
.cc-category {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 16px 0;
}

.cc-category:first-of-type {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.cc-category__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
}

.cc-category__label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  color: #e0e0e0;
}

.cc-category__chevron {
  display: inline-block;
  transition: transform 0.15s ease;
  color: #555;
  font-size: 13px;
}

.cc-category--open .cc-category__chevron {
  transform: rotate(90deg);
}

.cc-category__status {
  font-size: 13px;
  font-weight: 600;
  color: #B4E717;
}

.cc-category__desc {
  display: none;
  font-size: 13.5px;
  line-height: 1.65;
  color: #777;
  margin-top: 10px;
  padding-right: 60px;
}

.cc-category--open .cc-category__desc {
  display: block;
}

/* ---------- Toggle switch ---------- */
.cc-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex: 0 0 auto;
}

.cc-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.cc-switch__track {
  position: absolute;
  inset: 0;
  background: #333;
  border-radius: 999px;
  transition: background-color 0.15s ease;
}

.cc-switch__track::before {
  content: "";
  position: absolute;
  height: 16px;
  width: 16px;
  left: 3px;
  top: 3px;
  background: #666;
  border-radius: 50%;
  transition:
    transform 0.15s ease,
    background-color 0.15s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.cc-switch input:checked + .cc-switch__track {
  background: var(--cc-accent, #a30000);
}

.cc-switch input:checked + .cc-switch__track::before {
  transform: translateX(18px);
  background: #ffffff;
}

.cc-switch input:disabled + .cc-switch__track {
  background: #B4E717;
  opacity: 0.5;
  cursor: not-allowed;
}

.cc-switch input:disabled + .cc-switch__track::before {
  background: #ffffff;
}

/* ---------- Modal footer ---------- */
.cc-modal__footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 18px 28px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.cc-modal__footer .cc-btn {
  flex: 1 1 0;
  text-align: center;
}

.cc-modal__powered {
  text-align: center;
  font-size: 12px;
  color: #555;
  padding-bottom: 18px;
}

.cc-modal__powered strong {
  color: #888;
}

/* ---------- Floating reopen icon ---------- */
.cc-widget {
  position: fixed;
  left: 20px;
  bottom: 20px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--cc-accent, #a30000);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(163, 0, 0, 0.35);
  z-index: 999997;
  border: none;
  padding: 0;
  transition:
    filter 0.15s ease,
    transform 0.15s ease;
}

.cc-widget:hover {
  filter: brightness(1.15);
  transform: scale(1.06);
}

.cc-widget svg {
  width: 24px;
  height: 24px;
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .cc-banner {
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    flex-direction: column;
    align-items: stretch;
  }
  .cc-modal {
    width: 100vw;
    max-height: 100vh;
    height: 100%;
    border-radius: 0;
    top: 0;
    left: 0;
    transform: none;
  }
  .cc-category__desc {
    padding-right: 0;
  }
}
