/* ==========================================================================
   Jam & Bottle — Extras
   Announcement bar, exit popup, cookie banner, parallax,
   preloader, scent chart, back-to-top
   ========================================================================== */


/* ==========================================================================
   1. ANNOUNCEMENT BAR
   ========================================================================== */

.announcement-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  height: 35px;
  background: var(--gold);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--sans);
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  padding: 0 3rem;
  transition: transform 0.4s var(--ease), opacity 0.4s var(--ease);
  will-change: transform;
}

.announcement-bar.is-hidden {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}

.announcement-bar__text {
  flex: 1;
  text-align: center;
}

.announcement-bar__close {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1;
  padding: 0.25rem 0.4rem;
  opacity: 0.7;
  transition: opacity 0.2s;
  font-family: var(--sans);
}

.announcement-bar__close:hover {
  opacity: 1;
}

/* Nav shift when announcement bar is present */
.has-announcement .nav {
  top: 35px;
}


/* ==========================================================================
   2. EXIT-INTENT EMAIL POPUP
   ========================================================================== */

.exit-popup {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s var(--ease), visibility 0.4s var(--ease);
}

.exit-popup.is-visible {
  opacity: 1;
  visibility: visible;
}

.exit-popup__overlay {
  position: absolute;
  inset: 0;
  background: rgba(8, 8, 13, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.exit-popup__modal {
  position: relative;
  z-index: 1;
  background: var(--ink-warm);
  border: 1px solid var(--cream-faint);
  max-width: 480px;
  width: 100%;
  padding: 3rem 2.5rem;
  text-align: center;
  transform: translateY(24px) scale(0.97);
  transition: transform 0.4s var(--ease);
}

.exit-popup.is-visible .exit-popup__modal {
  transform: translateY(0) scale(1);
}

.exit-popup__heading {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  color: var(--cream);
  margin-bottom: 0.75rem;
  line-height: 1.2;
}

.exit-popup__sub {
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 300;
  color: var(--cream-dim);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 2rem;
}

.exit-popup__form {
  display: flex;
  gap: 0;
  margin-bottom: 1.25rem;
}

.exit-popup__input {
  flex: 1;
  background: rgba(240, 230, 208, 0.06);
  border: 1px solid rgba(240, 230, 208, 0.2);
  border-right: none;
  color: var(--cream);
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 300;
  padding: 0.8rem 1rem;
  outline: none;
  transition: border-color 0.25s;
  min-width: 0;
}

.exit-popup__input::placeholder {
  color: rgba(240, 230, 208, 0.35);
}

.exit-popup__input:focus {
  border-color: var(--gold);
}

.exit-popup__btn {
  background: var(--gold);
  color: var(--ink);
  border: none;
  font-family: var(--sans);
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  padding: 0.8rem 1.2rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.25s;
  flex-shrink: 0;
}

.exit-popup__btn:hover {
  background: var(--honeyed);
}

.exit-popup__dismiss {
  font-family: var(--sans);
  font-size: 0.7rem;
  color: rgba(240, 230, 208, 0.4);
  cursor: pointer;
  background: none;
  border: none;
  letter-spacing: 0.05em;
  padding: 0;
  transition: color 0.2s;
  display: inline-block;
}

.exit-popup__dismiss:hover {
  color: var(--cream-dim);
}

.exit-popup__success {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.4rem;
  color: var(--gold);
  padding: 1rem 0;
}

@media (max-width: 480px) {
  .exit-popup__modal {
    padding: 2.25rem 1.5rem;
  }

  .exit-popup__form {
    flex-direction: column;
    gap: 0.5rem;
  }

  .exit-popup__input {
    border-right: 1px solid rgba(240, 230, 208, 0.2);
  }

  .exit-popup__btn {
    width: 100%;
    padding: 0.9rem;
  }
}


/* ==========================================================================
   3. COOKIE CONSENT BANNER
   ========================================================================== */

.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 400;
  background: var(--ink-warm);
  border-top: 1px solid var(--cream-faint);
  padding: 0.9rem clamp(1.5rem, 4vw, 3rem);
  display: flex;
  align-items: center;
  gap: 1.5rem;
  transform: translateY(100%);
  transition: transform 0.45s var(--ease);
}

.cookie-banner.is-visible {
  transform: translateY(0);
}

.cookie-banner.is-hidden {
  transform: translateY(100%);
}

.cookie-banner__text {
  flex: 1;
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 300;
  color: var(--cream-dim);
  letter-spacing: 0.02em;
}

.cookie-banner__text a {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cookie-banner__text a:hover {
  color: var(--honeyed);
}

.cookie-banner__accept {
  background: var(--gold);
  color: var(--ink);
  border: none;
  font-family: var(--sans);
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  padding: 0.55rem 1.1rem;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.25s;
}

.cookie-banner__accept:hover {
  background: var(--honeyed);
}

@media (max-width: 600px) {
  .cookie-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1.2rem 1.5rem;
  }

  .cookie-banner__accept {
    width: 100%;
    text-align: center;
    padding: 0.75rem;
  }
}


/* ==========================================================================
   4. PARALLAX
   ========================================================================== */

.fragrance-feature__image img,
.hero__image img {
  will-change: transform;
  transition: transform 0.05s linear;
}

/* On reduced motion, disable */
@media (prefers-reduced-motion: reduce) {
  .fragrance-feature__image img,
  .hero__image img {
    will-change: auto;
    transform: none !important;
    transition: none;
  }
}


/* ==========================================================================
   5. PRELOADER
   ========================================================================== */

.preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.75rem;
  opacity: 1;
  transition: opacity 0.7s var(--ease);
}

