:root {
  --cookie-bg: #13131E;
  --cookie-bg-deep: #090910;
  --cookie-accent: #8A38F5;
  --cookie-accent-hover: #ffffff;
  --cookie-text: #9090A8;
  --cookie-text-strong: #ffffff;
  --cookie-border: rgba(255, 255, 255, 0.1);
  --cookie-overlay: rgba(9, 9, 16, 0.75);
  --cookie-btn-text: #06060E;
}

.cookie-popup-container {
  width: 100%;
  height: 100%;
  display: none;
  align-items: center;
  justify-content: center;
  background: var(--cookie-overlay);
  position: fixed;
  left: 0;
  top: 0;
  z-index: 9999999;
  padding: 20px;
}

/* Wider, asymmetric shell — reads as a different template from the old centred card */
.cookie-popup-container .cookie-popup {
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  box-sizing: border-box;
  padding: 0;
  box-shadow:
    0 28px 70px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(245, 166, 35, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  -ms-overflow-style: none;
  scrollbar-width: none;
  border-radius: 8px 20px 20px 8px;
  border-left: 4px solid var(--cookie-accent);
  color: var(--cookie-text);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Expandable block: sidebar tab + main (layout only) */
.cookie-popup-container .cookie-popup .cookie-popup-content-container {
  display: flex;
  flex-direction: column;
  position: static;
  width: 100%;
  height: 0;
  overflow: hidden;
  overflow-y: auto;
  color: var(--cookie-text);
  transition: min-height 0.22s ease, height 0.22s ease;
  border-radius: 0;
  background: var(--cookie-bg);
}

.cookie-popup-container .cookie-popup .cookie-popup-content-container.open {
  height: auto !important;
  min-height: 300px;
  max-height: min(520px, 58vh);
}

@media (min-width: 769px) {
  /* Default: sidebar + main (single visible tab still ok) */
  .cookie-popup-container .cookie-popup .cookie-popup-content-container.open {
    flex-direction: row;
    align-items: stretch;
  }

  /*
   * Preference / “details” screen: drop narrow sidebar + full-width content + scroll.
   * Matches first-screen rhythm (no dead left column, buttons full width).
   */
  .cookie-popup:has(.cookie-panel ul li.details-panel.active)
    .cookie-popup-content-container.open {
    flex-direction: column;
    max-height: min(560px, 62vh);
  }

  .cookie-popup:has(.cookie-panel ul li.details-panel.active) .cookie-panel {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--cookie-border);
    background: rgba(0, 0, 0, 0.28);
  }

  .cookie-popup:has(.cookie-panel ul li.details-panel.active) .cookie-panel ul {
    flex-direction: row;
    justify-content: center;
  }

  .cookie-popup:has(.cookie-panel ul li.details-panel.active) .cookie-panel ul li {
    text-align: center;
    border-left: none !important;
    width: auto;
    padding-left: 24px;
    padding-right: 24px;
    border-bottom: none !important;
  }

  .cookie-popup:has(.cookie-panel ul li.details-panel.active)
    .cookie-panel
    ul
    li.active {
    border-left: none !important;
    background: transparent;
    border-bottom: 2px solid var(--cookie-accent) !important;
  }
}

.cookie-popup .cookie-panel {
  flex-shrink: 0;
}

.cookie-popup .cookie-panel ul {
  list-style-type: none;
  display: flex;
  padding-left: 0 !important;
  margin: 0 !important;
}

@media (min-width: 769px) {
  .cookie-popup .cookie-panel {
    width: 200px;
    border-right: 1px solid var(--cookie-border);
    background: rgba(0, 0, 0, 0.22);
  }

  .cookie-popup .cookie-panel ul {
    flex-direction: column;
  }
}

.cookie-content.cookie-mid {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.cookie-cookies-display {
  padding: 20px 22px 24px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-color: rgba(245, 166, 35, 0.45) rgba(255, 255, 255, 0.06);
  scrollbar-width: thin;
}

.cookie-cookies-display::-webkit-scrollbar {
  width: 8px;
}

.cookie-cookies-display::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
}

.cookie-cookies-display::-webkit-scrollbar-thumb {
  background: rgba(245, 166, 35, 0.4);
  border-radius: 4px;
}

@media (min-width: 640px) {
  .cookie-cookies-display {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
  }

  .cookie-cookies-display h5,
  .cookie-cookies-display > p {
    grid-column: 1 / -1;
  }

  .cookie-cookies-display .cookie-category {
    margin-bottom: 14px;
  }
}

@media (min-width: 700px) {
  .cookie-cookies-display {
    grid-template-columns: 1fr 1fr;
    column-gap: 16px;
  }

  .cookie-cookies-display .cookie-category {
    margin-bottom: 14px;
  }

  /* Preference screen: one column reads clearer + matches client screenshot */
  .cookie-popup:has(.cookie-panel ul li.details-panel.active) .cookie-cookies-display {
    display: block;
  }
}

.cookie-cookies-display h5 {
  color: var(--cookie-text-strong);
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 10px;
}

.cookie-cookies-display > p {
  color: var(--cookie-text);
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 16px;
}

.cookie-popup .cookie-panel ul li {
  width: 100%;
  text-align: center;
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
  line-height: 18px;
  padding: 14px 16px;
  margin-bottom: 0;
  color: var(--cookie-text);
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  border-bottom: 1px solid transparent;
}

@media (min-width: 769px) {
  .cookie-popup .cookie-panel ul li {
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    border-left: 3px solid transparent;
  }

  .cookie-popup .cookie-panel ul li.active {
    border-bottom-color: rgba(255, 255, 255, 0.06);
  }
}

.cookie-popup .cookie-panel ul li.active {
  color: var(--cookie-text-strong);
  background: rgba(245, 166, 35, 0.08);
  border-bottom: 1px solid var(--cookie-border);
}

@media (min-width: 769px) {
  .cookie-popup .cookie-panel ul li.active {
    border-left-color: var(--cookie-accent);
    border-bottom-color: rgba(255, 255, 255, 0.06);
  }
}

.cookie-category {
  padding: 12px 14px;
  border: 1px solid var(--cookie-border);
  margin: 0 0 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}

/* Checkbox visuals: same hit area & classes, only shape/spacing tweaked */
.cookie-cookies-display .cookie-category .choose {
  font-size: 14px;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1px solid var(--cookie-border);
  margin-right: 12px;
  cursor: pointer;
  position: relative;
  background: rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.cookie-cookies-display .cookie-category .choose.active {
      border-color: rgba(255, 255, 255, 0.12);
      background: rgba(255, 255, 255, 0.08);
}

.cookie-cookies-display .cookie-category .choose.active::before {
  content: "\2713";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) rotate(15deg);
  color: var(--cookie-accent);
  font-size: 12px;
  font-weight: bold;
}

.cookie-cookies-display .cookie-category .choose.always-on {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
  cursor: auto;
}

.cookie-cookies-display .cookie-category .choose.always-on::before {
  content: "\2713";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) rotate(15deg);
  color: var(--cookie-accent);
  font-size: 12px;
  font-weight: bold;
}

