/* Cookie consent — matches Bidani Projects site container boundaries */

.cookie-consent {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 1200;
  padding: 0 0 18px;
  pointer-events: none;
}

.cookie-consent[hidden] {
  display: none !important;
}

.cookie-consent__shell {
  width: min(var(--container, 1320px), calc(100% - 64px));
  margin-inline: auto;
  pointer-events: none;
}

.cookie-consent__panel {
  pointer-events: auto;
  width: 100%;
  background: #050505;
  color: #fff;
  border-top: 2px solid var(--gold, #f2c300);
  box-shadow: 0 -12px 40px rgba(0, 0, 0, .28);
  padding: 22px 24px 20px;
  box-sizing: border-box;
}

.cookie-consent__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, auto);
  gap: 22px 28px;
  align-items: end;
  width: 100%;
}

.cookie-consent__intro,
.cookie-consent__actions,
.cookie-consent__prefs {
  min-width: 0;
}

.cookie-consent__intro[hidden],
.cookie-consent__actions[hidden],
.cookie-consent__prefs[hidden] {
  display: none !important;
}

.cookie-consent__title {
  margin: 0 0 8px;
  font-family: var(--serif, "Merriweather", Georgia, serif);
  font-size: clamp(20px, 2.2vw, 26px);
  line-height: 1.2;
  letter-spacing: -.02em;
  color: #fff;
}

.cookie-consent__title--prefs {
  font-size: 20px;
  margin-bottom: 12px;
}

.cookie-consent__text {
  margin: 0;
  max-width: 62ch;
  color: rgba(255, 255, 255, .72);
  font-size: 13.5px;
  line-height: 1.65;
}

.cookie-consent__actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
  justify-items: stretch;
  width: 100%;
  max-width: 480px;
  justify-self: end;
}

.cookie-consent__btn {
  min-height: 44px;
  width: 100%;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
  box-sizing: border-box;
}

