/**
 * SOULÉPUREVANA — Luxury Consent Banner & Modal Styles (Phase 19)
 * ===============================================================
 * Accessible (WCAG 2.2 AA), responsive, and cohesive with the
 * warm botanical luxury aesthetic of Soulépurevana.
 */

/* ── Floating Bottom Banner ───────────────────────────────────────────────── */
.pv-consent-banner {
  position: fixed;
  bottom: 24px;
  left: 24px;
  right: 24px;
  max-width: 980px;
  margin: 0 auto;
  background: rgba(7, 37, 21, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(201, 162, 39, 0.4);
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  color: #FFFFFF;
  padding: 1.5rem 2rem;
  z-index: 99999;
  transform: translateY(0);
  opacity: 1;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease;
}

.pv-consent-banner.is-hidden {
  transform: translateY(30px);
  opacity: 0;
  pointer-events: none;
}

.pv-consent-banner__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.pv-consent-banner__content {
  flex: 1 1 500px;
}

.pv-consent-banner__header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0.5rem;
}

.pv-consent-banner__title {
  font-family: var(--font-display, 'Playfair Display', serif);
  font-size: 1.15rem;
  font-weight: 600;
  color: #E8C84A;
  letter-spacing: 0.02em;
  margin: 0;
}

.pv-consent-banner__text {
  font-family: var(--font-sans, 'Plus Jakarta Sans', sans-serif);
  font-size: 0.875rem;
  line-height: 1.55;
  color: #D1D5DB;
  margin: 0;
}

.pv-consent-banner__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.pv-consent-btn {
  font-family: var(--font-sans, 'Plus Jakarta Sans', sans-serif);
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 10px 18px;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.pv-consent-btn:focus-visible {
  outline: 2px solid #E8C84A;
  outline-offset: 3px;
}

.pv-consent-btn--accept {
  background: linear-gradient(135deg, #C9A227 0%, #E8C84A 100%);
  color: #072515;
  border: none;
  font-weight: 700;
}

.pv-consent-btn--accept:hover {
  background: #E8C84A;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(201, 162, 39, 0.3);
}

.pv-consent-btn--decline {
  background: transparent;
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.pv-consent-btn--decline:hover {
  border-color: #FFFFFF;
  background: rgba(255, 255, 255, 0.08);
}

.pv-consent-btn--prefs {
  background: transparent;
  color: #E8C84A;
  border: none;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 8px 12px;
}

.pv-consent-btn--prefs:hover {
  color: #FFFFFF;
}

/* ── Preferences Modal ────────────────────────────────────────────────────── */
.pv-consent-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 100000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.pv-consent-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.pv-consent-modal__dialog {
  background: #072515;
  border: 1px solid rgba(201, 162, 39, 0.4);
  border-radius: 20px;
  max-width: 580px;
  width: 100%;
  color: #FFFFFF;
  padding: 2rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  transform: scale(0.95);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.pv-consent-modal.is-open .pv-consent-modal__dialog {
  transform: scale(1);
}

.pv-consent-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid rgba(201, 162, 39, 0.2);
  padding-bottom: 1rem;
}

.pv-consent-modal__title {
  font-family: var(--font-display, 'Playfair Display', serif);
  font-size: 1.35rem;
  color: #E8C84A;
  margin: 0;
}

.pv-consent-modal__close {
  background: transparent;
  border: none;
  color: #9CA3AF;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 4px;
}

.pv-consent-modal__close:hover,
.pv-consent-modal__close:focus-visible {
  color: #FFFFFF;
  outline: 2px solid #E8C84A;
}

.pv-pref-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.pv-pref-item__info h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: #FFFFFF;
  margin: 0 0 4px;
}

.pv-pref-item__info p {
  font-size: 0.8125rem;
  color: #9CA3AF;
  line-height: 1.4;
  margin: 0;
}

/* ── Toggle Switch ────────────────────────────────────────────────────────── */
.pv-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

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

.pv-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #374151;
  transition: 0.25s ease;
  border-radius: 9999px;
}

.pv-slider::before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.25s ease;
  border-radius: 50%;
}

.pv-switch input:checked + .pv-slider {
  background-color: #C9A227;
}

.pv-switch input:checked + .pv-slider::before {
  transform: translateX(20px);
}

.pv-switch input:focus-visible + .pv-slider {
  box-shadow: 0 0 0 3px rgba(232, 200, 74, 0.4);
}

.pv-consent-modal__footer {
  margin-top: 1.75rem;
  text-align: right;
}

@media (max-width: 640px) {
  .pv-consent-banner {
    bottom: 80px; /* Above mobile bottom nav */
    left: 12px;
    right: 12px;
    padding: 1.25rem 1.25rem;
  }
  .pv-consent-banner__actions {
    width: 100%;
    justify-content: stretch;
  }
  .pv-consent-btn--accept,
  .pv-consent-btn--decline {
    flex: 1 1 auto;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pv-consent-banner,
  .pv-consent-modal,
  .pv-consent-modal__dialog,
  .pv-slider,
  .pv-slider::before {
    transition: none !important;
    animation: none !important;
  }
}
