/* Shared by every page: design tokens, the floating navigation bar and its
   phone menu. Page-specific styles live in each page's own <style>. */
:root {
  --pill-radius: 100px;
  --card-radius: 24px;
  --ease-out: cubic-bezier(.2, .8, .2, 1);
}

/* ---------- Navigation (after Figma 304:319) ----------
   A white bar across the top of the page, 56px tall, with a soft shadow
   under it. (Phones keep the floating rounded bar: see the end.) */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; /* brand dead centre */
  padding: 16px 40px; background: #fff; box-shadow: 0 3px 30px 6px rgba(227, 226, 222, .4);
  color: #000; line-height: 1;
}
.nav a, .nav button { color: inherit; text-decoration: none; background: none; padding: 0; line-height: 1; }
/* Desktop: Optical | common optics | Wishlist · Cart.
   Phones (≤900px, below): ☰ | SF | Cart, with the other links in the menu. */
.nav__group { display: flex; align-items: center; font-size: 14px; font-weight: 300; white-space: nowrap; }
.nav__group--left { grid-column: 1; grid-row: 1; gap: 12px; }
.nav__group--right { grid-column: 3; justify-self: end; gap: 16px; }
.nav__brand { grid-column: 2; font-size: 24px; font-weight: 500; }
.nav__brand-short { display: none; letter-spacing: .02em; }
/* Hover lines draw in from the left (nav links, the OPTICAL panel, the bag,
   the promo links): a 1px line under the text, grown by background-size. */