.preloader.is-fading {
  opacity: 0;
  pointer-events: none;
}

.preloader__moo {
  width: 72px;
  height: 72px;
  animation: preloader-pulse 2s ease-in-out infinite;
}

@keyframes preloader-pulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50%       { opacity: 1;   transform: scale(1.06); }
}

.preloader__wordmark {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: 1.3rem;
  letter-spacing: 0.18em;
  color: var(--cream-dim);
}


/* ==========================================================================
   6. SCENT COMPARISON CHART
   ========================================================================== */

.scent-chart {
  padding: 6rem 0 7rem;
}

.scent-chart__header {
  text-align: center;
  margin-bottom: 3.5rem;
}

.scent-chart__header h2 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.25;
  color: var(--cream);
}

.scent-chart__header h2 em {
  font-style: italic;
  color: var(--gold);
}

.scent-chart__table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.scent-chart__table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
}

/* Header row */
.scent-chart__table thead th {
  padding: 1.5rem 1.25rem;
  text-align: center;
  background: var(--ink-card);
  border-bottom: 1px solid var(--cream-faint);
  font-family: var(--serif);
  font-weight: 300;
  font-size: 1.1rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.scent-chart__table thead th:first-child {
  text-align: left;
  color: rgba(240, 230, 208, 0.35);
  font-family: var(--sans);
  font-size: 0.6rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  background: transparent;
  border-bottom-color: transparent;
}

.scent-chart__number {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.9rem;
  display: block;
  margin-bottom: 0.15rem;
  opacity: 0.8;
}

/* Body rows */
.scent-chart__table tbody tr {
  border-bottom: 1px solid var(--cream-faint);
  transition: background 0.2s;
}

.scent-chart__table tbody tr:hover {
  background: rgba(240, 230, 208, 0.03);
}

.scent-chart__table tbody td {
  padding: 1.1rem 1.25rem;
  text-align: center;
  background: var(--ink-card);
}

.scent-chart__table tbody td:first-child {
  text-align: left;
  background: transparent;
  font-family: var(--sans);
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: rgba(240, 230, 208, 0.5);
  white-space: nowrap;
}

/* Mood / Best-for text values */
.scent-chart__value {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.05rem;
  font-weight: 300;
  color: var(--cream);
}

/* Dot rating */
.scent-chart__dots {
  display: inline-flex;
  gap: 5px;
  align-items: center;
}

.scent-chart__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.scent-chart__dot--filled {
  /* accent colour set inline via style attribute */
}

.scent-chart__dot--empty {
  background: transparent;
  border: 1px solid rgba(240, 230, 208, 0.18);
}

@media (max-width: 640px) {
  .scent-chart {
    padding: 4rem 0 5rem;
  }

  .scent-chart__table thead th,
  .scent-chart__table tbody td {
    padding: 0.9rem 0.9rem;
  }
}


/* ==========================================================================
   7. BACK TO TOP
   ========================================================================== */

.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 300;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--ink-warm);
  border: 1px solid var(--cream-faint);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition:
    opacity 0.35s var(--ease),
    visibility 0.35s var(--ease),
    transform 0.35s var(--ease),
    border-color 0.25s,
    box-shadow 0.25s;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  border-color: var(--gold);
  transform: translateY(-2px) scale(1.06);
  box-shadow: 0 4px 20px rgba(201, 168, 76, 0.18);
}

.back-to-top svg {
  width: 16px;
  height: 16px;
  display: block;
  flex-shrink: 0;
}

/* Push above cookie banner if both visible */
.cookie-banner.is-visible ~ .back-to-top,
body:has(.cookie-banner.is-visible) .back-to-top {
  bottom: calc(2rem + 60px);
}

@media (max-width: 600px) {
  .back-to-top {
    bottom: 1.25rem;
    right: 1.25rem;
  }
}
