/* Motel Mediteran — Cookie consent banner
   - ONE element with two states: compact (default) + expanded (preference center)
   - Matches site design: square edges, hairline borders, Inter typography
   - Bottom-anchored, fixed position
   - Industry-standard 4-category structure (Strictly Necessary / Performance / Functional / Targeting)
*/

/* Backdrop dims page when banner is expanded */
.cookie-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 260ms ease;
  z-index: 7999;
}
.cookie-backdrop.is-visible {
  opacity: 1;
  pointer-events: auto;
}

/* ONE box, two states */
.cookie-banner {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 640px;

  padding: 18px 22px;
  background: #ffffff;
  border: 1px solid rgba(10, 10, 10, 0.35);
  border-radius: 0;
  box-shadow: 0 4px 16px rgba(10, 10, 10, 0.08);

  font-family: Inter, system-ui, -apple-system, sans-serif;
  color: #0a0a0a;
  z-index: 8000;

  transition: max-width 320ms ease, max-height 320ms ease,
              padding 320ms ease, box-shadow 320ms ease;
}

/* Compact view */
.cookie-banner__compact {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.cookie-banner__expanded { display: none; }

.cookie-banner__text {
  flex: 1 1 280px;
  font-size: 13.5px;
  line-height: 1.55;
  color: rgba(10, 10, 10, 0.85);
}
.cookie-banner__text a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.cookie-banner__actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

/* Buttons — match .mm-footer__book pattern */
.cookie-banner__btn {
  appearance: none;
  display: inline-block;
  padding: 12px 22px;
  background: #fff;
  color: #0a0a0a;
  border: 1px solid rgba(10, 10, 10, 0.35);
  border-radius: 0;
  font-family: Inter, sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.cookie-banner__btn:hover {
  background: #0a0a0a;
  color: #fff;
  border-color: #0a0a0a;
}
.cookie-banner__btn--primary {
  background: #0a0a0a;
  color: #fff;
  border-color: #0a0a0a;
}
.cookie-banner__btn--primary:hover {
  background: #2a2a2a;
  border-color: #2a2a2a;
}
.cookie-banner__btn:focus-visible {
  outline: 3px solid #0a0a0a;
  outline-offset: 2px;
}

/* Mobile: stack actions below text */
@media (max-width: 520px) {
  .cookie-banner { padding: 16px 18px; gap: 14px; }
  .cookie-banner__actions {
    width: 100%;
    justify-content: stretch;
  }
  .cookie-banner__btn { flex: 1; padding: 12px 14px; }
}

/* === EXPANDED STATE — same box grows upward, white background stays === */
.cookie-banner.is-expanded {
  max-width: 600px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 22px 24px 20px;
}
.cookie-banner.is-expanded .cookie-banner__compact { display: none; }
.cookie-banner.is-expanded .cookie-banner__expanded { display: block; }

/* X close (visible only when expanded) */
.cookie-banner__close {
  position: absolute;
  top: 10px;
  right: 14px;
  width: 32px;
  height: 32px;
  background: transparent;
  border: 0;
  font-size: 22px;
  line-height: 1;
  color: rgba(10, 10, 10, 0.6);
  cursor: pointer;
}
.cookie-banner__close:hover { color: #0a0a0a; }

/* Preference center inner styles */
.pref-title {
  font-family: Inter, sans-serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin: 0 0 14px;
  color: #0a0a0a;
}
.pref-intro {
  font-family: Inter, sans-serif;
  font-size: 13px;
  line-height: 1.55;
  margin: 0 0 10px;
  color: rgba(10, 10, 10, 0.78);
}
.pref-more {
  margin: 0 0 16px;
  font-family: Inter, sans-serif;
  font-size: 12px;
}
.pref-more a,
.pref-cat__desc a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.pref-allow-all { margin: 0 0 20px; }
.pref-section-title {
  font-family: Inter, sans-serif;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin: 0 0 10px;
  color: rgba(10, 10, 10, 0.7);
}

/* Collapsible category row */
.pref-cat {
  border-top: 1px solid rgba(10, 10, 10, 0.12);
}
.pref-cat > summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 28px 12px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: relative;
}
.pref-cat > summary::-webkit-details-marker { display: none; }
.pref-cat > summary::after {
  content: "\203A";
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  color: rgba(10, 10, 10, 0.45);
  transition: transform 200ms ease;
}
.pref-cat[open] > summary::after { transform: translateY(-50%) rotate(90deg); }
.pref-cat__title {
  font-family: Inter, sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #4a4a4a;
  flex: 1;
}
.pref-cat__state {
  font-family: Inter, sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #0a0a0a;
  white-space: nowrap;
}

/* iOS-style toggle switch */
.pref-toggle {
  appearance: none;
  border: 0;
  padding: 0;
  background: rgba(10, 10, 10, 0.22);
  width: 34px;
  height: 18px;
  border-radius: 999px;
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 200ms ease;
}
.pref-toggle::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  background: #fff;
  border-radius: 50%;
  transition: transform 200ms ease;
  box-shadow: 0 1px 2px rgba(10, 10, 10, 0.25);
}
.pref-toggle[aria-checked="true"] { background: #0a0a0a; }
.pref-toggle[aria-checked="true"]::after { transform: translateX(16px); }
.pref-toggle:focus-visible {
  outline: 2px solid #0a0a0a;
  outline-offset: 2px;
}
/* Locked-on toggle for Strictly Necessary — visually "on" but unchangeable.
   Slightly muted black so users see it's not interactive. */
.pref-toggle--locked,
.pref-toggle[disabled] {
  background: rgba(10, 10, 10, 0.55) !important;
  cursor: not-allowed;
}

.pref-cat > summary:focus:not(:focus-visible) { outline: none; }
.pref-cat > summary:focus-visible {
  outline: 2px solid #0a0a0a;
  outline-offset: -2px;
}
.pref-cat__desc {
  margin: 0;
  padding: 0 0 12px;
  font-family: Inter, sans-serif;
  font-size: 12px;
  line-height: 1.5;
  color: rgba(10, 10, 10, 0.7);
}

.pref-actions-row {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(10, 10, 10, 0.12);
  display: flex;
  justify-content: flex-end;
}

@media (max-width: 560px) {
  .cookie-banner.is-expanded { padding: 22px 18px 18px; }
}

/* Respect reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .cookie-banner,
  .cookie-backdrop,
  .pref-toggle,
  .pref-toggle::after,
  .pref-cat > summary::after {
    transition: none !important;
  }
}
