/* ==========================================================================
   Loungest Limited - GDPR Cookie Consent Styles
   ========================================================================== */

.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1200;
  display: none;
  background: rgba(18, 17, 23, 0.97);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-top: 1px solid var(--line-2);
  box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.6);
}
.cookie-banner.is-open { display: block; }
@media (prefers-reduced-transparency: reduce) {
  .cookie-banner { background: var(--surface); backdrop-filter: none; -webkit-backdrop-filter: none; }
}

.cookie-banner-inner {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding: 1.25rem var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(1rem, 2.5vw, 2.5rem);
}
.cookie-text {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--body);
  max-width: 78ch;
}
.cookie-text a {
  color: var(--text);
  border-bottom: 1px solid var(--red);
  text-decoration: none;
  transition: color 0.15s, border-color 0.15s;
}
.cookie-text a:hover {
  color: #fff;
  border-color: var(--red-hover);
}

.cookie-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  flex-shrink: 0;
}

.cookie-btn {
  font-family: var(--sans);
  font-size: 0.88rem;
  font-weight: 500;
  white-space: nowrap;
  padding: 0.65rem 1.15rem;
  border-radius: var(--r);
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
}
.cookie-btn:hover {
  border-color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}
.cookie-btn:active {
  transform: translateY(1px);
}
.cookie-btn-accept {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}
.cookie-btn-accept:hover {
  background: var(--red-hover);
  border-color: var(--red-hover);
}

@media (max-width: 860px) {
  .cookie-banner-inner {
    flex-direction: column;
    align-items: stretch;
    padding-block: 1.2rem;
  }
  .cookie-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .cookie-btn-settings {
    grid-column: 1 / -1;
  }
}

/* --- Preferences Modal --- */
.cookie-modal {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--pad);
  background: rgba(6, 5, 8, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.cookie-modal.is-open { display: flex; }

.cookie-modal-card {
  width: 100%;
  max-width: 560px;
  max-height: 86vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  padding: clamp(1.5rem, 3.5vw, 2.25rem);
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.8);
}
.cookie-modal-card h2 {
  font-family: var(--display);
  font-size: clamp(1.35rem, 2.2vw, 1.7rem);
  margin-bottom: 0.5rem;
  color: var(--text);
}
.cookie-modal-intro {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
}

.cookie-option {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1.2rem 0;
  border-top: 1px solid var(--line);
}
.cookie-option h3 {
  font-family: var(--display);
  font-size: 1rem;
  margin-bottom: 0.35rem;
  color: var(--text);
}
.cookie-option p {
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--muted);
}

.cookie-always {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brass);
  white-space: nowrap;
  padding-top: 4px;
}

/* Switch */
.cookie-switch {
  position: relative;
  flex-shrink: 0;
  width: 46px;
  height: 26px;
}
.cookie-switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.cookie-slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--raised);
  border: 1px solid var(--line-2);
  transition: background-color 0.2s, border-color 0.2s;
  pointer-events: none;
}
.cookie-slider::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--text);
  transition: transform 0.2s;
}
.cookie-switch input:checked + .cookie-slider {
  background: var(--red);
  border-color: var(--red);
}
.cookie-switch input:checked + .cookie-slider::before {
  transform: translateX(20px);
}
.cookie-switch input:focus-visible + .cookie-slider {
  outline: 2px solid var(--red);
  outline-offset: 3px;
}

.cookie-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: flex-end;
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}
@media (max-width: 520px) {
  .cookie-modal-actions {
    flex-direction: column-reverse;
  }
  .cookie-modal-actions .cookie-btn {
    width: 100%;
  }
}

/* Footer entry point */
.cookie-prefs-btn {
  font-family: inherit;
  font-size: inherit;
  color: var(--body);
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  text-align: left;
  transition: color 0.15s;
}
.cookie-prefs-btn:hover {
  color: var(--text);
}

/* Accessibility launcher coordination */
html.lm-consent-open #a11y-widget-container {
  bottom: calc(var(--lm-consent-h, 120px) + 20px) !important;
}
html.lm-consent-modal #a11y-widget-container {
  display: none !important;
}
