/* styles.css
   ---------------------------------------------------------------------------
   PHASE 1 baseline. Just enough to make the wireframe legible. Phase 2 is where
   we make it yours. Everything you'll want to tweak is grouped in :root below,
   so you can change the whole look from one place before we go deeper.
   --------------------------------------------------------------------------- */

/* ---------------------------------------------------------------------------
   Fonts
   ---------------------------------------------------------------------------
   Alte Haas Grotesk (used for the entrance wordmark). Drop the font file at
   assets/fonts/AlteHaasGrotesk-Bold.ttf and it will be picked up automatically.
   Until then, the wordmark falls back to a heavy grotesk so layout still works.
   If your file is .otf/.woff2, change the url()/format() below to match. */
@font-face {
  font-family: "Alte Haas Grotesk";
  src: url("assets/fonts/AlteHaasGrotesk-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Alte Haas Grotesk";
  src: url("assets/fonts/AlteHaasGrotesk-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* ---- Design tokens: change these first ---- */
  --color-bg: #ffffff;
  --color-text: #1a1a1a;
  --color-muted: #6b7280;
  --color-primary: #111111;
  --color-primary-text: #ffffff;
  --color-border: #e5e7eb;
  --color-error: #b91c1c;

  /* Brand brown from the entrance design */
  --color-brown: #2f1d13;

  /* Heavy display stack; "Alte Haas Grotesk" wins once the file is present. */
  --font-display: "Alte Haas Grotesk", "Arial Black", "Helvetica Neue", system-ui,
    sans-serif;

  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 8px;
  --gap: 1rem;
  --max-width: 900px;
}

* {
  box-sizing: border-box;
}

/* The `hidden` HTML attribute must always win. Author rules that set `display`
   (e.g. the cart's flex layouts) would otherwise override it and leak elements
   we've told JS to hide. */
[hidden] {
  display: none !important;
}

body {
  margin: 0;
  padding: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  line-height: 1.5;
}

/* ---------------------------------------------------------------------------
   Site chrome: logo (top-left) + nav (top-right), injected by layout.js.
   ---------------------------------------------------------------------------
   Overlaid at the top so it doesn't disturb page layout. The container ignores
   pointer events; only the logo and links are interactive. */
.chrome {
  position: relative;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 24px 32px;
}

.chrome__logo {
  display: block;
  line-height: 0;
  flex: 0 0 auto;
}

.chrome__logo img {
  width: clamp(52px, 6vw, 68px);
  height: auto;
  display: block;
}

.chrome__nav {
  display: flex;
  align-items: center;
  gap: clamp(0.9rem, 2vw, 1.4rem);
  flex-wrap: wrap;
  justify-content: flex-end;
}

.chrome__link {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  line-height: 1;
  /* All nav items lowercase so they read at a uniform size (on-brand). */
  text-transform: lowercase;
  color: var(--color-brown);
  text-decoration: none;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.15s ease;
}

.chrome__link:hover,
.chrome__link[aria-current="page"] {
  opacity: 1;
}

/* The cart reads at full strength (like the design) and matches the link size. */
.chrome__cart {
  opacity: 1;
  font-size: 1.25rem;
  line-height: 1;
}

.chrome__cart-count:not(:empty)::before {
  content: " (";
}
.chrome__cart-count:not(:empty)::after {
  content: ")";
}

/* Instagram link, bottom-right of every page (injected by layout.js). */
.ig-link {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 25;
  color: rgba(47, 29, 19, 0.5);
  line-height: 0;
  transition: color 0.15s ease;
}

.ig-link:hover {
  color: var(--color-brown);
}

.ig-link svg {
  width: 24px;
  height: 24px;
  display: block;
}

/* Hide it on the shop page — it would overlap the product content there. */
body.shop .ig-link {
  display: none;
}

/* Very small mute toggle, centered in the nav bar (injected by layout.js). */
.mute-toggle {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 4px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--color-brown);
  opacity: 0.25;
  line-height: 0;
  transition: opacity 0.15s ease;
  z-index: 31;
}

.mute-toggle:hover {
  opacity: 0.6;
}

.mute-toggle svg {
  width: 16px;
  height: 16px;
  display: block;
}

/* Hide the mute toggle on mobile (nav is too cramped to center it there). */
@media (max-width: 700px) {
  .mute-toggle {
    display: none;
  }
}

/* ---------------------------------------------------------------------------
   Preloader
   --------------------------------------------------------------------------- */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg);
  opacity: 1;
  transition: opacity 0.4s ease;
}

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