.nav .nav__group a, .nav .nav__cart, .mega a, .bag .bag__name, .promo__links a {
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  padding-bottom: 3px; margin-bottom: -3px; /* room under the text for the line; layout unchanged */
  transition: background-size .35s cubic-bezier(.2, .8, .2, 1);
}
.nav .nav__group a:hover, .nav .nav__cart:hover, .mega a:hover, .bag .bag__name:hover, .promo__links a:hover,
.nav .nav__group a:focus-visible, .mega a:focus-visible,
.nav .nav__group--left a[aria-expanded="true"] { background-size: 100% 1px; }
/* Hamburger (phones only): three lines that fold into a cross while open. */
.nav__menu-btn {
  grid-column: 1; grid-row: 1; justify-self: start;
  position: relative; width: 24px; height: 18px; margin: -4px 0 -4px -2px;
  display: none; place-items: center;
}
.nav__menu-btn span {
  position: absolute; left: 2px; right: 2px; height: 1.5px; border-radius: 1px; background: currentColor;
  transition: transform .3s var(--ease-out), opacity .2s ease;
}
.nav__menu-btn span:nth-child(1) { transform: translateY(-5px); }
.nav__menu-btn span:nth-child(3) { transform: translateY(5px); }
.nav__menu-btn[aria-expanded="true"] span:nth-child(1) { transform: rotate(45deg); }
.nav__menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__menu-btn[aria-expanded="true"] span:nth-child(3) { transform: rotate(-45deg); }
/* The menu: a small white card that drops in under the bar's left end. */
.nav__menu {
  display: none; position: absolute; top: calc(100% + 8px); left: 0; min-width: 200px;
  flex-direction: column; padding: 8px; /* shown (as flex) on phones only */
  background: #fff; border-radius: var(--card-radius); box-shadow: 0 3px 30px -10px #c9c8c3;
  opacity: 0; transform: translateY(-6px); visibility: hidden;
  transition: opacity .2s ease, transform .25s var(--ease-out), visibility 0s .25s;
}
.nav__menu.is-open { opacity: 1; transform: none; visibility: visible; transition: opacity .2s ease, transform .25s var(--ease-out); }
.nav__menu a {
  padding: 12px 16px; border-radius: 16px;
  font-size: 14px; font-weight: 300; letter-spacing: .02em; white-space: nowrap;
}
.nav__menu a:hover { background: #f2f2f2; }
@media (prefers-reduced-motion: reduce) {
  .nav__menu, .nav__menu.is-open, .nav__menu-btn span { transition: none; }
}
.nav__cart.is-bumped { animation: bump .35s ease; }
@keyframes bump { 40% { transform: scale(1.12); } }

.nav :focus-visible { outline: 2px solid #000; outline-offset: 2px; }

/* OPTICAL panel (Figma 323:1572 / 323:1694), desktop only: clicking OPTICAL
   opens a white panel under the nav with Women and Men links on the left and
   a photo on the right that follows the section you're over. Built by nav.js. */
.mega {
  position: fixed; left: 0; right: 0; top: var(--nav-bottom, 56px); z-index: 9;
  display: flex; gap: 40px; align-items: flex-start;
  padding: 24px 40px; background: #fff; color: #000;
  box-shadow: 0 20px 30px -10px rgba(227, 226, 222, .6);
  opacity: 0; transform: translateY(-8px); visibility: hidden; pointer-events: none;
  transition: opacity .25s ease, transform .3s var(--ease-out), visibility 0s .3s;
}
.mega.is-open {
  opacity: 1; transform: none; visibility: visible; pointer-events: auto;
  transition: opacity .25s ease, transform .3s var(--ease-out);
}
html.mega-open .nav { box-shadow: none; }
.mega__links { flex: 0 0 min(546px, 40%); display: flex; flex-direction: column; gap: 40px; }
.mega__section { display: flex; flex-direction: column; gap: 24px; }
.mega__head {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding-bottom: 8px; border-bottom: 1px solid #d9d9d9; line-height: 1;
}
.mega__title { margin: 0; font-size: 18px; font-weight: 300; }
.mega__all { font-size: 16px; font-weight: 500; }
.mega__list { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; list-style: none; font-size: 14px; font-weight: 300; line-height: 1; }
.mega a { color: inherit; text-decoration: none; }
.mega a:focus-visible { outline: 2px solid #000; outline-offset: 2px; }
.mega__photo { position: relative; flex: 1; min-width: 0; aspect-ratio: 1440 / 800; overflow: hidden; background: #f6f5f5; }
.mega__photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .4s ease; }
.mega__photo img.is-shown { opacity: 1; }
@media (max-width: 900px) { .mega { display: none; } }
@media (prefers-reduced-motion: reduce) { .mega, .mega.is-open, .mega__photo img, .nav .nav__group a, .nav .nav__cart, .mega a, .bag .bag__name, .promo__links a { transition: none; } }

/* Phones and tablets: ☰ | SF | Cart, the other links move into the menu. */
@media (max-width: 900px) {
  .nav {
    top: 16px; left: 16px; right: 16px; padding: 16px;
    border-radius: var(--pill-radius); box-shadow: 0 3px 30px -10px #e3e2de;
  }
  .nav__brand { font-size: 18px; }
  .nav__menu-btn { display: grid; }
  .nav__menu { display: flex; }
  .nav__group--left, .nav__desk, .nav__brand-full { display: none; }
  .nav__brand-short { display: inline; }
}

/* ---------- Shopping bag (Figma 310:843) ----------
   (and 310:898) A 502px white panel from the right, over the page dimmed
   like the Customise drawer: the bag's contents at the top; the
   experimental-site note, totals and two pill buttons at the bottom. */
.bag-scrim {
  position: fixed; inset: 0; z-index: 30; background: rgba(0, 0, 0, .3);
  opacity: 0; transition: opacity .45s ease;
}
.bag-scrim[hidden] { display: block; pointer-events: none; }
body.bag-open .bag-scrim { opacity: 1; }
body.bag-open { overflow: hidden; }
.bag {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 31; width: min(502px, 100vw);
  display: flex; flex-direction: column; justify-content: space-between; gap: 24px;
  padding: 24px 16px; background: #fff; color: #000;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-weight: 300; line-height: 1;
  transform: translateX(100%); transition: transform .6s var(--ease-out);
}
body.bag-open .bag { transform: none; }
.bag, .bag * { box-sizing: border-box; }
.bag p, .bag h2, .bag ul, .bag dl, .bag dd { margin: 0; padding: 0; }
.bag a { color: inherit; text-decoration: none; }
.bag button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; }
.bag :focus-visible { outline: 2px solid #000; outline-offset: 2px; }
.bag img { display: block; }
.bag__top { display: flex; flex-direction: column; gap: 24px; min-height: 0; overflow-y: auto; margin: -4px; padding: 4px; }
/* Title, close and a hairline 8px under them. */
.bag__head {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding-bottom: 8px; border-bottom: 1px solid #d9d9d9;
}
.bag__title { font-size: 16px; font-weight: 300; }
.bag__close, .bag__icon { width: 24px; height: 24px; flex: none; }
.bag__items { list-style: none; display: flex; flex-direction: column; gap: 24px; }
.bag__item { display: flex; gap: 24px; }
.bag__img { flex: none; width: 160px; height: 160px; background: #f6f5f5; overflow: hidden; }
.bag__img img { width: 100%; height: 100%; object-fit: cover; mix-blend-mode: multiply; transform: scale(1.15); } /* the frame ~85% across, as in the design */
.bag__info { flex: 1; min-width: 0; height: 160px; display: flex; flex-direction: column; justify-content: space-between; }
.bag__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 18px; }
.bag .bag__options { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: #696969; }
.bag__qty { display: flex; align-items: center; gap: 8px; font-size: 16px; }
.bag__qty span { min-width: 9px; text-align: center; }
.bag__icon:disabled { opacity: .3; cursor: default; }
.bag__icon:not(:disabled):hover { opacity: .6; }
.bag__empty { display: none; font-size: 16px; color: #696969; }
.bag.is-empty .bag__empty { display: block; }
.bag__note { font-size: 12px; font-weight: 400; color: #919191; text-align: center; }
.bag__note.is-flagged { animation: bag-flag 1.2s ease; }
.bag__legal { display: inline-block; margin-top: 6px; color: inherit; text-decoration: underline; text-underline-offset: 2px; }
@keyframes bag-flag { 15%, 60% { color: #000; } }
.bag__foot { display: flex; flex-direction: column; gap: 16px; }
/* The note sits above the totals; a hairline under the totals, before the buttons. */
.bag .bag__sums { display: flex; flex-direction: column; gap: 16px; padding-bottom: 16px; border-bottom: 1px solid #d9d9d9; font-size: 18px; }
.bag__sums div { display: flex; justify-content: space-between; }
.bag__buttons { display: flex; gap: 12px; }
.bag .bag__btn {
  flex: 1; height: 48px; padding: 8px 12px; border-radius: var(--pill-radius);
  font-size: 20px; font-weight: 400; line-height: 1.4;
  transition: background-color .2s ease, color .2s ease;
}
.bag .bag__btn--solid { background: #000; color: #fff; }
.bag .bag__btn--solid:hover { background: #333; }
@media (prefers-reduced-motion: reduce) {
  .bag, .bag-scrim { transition: none; }
  .bag__note.is-flagged { animation: none; }
}
/* Phones: the panel fills the screen; smaller photos and buttons. */
@media (max-width: 600px) {
  .bag__item { gap: 16px; }
  .bag__img { width: 120px; height: 120px; }
  .bag__info { height: 120px; }
  .bag__row, .bag .bag__sums { font-size: 16px; }
  .bag .bag__btn { font-size: 18px; }
}

/* Page transition: going to another page of the site, a panel sweeps up
   from the bottom and covers this page, then carries on up and away with
   the new page following right behind it. The panel is a band of colour
   drawn just above the incoming page (its shadow), so the two move as one.
   The browser keeps the old page on screen until the new one is ready.
   The nav stays put on top. Browsers without cross-page view transitions
   (Firefox for now) just change page. Change --curtain to recolour it. */
@view-transition { navigation: auto; types: page-swap; }
.nav { view-transition-name: site-nav; }
:root { --curtain: #ecebe8; }
html:active-view-transition-type(page-swap)::view-transition-old(root) { animation: none; }
html:active-view-transition-type(page-swap)::view-transition-new(root) {
  animation: page-sweep 1.25s both;
  box-shadow: 0 -100vh 0 0 var(--curtain);
}
html:active-view-transition-type(page-swap)::view-transition-group(site-nav) { animation: none; }
@keyframes page-sweep {
  0%   { transform: translateY(200%); animation-timing-function: cubic-bezier(.7, 0, .3, 1); }
  48%  { transform: translateY(100%); animation-timing-function: cubic-bezier(.6, 0, .25, 1); }
  100% { transform: none; }
}
/* Clicking a link: the panel sweeps up over this page first (nav.js), then
   the next page slides up behind it as it leaves. The nav stays on top. */
.page-panel {
  position: fixed; inset: 0; z-index: 40; pointer-events: none; visibility: hidden;
  background: var(--curtain); transform: translateY(100%);
}
html.is-leaving .page-panel {
  visibility: visible; pointer-events: auto; transform: none;
  transition: transform .65s cubic-bezier(.7, 0, .3, 1);
}
html.is-leaving .nav { z-index: 41; }
/* Same-page links (window.sfCover in nav.js): once covered, the panel
   carries on up and away to show the page changed underneath. */
html.is-leaving.is-lifting .page-panel { transform: translateY(-100%); transition: transform .8s cubic-bezier(.6, 0, .25, 1); }
html:active-view-transition-type(from-panel)::view-transition-new(root) {
  animation: page-follow .8s cubic-bezier(.6, 0, .25, 1) both;
}
@keyframes page-follow { from { transform: translateY(100%); } }
/* Browsers without cross-page view transitions: the panel lifts away. */
html.is-arriving body::after {
  content: ""; position: fixed; inset: 0; z-index: 40; pointer-events: none;
  background: var(--curtain); animation: panel-lift .8s cubic-bezier(.6, 0, .25, 1) both;
}
@keyframes panel-lift { to { transform: translateY(-100%); } }
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
}
@media (prefers-reduced-motion: reduce) {
  html.is-arriving body::after { display: none; }
}