.cookie-cookies-display .cookie-category .data .data-resume .cat-main,
.cookie-cookies-display .cookie-category .data .data-resume .cat-main > div {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.cookie-cookies-display .cookie-category .data .data-resume .cat-main {
  margin-bottom: 10px;
}

.data-resume .cookie-cat-name {
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s ease;
  font-size: 14px;
  line-height: 1.35;
  color: var(--cookie-text-strong);
}

.cookie-cookies-display .cookie-category .data .data-resume .cat-describe {
  font-size: 14px;
  line-height: 1.5;
  color: var(--cookie-text);
}

/* Footer: split layout — copy left, actions right (same text & button labels) */
.cookie-decide {
  position: relative;
  bottom: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, rgba(0, 0, 0, 0.12) 100%), var(--cookie-bg);
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  transition: all 0.3s ease;
  flex-direction: row;
  flex-wrap: wrap;
  z-index: 1;
  border-top: 1px solid var(--cookie-border);
}

.cookie-decide .pre-cookie-box {
  flex: 1 1 280px;
  padding: 28px 32px;
  min-width: 0;
}

.cookie-decide .pre-cookie-box h3,
.cookie-decide .pre-cookie-box h3.text-yellow {
  color: var(--cookie-accent);
  -webkit-text-fill-color: var(--cookie-accent);
}