/* On repeat visits (flag set by the head script) never show the intro. */
.intro-seen #preloader {
  display: none !important;
}

/* A spinning pink button (used by the preloader and the image loader). */
.preloader__spinner {
  width: 52px;
  height: 52px;
  color: #dd999b;
  animation: preloader-spin 0.9s linear infinite;
}

.preloader__spinner svg,
.preloader__spinner {
  display: block;
}

@keyframes preloader-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------------------------------------------------------------------------
   Simple content pages (About, Contact, 404)
   --------------------------------------------------------------------------- */
.page {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 24px 64px;
  /* Brand font for the info/contact/policies pages. */
  font-family: var(--font-display);
  color: var(--color-brown);
}

.page--center {
  text-align: center;
}

.page__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2rem;
  color: var(--color-brown);
  margin: 0 0 1rem;
}

.page__lead {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.25rem;
  line-height: 1.5;
  color: var(--color-brown);
  margin-bottom: 1.25rem;
}

.page h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--color-brown);
  margin: 1.75rem 0 0.4rem;
}

.page p {
  font-weight: 400;
  color: var(--color-brown);
}

.page a {
  color: var(--color-brown);
}

/* Footer on content pages (injected by layout.js). */
.page-footer {
  max-width: 640px;
  margin: 3rem auto 0;
  padding: 1.5rem 24px 2rem;
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-family: var(--font-display);
  font-size: 0.9rem;
  color: rgba(47, 29, 19, 0.5);
}

.page-footer__link {
  color: rgba(47, 29, 19, 0.5);
  text-decoration: none;
}

.page-footer__link:hover {
  color: var(--color-brown);
}

.page-footer__copy {
  margin: 0;
}

/* Contact form */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.5rem;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-field__label {
  font-size: 0.85rem;
  font-weight: 600;
}

.form-field__input {
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
}

.contact-form .btn {
  align-self: flex-start;
}

.form-status {
  min-height: 1.25rem;
  font-size: 0.9rem;
  color: var(--color-muted);
}

.contact-direct {
  margin-top: 1.5rem;
}

/* Two-column layout on wide screens; stacks on narrow ones. */
.product {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

@media (max-width: 640px) {
  .product {
    grid-template-columns: 1fr;
  }
}

.product__image {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  background: #f3f4f6;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

/* Thumbnail strip under the main image. */
.product__thumbs {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.product__thumb {
  padding: 0;
  width: 64px;
  height: 64px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  background: #fff;
}

.product__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.product__thumb[data-active="true"] {
  border-color: var(--color-primary);
}

.product__title {
  margin: 0 0 0.5rem;
  font-size: 1.75rem;
}

.product__price {
  margin: 0 0 1rem;
  font-size: 1.25rem;
  font-weight: 600;
}

.product__description {
  color: var(--color-muted);
  margin-bottom: 1.5rem;
}

.product__label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.product__select,
.product__qty-input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 1rem;
  background: #fff;
}

.product__options,
.product__quantity {
  margin-bottom: 1rem;
  max-width: 220px;
}

.product__actions {
  display: flex;
  gap: var(--gap);
  margin: 1.5rem 0 0.75rem;
  flex-wrap: wrap;
}

.btn {
  padding: 0.75rem 1.25rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 1rem;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn--primary {
  background: var(--color-primary);
  color: var(--color-primary-text);
}

.btn--secondary {
  background: #fff;
  color: var(--color-text);
  border-color: var(--color-border);
}

.btn:not(:disabled):hover {
  opacity: 0.85;
}

/* Status line: neutral by default, red when data-state="error". */
.product__status {
  min-height: 1.5rem;
  font-size: 0.95rem;
  color: var(--color-muted);
}

.product__status[data-state="error"] {
  color: var(--color-error);
  font-weight: 600;
}

/* ---------------------------------------------------------------------------
   Cart sheet
   --------------------------------------------------------------------------- */

/* Dimmed backdrop behind the sheet. */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 40;
}

/* The panel itself: fixed to the right edge, slid off-screen by default. */
.cart-sheet {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: 400px;
  max-width: 90vw;
  background: #fff;
  z-index: 50;
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.12);
  transform: translateX(100%);
  transition: transform 0.25s ease;
}

.cart-sheet[data-open="true"] {
  transform: translateX(0);
}

/* Dim the sheet slightly and block clicks while a request is in flight. */
.cart-sheet[data-busy="true"] {
  opacity: 0.6;
  pointer-events: none;
}

.cart-sheet__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem;
  border-bottom: 1px solid var(--color-border);
}

