/* ==========================================================================
   ABERCROMBIE & Scentz — GLOBAL
   Design tokens, reset, typography, and shared components.
   Page-specific styles live in styles.css
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. TOKENS
   -------------------------------------------------------------------------- */
:root {
  /* Core earth palette */
  --color-black:        #15160F;   /* page base — deep warm charcoal */
  --color-charcoal:     #20221A;   /* raised surfaces */
  --color-forest:       #1E2A1C;   /* deep green */
  --color-moss:         #1f2d15;   /* mid green */
  --color-sage:         #8A9A7B;   /* light green — accents, borders */
  --color-bark:         #3A2E23;   /* dark brown */
  --color-clay:         #7A6248;   /* mid brown */
  --color-tan:          #C9B79C;   /* warm tan */
  --color-linen:        #EDE6DA;   /* off-white — primary text */
  --color-white:        #FFFFFF;

  /* Semantic */
  --bg-page:            var(--color-black);
  --bg-surface:         var(--color-charcoal);
  --text-primary:       var(--color-linen);
  --text-muted:         rgba(237, 230, 218, 0.872);
  --text-subtle:        rgba(237, 230, 218, 0.869);
  --accent:             var(--color-moss);
  --accent-hover:       #5C7248;
  --border-hairline:    rgba(237, 230, 218, 0.14);
  /* Typography */
  --font-display: "Cormorant Garamond", "Times New Roman", serif;
  --font-body:    "Jost", "Helvetica Neue", Arial, sans-serif;

  --fs-hero:    clamp(2.75rem, 8vw, 5.5rem);
  --fs-h2:      clamp(2rem, 4.5vw, 3.25rem);
  --fs-h3:      clamp(1.35rem, 2.5vw, 1.75rem);
  --fs-lead:    clamp(1rem, 1.6vw, 1.175rem);
  --fs-body:    1rem;
  --fs-small:   0.875rem;
  --fs-eyebrow: 0.75rem;

  --tracking-wide:  0.12em;
  --tracking-wider: 0.22em;

  /* Spacing */
  --space-xs:  0.5rem;
  --space-sm:  1rem;
  --space-md:  1.5rem;
  --space-lg:  2.5rem;
  --space-xl:  4rem;
  --space-2xl: 6rem;

  /* Layout */
  --container-max: 1360px;
  --gutter: clamp(1.25rem, 5vw, 4rem);
  --logo-height: 100px;                              /* nav lockup height */
  --nav-height: calc(var(--logo-height) + 2rem);     /* logo + breathing room */

  /* Effects */
  --radius-sm: 2px;
  --radius-pill: 50px;
  --transition: 350ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* --------------------------------------------------------------------------
   2. RESET
   -------------------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-page);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: 300;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, picture, svg, video {
  display: block;
  max-width: 100%;
}

button, input, textarea, select {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
}

button { cursor: pointer; }

a {
  color: inherit;
  text-decoration: none;
}

ul, ol { list-style: none; }

:focus-visible {
  outline: 2px solid var(--color-sage);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* --------------------------------------------------------------------------
   3. TYPOGRAPHY
   -------------------------------------------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 300;
  line-height: 1.08;
  letter-spacing: -0.015em;
}

h1 { font-size: var(--fs-hero); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }

.eyebrow {
  font-family: var(--font-body);
  font-size: var(--fs-eyebrow);
  font-weight: 400;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--color-tan);
}

.lead {
  font-size: var(--fs-lead);
  color: var(--text-muted);
  line-height: 1.75;
  max-width: 46ch;
}

/* --------------------------------------------------------------------------
   4. LAYOUT
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: var(--space-2xl);
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   5. BUTTONS
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: 1.05rem 2.5rem;
  font-size: var(--fs-small);
  font-weight: 400;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  border-radius: var(--radius-pill);
  transition: background-color var(--transition), color var(--transition),
              border-color var(--transition), transform var(--transition);
  white-space: nowrap;
}

.btn:active { transform: translateY(1px); }

/* Solid-path icon inside a button (e.g. the arrow on "Shop Now") */
.btn__icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  fill: currentColor;
  stroke: none;
  transition: transform var(--transition);
}