.cookie-consent__btn:focus-visible {
  outline: 2px solid var(--gold, #f2c300);
  outline-offset: 3px;
}

.cookie-consent__btn--accept {
  background: var(--gold, #f2c300);
  color: #000;
}

.cookie-consent__btn--accept:hover {
  background: var(--gold-bright, #ffd21a);
}

.cookie-consent__btn--reject {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, .34);
}

.cookie-consent__btn--reject:hover {
  border-color: #fff;
}

.cookie-consent__btn--customize {
  background: #fff;
  color: #000;
}

.cookie-consent__btn--customize:hover {
  background: #ececea;
}

.cookie-consent__btn--save {
  background: var(--gold, #f2c300);
  color: #000;
}

.cookie-consent__btn--save:hover {
  background: var(--gold-bright, #ffd21a);
}

.cookie-consent__btn--ghost {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, .34);
}

.cookie-consent__btn--ghost:hover {
  border-color: #fff;
}

/* Preferences view: replaces banner actions, scrolls inside viewport */
.cookie-consent--prefs .cookie-consent__panel {
  max-height: 85dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-top: 18px;
  padding-bottom: 16px;
}

.cookie-consent--prefs .cookie-consent__grid {
  grid-template-columns: 1fr;
  gap: 0;
  align-items: stretch;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.cookie-consent__prefs {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
}

.cookie-consent__prefs-scroll {
  display: grid;
  gap: 12px;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding-right: 2px;
}

.cookie-consent__category {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 56px;
  gap: 12px 16px;
  align-items: center;
  padding: 12px 14px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .1);
  box-sizing: border-box;
}

.cookie-consent__category--necessary {
  background: rgba(255, 255, 255, .03);
  border-color: rgba(255, 255, 255, .08);
  opacity: 1;
  pointer-events: none;
  user-select: none;
}

.cookie-consent__category--necessary .cookie-consent__category-title,
.cookie-consent__category--necessary .cookie-consent__category-desc {
  color: rgba(255, 255, 255, .48);
}

.cookie-consent__category-copy {
  min-width: 0;
}

.cookie-consent__category-title {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.cookie-consent__category-desc {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: rgba(255, 255, 255, .68);
  max-width: 70ch;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.cookie-consent__control {
  width: 56px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cookie-consent__switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  min-height: 44px;
  padding: 0;
  cursor: pointer;
  user-select: none;
}

.cookie-consent__switch--disabled {
  cursor: default;
  pointer-events: none;
}

.cookie-consent__switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
}

.cookie-consent__track {
  width: 42px;
  height: 24px;
  border-radius: 0;
  background: rgba(255, 255, 255, .18);
  border: 1px solid rgba(255, 255, 255, .28);
  position: relative;
  flex: 0 0 auto;
  transition: background .2s ease, border-color .2s ease;
}

.cookie-consent__track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: #fff;
  transition: transform .2s ease, background .2s ease;
}

.cookie-consent__switch input:checked + .cookie-consent__track {
  background: var(--gold, #f2c300);
  border-color: var(--gold, #f2c300);
}

.cookie-consent__switch input:checked + .cookie-consent__track::after {
  transform: translateX(18px);
  background: #000;
}

.cookie-consent__switch input:focus-visible + .cookie-consent__track {
  outline: 2px solid var(--gold, #f2c300);
  outline-offset: 3px;
}

/* Necessary toggle: same size, muted grey, always ON */
.cookie-consent__category--necessary .cookie-consent__track,
.cookie-consent__switch--disabled input:checked + .cookie-consent__track {
  background: rgba(255, 255, 255, .22);
  border-color: rgba(255, 255, 255, .28);
}

.cookie-consent__category--necessary .cookie-consent__track::after,
.cookie-consent__switch--disabled input:checked + .cookie-consent__track::after {
  background: rgba(255, 255, 255, .55);
  transform: translateX(18px);
}

.cookie-consent__prefs-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 4px;
  flex: 0 0 auto;
  width: 100%;
  max-width: 480px;
  justify-self: end;
  align-self: end;
}

.cookie-consent-settings {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  color: rgba(255, 255, 255, .68);
  font: inherit;
  font-size: 12.5px;
  line-height: inherit;
  text-align: left;
  width: fit-content;
  cursor: pointer;
}

.cookie-consent-settings:hover {
  color: #fff;
}

.cookie-consent-settings:focus-visible {
  outline: 2px solid var(--gold, #f2c300);
  outline-offset: 3px;
}

.footer-links .cookie-consent-settings {
  display: block;
}

/* Tablet intermediate: keep near-full-width shell, avoid desktop float */
@media (max-width: 1023px) {
  .cookie-consent__shell {
    width: min(var(--container, 1320px), calc(100% - 40px));
  }

  .cookie-consent__panel {
    padding-left: 20px;
    padding-right: 20px;
  }
}

@media (max-width: 820px) {
  .cookie-consent {
    padding-bottom: 10px;
  }

  .cookie-consent__shell {
    width: calc(100% - 24px);
  }

  .cookie-consent__panel {
    padding: 16px 16px 14px;
  }

  .cookie-consent__grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .cookie-consent__title {
    font-size: 19px;
    margin-bottom: 6px;
  }

  .cookie-consent__text {
    font-size: 13px;
    line-height: 1.55;
  }

  .cookie-consent__actions,
  .cookie-consent__prefs-actions {
    max-width: none;
    justify-self: stretch;
    align-self: stretch;
  }

  .cookie-consent__actions {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .cookie-consent__btn {
    min-height: 42px;
  }

  .cookie-consent--prefs .cookie-consent__panel {
    padding: 14px 16px 12px;
  }

  .cookie-consent__category {
    grid-template-columns: minmax(0, 1fr) 48px;
    gap: 10px 12px;
    padding: 10px 12px;
    align-items: center;
  }

  .cookie-consent__control {
    width: 48px;
    min-height: 40px;
  }

  .cookie-consent__category-desc {
    font-size: 12px;
  }
}

@media (max-width: 375px) {
  .cookie-consent__shell {
    width: calc(100% - 16px);
  }

  .cookie-consent__panel {
    padding: 14px 14px 12px;
  }

  .cookie-consent__category {
    grid-template-columns: minmax(0, 1fr) 44px;
  }

  .cookie-consent__control {
    width: 44px;
  }
}

/* Desktop: compact floating panel, bottom-right */
@media (min-width: 1024px) {
  .cookie-consent {
    inset: auto 24px 24px auto;
    width: min(800px, calc(100vw - 48px));
    max-width: min(800px, calc(100vw - 48px));
    padding: 0;
    box-sizing: border-box;
  }

  .cookie-consent__shell {
    width: 100%;
    max-width: 100%;
    margin: 0;
  }

  .cookie-consent__panel {
    padding: 20px 24px;
    max-width: 100%;
    overflow-x: hidden;
  }

  .cookie-consent__grid {
    grid-template-columns: 1fr;
    gap: 14px;
    align-items: start;
  }

  .cookie-consent__title {
    margin-bottom: 6px;
  }

  .cookie-consent__text {
    max-width: none;
  }

  .cookie-consent__actions {
    max-width: none;
    justify-self: stretch;
    gap: 8px;
  }

  .cookie-consent__prefs-actions {
    max-width: none;
    justify-self: stretch;
    align-self: stretch;
  }

  .cookie-consent--prefs .cookie-consent__panel {
    max-height: 85dvh;
    padding: 20px 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cookie-consent__btn,
  .cookie-consent__track,
  .cookie-consent__track::after {
    transition: none;
  }
}