.cart-sheet__title {
  margin: 0;
  font-size: 1.1rem;
}

.cart-sheet__close {
  border: none;
  background: none;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  color: var(--color-muted);
}

/* Scrollable line list fills the space between header and footer. */
.cart-sheet__lines {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 1.25rem;
}

.cart-sheet__empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-muted);
  margin: 0;
}

.cart-line {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 0.75rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--color-border);
}

.cart-line__image {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: var(--radius);
  background: #f3f4f6;
}

.cart-line__info {
  min-width: 0;
}

.cart-line__name {
  margin: 0;
  font-weight: 600;
  font-size: 0.95rem;
}

.cart-line__variant {
  margin: 0.1rem 0;
  color: var(--color-muted);
  font-size: 0.85rem;
}

.cart-line__price {
  margin: 0.1rem 0 0.5rem;
  font-size: 0.85rem;
}

/* Quantity stepper: −  [n]  + */
.cart-line__qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.qty-btn {
  width: 30px;
  height: 30px;
  border: none;
  background: #fff;
  cursor: pointer;
  font-size: 1rem;
}

.qty-btn:hover {
  background: #f3f4f6;
}

.qty-input {
  width: 40px;
  height: 30px;
  border: none;
  border-left: 1px solid var(--color-border);
  border-right: 1px solid var(--color-border);
  text-align: center;
  font-size: 0.9rem;
  /* Hide the native number spinners for a cleaner look. */
  -moz-appearance: textfield;
}

.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.cart-line__right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
}

.cart-line__total {
  margin: 0;
  font-weight: 600;
  font-size: 0.95rem;
}

.cart-line__remove {
  border: none;
  background: none;
  color: var(--color-muted);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

.cart-line__remove:hover {
  color: var(--color-error);
}

.cart-sheet__footer {
  padding: 1.25rem;
  border-top: 1px solid var(--color-border);
}

.cart-sheet__subtotal {
  display: flex;
  justify-content: space-between;
  font-weight: 600;
  margin-bottom: 1rem;
}

.cart-sheet__checkout {
  width: 100%;
}

/* ---------------------------------------------------------------------------
   Entrance / splash page (index.html)
   --------------------------------------------------------------------------- */

/* Full-viewport, no scroll. Scoped to the entrance <body> so it doesn't affect
   the rest of the site. */
body.entrance {
  padding: 0;
  height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  background: var(--color-bg);
  position: relative;
  display: flex;
  flex-direction: column;
}

/* On the entrance, overlay the chrome so the wordmark centers in the FULL
   viewport (not the space left below an in-flow bar). */
body.entrance .chrome {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
}

.svg-defs {
  position: absolute;
}

/* Splash buttons that burst from the cursor on hover (created in entrance.js).
   Positioned at the cursor; entrance.js animates the transform. */
.splash-btn {
  position: fixed;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 5;
}

/* Center the clickable wordmark in the space left below the chrome bar. */
.entrance__center {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.entrance__cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  text-decoration: none;
  cursor: pointer;
}

/* "drop 1" pill */
.entrance__badge {
  background: var(--color-brown);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1rem, 2.2vw, 2rem);
  line-height: 1;
  padding: 0.4rem 1rem;
  border-radius: 999px;
  /* Sit just above the wordmark, overlapping its ascenders a touch. */
  margin-bottom: -0.35em;
  z-index: 1;
}