.btn:hover .btn__icon { transform: translateX(4px); }

.btn--primary {
  background-color: var(--color-sage);
  color: var(--color-linen);
}
.btn--primary:hover { background-color: var(--accent-hover); }

.btn--ghost {
  border: 1px solid var(--color-sage);
  color: var(--text-primary);
}
.btn--ghost:hover {
  border-color: var(--color-sage);
  background-color: var(--color-sage);
}

/* --------------------------------------------------------------------------
   5b. FORM FIELDS  (shared — used on checkout + contact)
   -------------------------------------------------------------------------- */
/* Any rule that sets `display` outranks the browser's [hidden] rule, so JS
   toggling `.hidden = true` silently does nothing. Make [hidden] win. */
[hidden] { display: none !important; }

.field {
  display: block;
  margin-bottom: var(--space-sm);
}

.field__label {
  display: block;
  font-size: 0.7rem;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-subtle);
  margin-bottom: 0.4rem;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 0.85rem 1rem;
  background-color: var(--color-charcoal);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  transition: border-color var(--transition);
}

.field textarea {
  min-height: 7rem;
  resize: vertical;
  line-height: 1.6;
}

.field input::placeholder,
.field textarea::placeholder { color: var(--text-subtle); }

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--color-sage);
}

/* Select — strip native chrome, add a custom chevron */
.field select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2.75rem;
  cursor: pointer;
  color-scheme: dark;   /* dark native dropdown list where supported */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' fill='none' stroke='%23C9B79C' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 12px;
}

/* Placeholder look while the disabled first option is still selected */
.field select:required:invalid { color: var(--text-subtle); }

.field select option { color: var(--text-primary); background-color: var(--color-charcoal); }
.field select option[disabled] { color: var(--text-subtle); }

.field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: var(--space-sm);
}

/* --------------------------------------------------------------------------
   6. NAVIGATION
   -------------------------------------------------------------------------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  transition: background-color var(--transition), border-color var(--transition);
  border-bottom: 1px solid transparent;
}

/* Applied by main.js once the user scrolls past the fold */
.nav.is-scrolled {
  background-color: rgba(11, 12, 10, 0.88);
  backdrop-filter: blur(14px);
  border-bottom-color: var(--border-hairline);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  width: 100%;
}

.nav__logo {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-shrink: 0;
}

.nav__logo-img {
  height: var(--logo-height);
  width: auto;
  display: block;
  flex-shrink: 0;
}

/* --- Menu — inline row on desktop, drawer on mobile --------------------- */
.nav__menu {
  display: flex;
  align-items: center;
  gap: clamp(1.5rem, 3vw, 2.75rem);
}

.nav__links {
  display: flex;
  align-items: center;
  gap: clamp(1.25rem, 2.5vw, 2.5rem);
}

.nav__link {
  position: relative;
  font-size: var(--fs-small);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-muted);
  transition: color var(--transition);
  padding-block: 0.25rem;
}

.nav__link::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%;
  height: 1px;
  background-color: var(--color-sage);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition);
}

.nav__link:hover { color: var(--text-primary); }
.nav__link:hover::after { transform: scaleX(1); }

/* --- Cart --------------------------------------------------------------- */
.nav__cart {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
  padding: 0.7rem 1.35rem;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-pill);
  font-size: var(--fs-small);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  transition: border-color var(--transition), background-color var(--transition);
}
.nav__cart:hover {
  border-color: var(--color-sage);
  background-color: rgba(237, 230, 218, 0.06);
}

/* Solid-path icon — fill only, no stroke */
.nav__cart-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  fill: currentColor;
  stroke: none;
}

.nav__cart-count {
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding-inline: 6px;
  border-radius: var(--radius-pill);
  background-color: var(--accent);
  font-size: 0.7rem;
  line-height: 1;
}

/* --- Hamburger — mobile only (shown at the breakpoint below) ------------ */
.nav__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.nav__toggle span {
  display: block;
  width: 22px;
  height: 1px;
  background-color: var(--text-primary);
  transition: transform var(--transition), opacity var(--transition);
}