.cookie-decide .pre-cookie-box p {
  color: var(--cookie-text);
  -webkit-text-fill-color: var(--cookie-text);
}

.cookie-decide .pre-cookie-box a {
  color: var(--cookie-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cookie-decide .pre-cookie-box a:hover {
  color: var(--cookie-accent-hover);
}

.cookie-decide .imgBox {
  position: absolute;
  width: 300px;
  margin: 0 auto 20px;
  top: 0;
  right: 0;
  z-index: -1;
  opacity: 0.12;
}

.cookie-decide .btnList {
  list-style-type: none;
  display: flex;
  gap: 12px;
  align-items: stretch;
  justify-content: center;
  margin: 0 !important;
  flex: 1 1 240px;
  max-width: 320px;
  flex-direction: column;
  padding: 24px 28px;
  background: rgba(0, 0, 0, 0.18);
  border-left: 1px solid var(--cookie-border);
  box-sizing: border-box;
}

.cookie-decide .btnList li {
  width: 100%;
  text-align: center;
  cursor: pointer;
  transition: transform 0.28s ease, box-shadow 0.28s ease, background-color 0.28s ease, color 0.28s ease;
  background: var(--cookie-accent);
  font-weight: 700;
  letter-spacing: 0;
  border-radius: 14px;
  padding: 14px 18px;
  box-shadow: 0 8px 20px rgba(245, 166, 35, 0.28);
  border: none;
  flex: 0 0 auto;
}

.cookie-decide .btnList li:hover {
  background: var(--cookie-accent-hover);
  color: var(--cookie-btn-text);
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(245, 166, 35, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.6) inset;
}

.cookie-decide .btnList li.btn:after,
.cookie-decide .btnList li.btn:before {
  border-color: transparent;
}

.cookie-decide .btnList li.allow-selection {
  display: none;
}

/*
 * Details / preference view: .pre-cookie-box is hidden via JS — stretch actions full width
 * like the first screen (two primary actions side by side on desktop).
 */
.cookie-popup:has(.cookie-panel ul li.details-panel.active) .cookie-decide {
  flex-wrap: nowrap;
}

.cookie-popup:has(.cookie-panel ul li.details-panel.active) .cookie-decide .btnList {
  flex: 1 1 100%;
  max-width: none;
  width: 100%;
  flex-direction: row;
  align-items: stretch;
  justify-content: stretch;
  border-left: none;
  padding: 20px 28px 24px 32px;
  gap: 12px;
}

.cookie-popup:has(.cookie-panel ul li.details-panel.active) .cookie-decide .btnList li {
  flex: 1 1 50%;
  width: auto;
  min-width: 0;
}

@media (max-width: 768px) {
  .cookie-popup:has(.cookie-panel ul li.details-panel.active) .cookie-decide .btnList {
    flex-direction: column;
    padding: 16px 20px 20px;
  }

  .cookie-popup:has(.cookie-panel ul li.details-panel.active) .cookie-decide .btnList li {
    flex: 1 1 auto;
    width: 100%;
  }
}

@media (max-width: 768px) {
  .cookie-popup-container .cookie-popup {
    border-radius: 16px;
    border-left-width: 3px;
    max-width: 100%;
  }

  .cookie-popup-container .cookie-popup .cookie-popup-content-container.open {
    flex-direction: column;
    max-height: min(480px, 65vh);
  }

  .cookie-popup .cookie-panel ul li {
    text-align: center;
    border-left: none !important;
  }

  .cookie-popup .cookie-panel ul li.active {
    border-left: none !important;
    border-bottom: 2px solid var(--cookie-accent);
  }

  .cookie-decide {
    flex-direction: column;
  }

  .cookie-decide .pre-cookie-box {
    font-size: 14px;
    line-height: 20px;
    padding: 22px 20px;
    flex: 1 1 auto;
    border-bottom: 1px solid var(--cookie-border);
  }

  .cookie-decide .btnList {
    max-width: none;
    border-left: none;
    flex-direction: column;
    padding: 16px 20px 20px;
  }

  .cookie-decide .btnList li {
    font-size: 14px;
    width: 100%;
  }

  .cookie-cookies-display {
    display: block;
  }
}