/* The "button clips" wordmark. The button vector stands in for the "o". */
.wordmark {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(3rem, 12vw, 9rem);
  line-height: 1;
  color: var(--color-brown);
  white-space: nowrap;
  transform: scale(1);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Only the "button clips" wordmark scales up on hover (not the badge/note). */
.entrance__cta:hover .wordmark,
.entrance__cta:focus-visible .wordmark {
  transform: scale(1.05);
}

.wordmark__text {
  letter-spacing: -0.01em;
}

/* The button standing in for the "o": sized to the letters, snugged into the
   word, and nudged to sit like a lowercase glyph. */
.wordmark__o {
  width: 0.62em;
  height: 0.62em;
  margin: 0 -0.02em;
  color: #dd999b;
  transform: translateY(0.06em) rotate(0deg);
  transition: transform 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
  will-change: transform;
}

/* Spring the button up and give it a random little tilt (--o-rot, set per
   hover in entrance.js) when the wordmark is hovered/focused. */
.entrance__cta:hover .wordmark__o,
.entrance__cta:focus-visible .wordmark__o {
  transform: translateY(-0.1em) rotate(var(--o-rot, 0deg));
}

/* "click to enter!" */
.entrance__note {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(0.8rem, 1.4vw, 1.125rem);
  color: rgba(47, 29, 19, 0.25);
  margin-top: -0.1em;
}

/* ---------------------------------------------------------------------------
   Product page (PDP)
   ---------------------------------------------------------------------------
   Full-viewport composition: gallery (image + thumbs) pinned top-right, the
   info/selection block anchored bottom-left with 32px padding. */
/* Chrome bar sits in flow at the top; the product fills the rest of the
   viewport. Gallery pins top-right, info anchors bottom-left. */
body.shop {
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.pdp {
  position: relative;
  flex: 1;
  min-height: 0;
  margin: 0;
  padding: 0;
}

/* Top-right: gallery. Same 16px gap between the main image and the thumbs as
   between the thumbs themselves. */
.pdp__gallery {
  position: absolute;
  top: 0;
  right: 32px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.pdp__stage {
  position: relative;
  background: #f3f4f6;
  border-radius: 4px;
  /* Relative size (~60% of a wide screen), but also capped by the available
     viewport HEIGHT so the square image never gets clipped on short screens. */
  width: min(54vw, 880px, calc(100dvh - 150px));
}

/* Spinner shown over the main image while it loads (same spin as the
   preloader). Toggled by data-loading on the stage. */
.pdp__image-spinner {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 46px;
  height: 46px;
  color: #dd999b;
  animation: preloader-spin 0.9s linear infinite;
  will-change: transform;
  display: none;
}

.pdp__stage[data-loading="true"] .pdp__image-spinner {
  display: block;
}

.pdp__image {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  /* Anchored near the top so mostly the bottom clips (nudged up a touch). */
  object-position: center 8%;
  background: #f3f4f6;
  display: block;
  border-radius: 4px;
  cursor: zoom-in;
  transition: transform 0.2s ease, opacity 0.25s ease;
}

.pdp__image:hover {
  transform: scale(1.02);
}


.pdp__thumbs {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: min(54vw, 880px, calc(100dvh - 150px));
  overflow-y: auto;
  padding-right: 2px;
}

.pdp__thumb {
  flex: 0 0 auto;
  width: 84px;
  height: 84px;
  padding: 0;
  border: none;
  border-radius: 2px;
  background: #f3f4f6;
  cursor: pointer;
  overflow: hidden;
  opacity: 0.5;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.pdp__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pdp__thumb:hover {
  opacity: 1;
  transform: scale(1.05);
}

/* Active (currently-shown) thumb: just full opacity, no outline. */
.pdp__thumb[data-active="true"] {
  opacity: 1;
}

/* Bottom-left: details */
.pdp__details {
  position: absolute;
  left: 32px;
  bottom: 32px;
  width: 380px;
  max-width: calc(100vw - 64px);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.pdp__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2rem;
  letter-spacing: -0.02em;
  color: var(--color-brown);
  margin: 0;
}

.pdp__desc {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  color: var(--color-brown);
  opacity: 0.5;
  /* Tighten the gap to the title by ~4px. */
  margin: -4px 0 0;
}

.pdp__options {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding-top: 8px;
}

.pdp__option {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pdp__option-label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  /* 50% via colour (not opacity) so the value span can be fully opaque. */
  color: rgba(47, 29, 19, 0.5);
}

/* The selected color name, inline with "color:" — same size, full opacity. */
.pdp__option-value {
  color: var(--color-brown);
}

/* Color swatches */
.pdp__swatches {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.pdp__swatch {
  --ring: currentColor;
  position: relative;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  color: #cccccc; /* set inline per swatch */
  border-radius: 50%;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  display: grid;
  place-items: center;
}

/* Near-white swatches (powder): fill the holes with the stroke color so the
   button reads on the white page. The circle sits behind the button; the
   button's white body covers it except at the holes. */
.pdp__swatch[data-edge="true"]::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--ring);
  z-index: 0;
}

.pdp__swatch svg {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
}

/* Near-white swatches get a base stroke so they read against the page. */
.pdp__swatch[data-edge="true"] {
  box-shadow: 0 0 0 2px var(--ring);
}

/* Selected swatch: thicker ring with a bigger gap. */
.pdp__swatch[data-selected="true"] {
  transform: scale(1.1);
  box-shadow: 0 0 0 3px var(--color-bg), 0 0 0 6px var(--ring);
}

/* Size toggle */
.pdp__sizes {
  display: flex;
  align-items: center;
  gap: 16px;
}

.pdp__size {
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--color-brown);
  opacity: 0.25;
  transition: opacity 0.15s ease;
}

.pdp__size:hover {
  opacity: 0.6;
}

.pdp__size[data-selected="true"] {
  opacity: 1;
}

/* Add-to-cart bar + quantity stepper (colors set from the picked swatch) */
.pdp__buy {
  display: flex;
  align-items: stretch;
  width: 100%;
  margin-top: 4px;
}

.pdp__add {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: 44px;
  padding: 0 12px;
  cursor: pointer;
  background: var(--add-bg, #bee3f8);
  color: var(--add-fg, #6fb8e1);
  border: 2px solid var(--add-border, transparent);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  white-space: nowrap;
  overflow: hidden;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.pdp__step {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border: none;
  cursor: pointer;
  background: var(--step-bg, rgba(190, 227, 248, 0.3));
  color: var(--add-fg, #6fb8e1);
  display: grid;
  place-items: center;
  transition: background 0.15s ease, color 0.15s ease;
}

.pdp__step-icon {
  width: 18px;
  height: 18px;
  display: block;
}

.pdp__add:disabled,
.pdp__step:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pdp__status {
  min-height: 1.1rem;
  font-size: 0.85rem;
  color: var(--color-muted);
  margin: 0;
}

.pdp__status[data-state="error"] {
  color: var(--color-error);
  font-weight: 600;
}

/* ---------------------------------------------------------------------------
   Skeleton loading (product details) — sky-blue shimmer
   --------------------------------------------------------------------------- */
.pdp-skeleton {
  display: none;
  flex-direction: column;
  gap: 20px;
}

.pdp[data-state="loading"] .pdp-skeleton {
  display: flex;
}

.pdp[data-state="loading"] .pdp__title,
.pdp[data-state="loading"] .pdp__desc,
.pdp[data-state="loading"] .pdp__options,
.pdp[data-state="loading"] .pdp__status,
.pdp[data-state="loading"] .pdp__buy {
  display: none;
}

.skeleton {
  border-radius: 6px;
  background: linear-gradient(90deg, #dceffb 25%, #bee3f8 50%, #dceffb 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.3s ease-in-out infinite;
}

@keyframes skeleton-shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.skeleton--title {
  height: 30px;
  width: 65%;
}

.skeleton-lines {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.skeleton--line {
  height: 13px;
  width: 100%;
}

.skeleton--line-short {
  width: 45%;
}

.skeleton--label {
  height: 13px;
  width: 56px;
}

.skeleton--swatches {
  height: 40px;
  width: 100%;
}

.skeleton--size {
  height: 26px;
  width: 150px;
}

.skeleton--button {
  height: 44px;
  width: 100%;
  border-radius: 0;
}

/* Stack + scroll on narrow screens */
@media (max-width: 900px) {
  body.shop {
    display: block;
    /* Keep the horizontal thumbnail scroll from moving the whole page. */
    overflow-x: hidden;
  }
  .pdp {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 8px 24px 40px;
    min-height: 0;
  }
  /* Gallery stacks: one big main image on top, thumbnails in a row below. */
  .pdp__gallery {
    position: static;
    top: auto;
    right: auto;
    flex-direction: column;
    width: 100%;
    min-width: 0;
  }
  .pdp__stage {
    width: 100%;
  }
  /* Thumbnails scroll horizontally WITHIN their own row (min-width:0 lets the
     flex item shrink so its overflow scrolls instead of widening the page). */
  .pdp__thumbs {
    flex-direction: row;
    min-width: 0;
    max-width: 100%;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
  }
  /* Smaller add-to-cart text on mobile. */
  .pdp__add {
    font-size: 1.125rem;
  }
  .pdp__details {
    position: static;
    left: auto;
    bottom: auto;
    width: 100%;
  }
  /* On mobile, lift color/size above the title so you can switch options right
     under the image (Add-to-Cart still sits at the bottom). */
  .pdp__options {
    order: -1;
  }
  /* Swatches stretch to fill the full-width block. */
  .pdp__swatches {
    justify-content: flex-start;
    gap: 16px;
  }
  .pdp__swatch {
    flex: 1 1 0;
    width: auto;
    height: auto;
    aspect-ratio: 1 / 1;
    max-width: 72px;
  }
}

/* ---------------------------------------------------------------------------
   Lightbox (click the main product image)
   --------------------------------------------------------------------------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5vh 5vw;
  background: rgba(190, 227, 248, 0.94); /* sky */
  cursor: zoom-out;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.lightbox--open {
  opacity: 1;
}

.lightbox__img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.18);
}