.nav__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* --- Mobile nav --------------------------------------------------------- */
@media (max-width: 900px) {
  :root { --logo-height: 62px; }

  .nav__toggle { display: flex; }

  /* The inline row becomes a drop-down drawer */
  .nav__menu {
    position: fixed;
    top: var(--nav-height);
    right: 0;
    left: 0;
    max-height: calc(100svh - var(--nav-height));
    overflow-y: auto;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: var(--space-lg) var(--gutter) var(--space-xl);
    background-color: rgba(11, 12, 10, 0.97);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--border-hairline);
    transform: translateY(-10px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity var(--transition), transform var(--transition),
                visibility var(--transition);
  }

  .nav__menu.is-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .nav__links {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-md);
  }

  .nav__link { font-size: 1.05rem; }

  .nav__cart {
    margin-top: var(--space-lg);
    padding: 1rem 1.35rem;
  }

  .nav__cart-label { margin-right: auto; }
}

/* --------------------------------------------------------------------------
   7. FOOTER  (shared — used on the home + checkout pages)
   -------------------------------------------------------------------------- */
.footer {
  padding-block: var(--space-2xl) var(--space-lg);
  background-color: var(--color-black);
  border-top: 1px solid var(--border-hairline);
}

.footer__top {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: var(--space-xl) var(--space-lg);
  padding-bottom: var(--space-xl);
  border-bottom: 1px solid var(--border-hairline);
}

.footer__brand { max-width: 26rem; }

.footer__brand .nav__logo { margin-bottom: var(--space-md); }

/* The footer has vertical room, so the lockup runs larger than in the nav. */
.footer__brand .nav__logo-img { height: 148px; }

.footer__tagline {
  color: var(--text-muted);
  font-size: var(--fs-small);
  line-height: 1.7;
}

/* --- Newsletter (in the footer brand column) ---------------------------- */
.footer__news {
  margin-top: var(--space-lg);
  max-width: 22rem;
}

.footer__news-label {
  display: block;
  font-size: var(--fs-eyebrow);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--color-tan);
  margin-bottom: 0.6rem;
}

.footer__news-field {
  display: flex;
  align-items: center;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-pill);
  padding: 0.3rem 0.3rem 0.3rem 1.1rem;
  transition: border-color var(--transition);
}
.footer__news-field:focus-within { border-color: var(--color-sage); }

.footer__news-input {
  flex: 1;
  min-width: 0;
  padding: 0.55rem 0;
  color: var(--text-primary);
  font-size: var(--fs-small);
}
.footer__news-input::placeholder { color: var(--text-subtle); }
.footer__news-input:focus { outline: none; }

.footer__news-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 50%;
  background-color: var(--color-sage);
  color: var(--color-black);
  transition: background-color var(--transition);
}
.footer__news-btn:hover { background-color: var(--color-tan); }
.footer__news-btn svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.footer__news-note {
  margin-top: 0.7rem;
  font-size: 0.75rem;
  color: var(--text-subtle);
}
.footer__news-note.is-success { color: var(--color-sage); }

.footer__col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.85rem;
}

.footer__heading {
  font-family: var(--font-body);
  font-size: var(--fs-eyebrow);
  font-weight: 400;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--color-tan);
  margin-bottom: 0.35rem;
}

.footer__link {
  font-size: var(--fs-small);
  color: var(--text-muted);
  transition: color var(--transition);
}
.footer__link:hover { color: var(--text-primary); }

.footer__social {
  display: flex;
  gap: 0.75rem;
}

.footer__icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border-hairline);
  border-radius: 50%;
  color: var(--text-muted);
  transition: color var(--transition), border-color var(--transition);
}
.footer__icon:hover {
  color: var(--color-linen);
  border-color: var(--color-sage);
}
.footer__icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm) var(--space-md);
  flex-wrap: wrap;
  padding-top: var(--space-md);
}

.footer__copy {
  font-size: var(--fs-small);
  color: var(--text-subtle);
}

.footer__legal {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
}

@media (max-width: 860px) {
  .footer__top {
    grid-template-columns: 1fr 1fr;
  }
  .footer__brand { grid-column: 1 / -1; }
}

@media (max-width: 540px) {
  .footer__top {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }
  .footer__bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}
