/* ==========================================================================
   mystore — storefront styles
   Luxury register: warm ivory paper, deep forest, champagne gold accents,
   square corners, generous whitespace. See PRD section 7.
   ========================================================================== */

:root {
  --paper: #f7f4ee;
  --card: #fffdf9;
  --ink: #191d1a;
  --deep: #173f31;
  --deep2: #0e2c22;
  --gold: #b3905e;
  --gold-soft: #efe6d6;
  --line: #e6e0d3;
  --muted: #7a776d;
  --danger: #a34632;

  --serif: "Cormorant Garamond", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --shell: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  --shadow: 0 18px 40px -28px rgba(23, 63, 49, 0.55);
}

*,
*::before,
*::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

/* The `hidden` attribute only sets `display: none` at UA-stylesheet priority, so
   any element that declares its own `display` (the hero grid, the login gate,
   the carousel dots) would keep showing. Make `hidden` mean hidden. */
[hidden] { display: none !important; }

a { color: inherit; }

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

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--deep);
  color: #fff;
  padding: 12px 18px;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
}
.skip-link:focus { left: 12px; top: 12px; }

/* --- Eyebrow / headings ------------------------------------------------- */

.eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 10px;
}

.section-head {
  text-align: center;
  margin-bottom: clamp(24px, 4vw, 40px);
}

.section-head h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.15;
  margin: 0;
  letter-spacing: 0.01em;
}

.rule {
  width: 46px;
  height: 1px;
  background: var(--gold);
  margin: 14px auto 0;
  border: 0;
}

/* --- Announcement bar --------------------------------------------------- */

.announce {
  background: var(--deep2);
  color: var(--gold-soft);
  text-align: center;
  padding: 9px var(--gutter);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* --- Header ------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(247, 244, 238, 0.92);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
}

.site-header .shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
}

.brand {
  font-family: var(--serif);
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  white-space: nowrap;
}
.brand span { color: var(--gold); }

.nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 3vw, 30px);
}

.nav a,
.nav button {
  appearance: none;
  background: none;
  border: 0;
  padding: 6px 0;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  border-bottom: 1px solid transparent;
}
.nav a:hover,
.nav button:hover,
.nav [aria-current="page"] { border-bottom-color: var(--gold); }

.search {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
  gap: 8px;
}
.search input {
  appearance: none;
  border: 0;
  background: transparent;
  font-family: var(--sans);
  font-size: 13px;
  padding: 8px 2px;
  width: clamp(110px, 18vw, 200px);
  color: var(--ink);
}
.search input:focus { outline: none; }
.search:focus-within { border-bottom-color: var(--gold); }
.search button {
  appearance: none;
  background: none;
  border: 0;
  cursor: pointer;
  color: var(--muted);
  padding: 6px;
  line-height: 0;
}

/* Below ~760px the brand, search field and links cannot share one row.
   The search moves to a line of its own rather than overflowing the viewport. */
@media (max-width: 760px) {
  .site-header .shell {
    flex-wrap: wrap;
    row-gap: 10px;
    min-height: 0;
    padding-block: 12px;
  }

  .brand { font-size: 20px; letter-spacing: 0.12em; }

  .nav {
    flex: 1 1 auto;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 18px;
  }

  .search {
    order: 3;
    flex: 1 1 100%;
  }
  .search input { width: 100%; flex: 1 1 auto; }
}

@media (max-width: 420px) {
  .brand { font-size: 17px; }
  .nav { gap: 14px; }
  .nav a { font-size: 11px; letter-spacing: 0.16em; }
}

/* --- Hero carousel ------------------------------------------------------ */

.hero {
  position: relative;
  min-height: clamp(340px, 52vw, 520px);
  display: grid;
  isolation: isolate;
  background: linear-gradient(160deg, var(--deep) 0%, var(--deep2) 100%);
  overflow: hidden;
}

/* The slides live inside .hero-track, so the track has to be the grid that
   stacks them — otherwise they flow one below the other instead of crossfading. */
.hero-track {
  grid-area: 1 / 1;
  display: grid;
}

.hero-slide {
  grid-area: 1 / 1;
  position: relative;
  display: grid;
  place-items: center;
  /* The CTA and dots are absolutely positioned at the bottom of the hero, so the
     slide reserves room for them — otherwise long headlines collide with the
     button on narrow screens. */
  padding: clamp(40px, 8vw, 96px) var(--gutter) clamp(152px, 22vw, 176px);
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1.1s ease;
  pointer-events: none;
}
.hero-slide.is-active { opacity: 1; pointer-events: auto; }

.hero-slide::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(14, 26, 20, 0.35), rgba(14, 26, 20, 0.55));
}

.hero-inner {
  position: relative;
  text-align: center;
  color: #fdfbf7;
  max-width: 680px;
}

.hero-rule {
  width: 54px;
  height: 1px;
  background: var(--gold);
  margin: 0 auto 22px;
  border: 0;
}

.hero h1 {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(34px, 6.4vw, 62px);
  line-height: 1.08;
  margin: 0 0 16px;
  text-wrap: balance;
}

.hero p {
  margin: 0 auto 30px;
  max-width: 46ch;
  font-size: clamp(14px, 1.6vw, 17px);
  color: rgba(253, 251, 247, 0.86);
  text-wrap: pretty;
}

.hero-cta {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: clamp(74px, 10vw, 96px);
  z-index: 3;
}

.hero-dots {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: clamp(24px, 4vw, 34px);
  z-index: 3;
  display: flex;
  gap: 10px;
}

.hero-dots button {
  appearance: none;
  width: 9px;
  height: 9px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(253, 251, 247, 0.75);
  background: transparent;
  cursor: pointer;
}
.hero-dots button[aria-current="true"] { background: var(--gold); border-color: var(--gold); }

/* --- Buttons ------------------------------------------------------------ */

.btn {
  display: inline-block;
  appearance: none;
  border: 1px solid var(--deep);
  background: var(--deep);
  color: #fdfbf7;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  padding: 15px 34px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}
.btn:hover { background: var(--deep2); border-color: var(--deep2); }

.btn-light {
  background: transparent;
  border-color: rgba(253, 251, 247, 0.7);
  color: #fdfbf7;
}
.btn-light:hover { background: rgba(253, 251, 247, 0.12); border-color: #fdfbf7; }

.btn-ghost {
  background: transparent;
  color: var(--deep);
}
.btn-ghost:hover { background: var(--deep); color: #fdfbf7; }

.btn[disabled] {
  cursor: not-allowed;
  opacity: 0.5;
  background: var(--muted);
  border-color: var(--muted);
}

.link-quiet {
  display: inline-block;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--deep);
  text-decoration: none;
  border-bottom: 1px solid var(--gold);
  padding-bottom: 3px;
}

.back-link {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}
.back-link:hover { color: var(--deep); }

/* --- Sections ----------------------------------------------------------- */

.section { padding: clamp(48px, 7vw, 86px) 0; }
.section + .section { padding-top: 0; }
.section[hidden] { display: none; }

/* --- Category tiles ----------------------------------------------------- */

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: clamp(12px, 2vw, 22px);
}

.category-tile {
  position: relative;
  display: block;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border: 1px solid var(--line);
  background: linear-gradient(160deg, var(--deep) 0%, var(--deep2) 100%);
  cursor: pointer;
  padding: 0;
  text-align: left;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.category-tile:hover { transform: translateY(-4px); box-shadow: var(--shadow); }

.category-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.category-tile::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 62%;
  background: linear-gradient(rgba(14, 26, 20, 0), rgba(14, 26, 20, 0.72));
}

.category-tile span {
  position: absolute;
  z-index: 2;
  left: 0; right: 0; bottom: 18px;
  text-align: center;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(18px, 2.2vw, 23px);
  color: #fdfbf7;
  padding-inline: 10px;
}

/* --- Product grid & cards ----------------------------------------------- */

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: clamp(16px, 2.4vw, 30px);
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  cursor: pointer;
  padding: 0;
  font: inherit;
  color: inherit;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }

.card-media {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--gold-soft);
  overflow: hidden;
}
.card-media img { width: 100%; height: 100%; object-fit: cover; }

.card-media .placeholder {
  display: grid;
  place-items: center;
  width: 100%; height: 100%;
  font-size: 34px;
  color: var(--muted);
}

.card.is-sold-out .card-media img { filter: grayscale(1); opacity: 0.55; }

.tag {
  position: absolute;
  z-index: 2;
  top: 10px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 5px 9px;
  color: #fdfbf7;
}
.tag-promo { right: 10px; background: var(--deep); }
.tag-sold { left: 10px; background: var(--danger); }

.card-body { padding: 16px 14px 20px; }

.card-eyebrow {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 7px;
}

.card-name {
  font-family: var(--serif);
  font-size: clamp(17px, 2vw, 21px);
  font-weight: 500;
  line-height: 1.25;
  margin: 0 0 8px;
}

.card-price {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

/* --- Collection view ---------------------------------------------------- */

.chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: clamp(26px, 4vw, 42px);
}

.chip {
  appearance: none;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 9px 18px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.chip:hover { border-color: var(--gold); }
.chip[aria-pressed="true"] { background: var(--deep); border-color: var(--deep); color: #fdfbf7; }

.view-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-bottom: clamp(22px, 3vw, 34px);
}
.view-head .back-row { align-self: flex-start; }

/* --- Detail view -------------------------------------------------------- */

.detail {
  display: grid;
  gap: clamp(24px, 4vw, 54px);
  align-items: start;
}
@media (min-width: 760px) {
  .detail { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

.gallery-main {
  aspect-ratio: 1 / 1;
  background: var(--gold-soft);
  border: 1px solid var(--line);
  overflow: hidden;
  position: relative;
}
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-main .placeholder { display: grid; place-items: center; height: 100%; font-size: 54px; color: var(--muted); }
.gallery-main.is-sold-out img { filter: grayscale(1); opacity: 0.55; }

.thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}
.thumbs button {
  width: 68px; height: 68px;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--gold-soft);
  cursor: pointer;
  overflow: hidden;
}
.thumbs button[aria-current="true"] { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }

.detail-name {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(30px, 4.6vw, 48px);
  line-height: 1.1;
  margin: 0 0 14px;
}

.detail-price {
  font-size: 19px;
  letter-spacing: 0.05em;
  color: var(--ink);
  margin: 0 0 20px;
}

.detail-desc {
  white-space: pre-wrap;
  color: #3c423d;
  margin: 0 0 30px;
  max-width: 56ch;
}

.detail-meta {
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.detail-meta p { margin: 0 0 6px; }
.detail-sku { letter-spacing: 0.12em; text-transform: uppercase; font-size: 11px; }

.sold-note {
  color: var(--danger);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin: 0 0 16px;
}

.buy-slot { min-height: 52px; }
.buy-slot form { margin: 0; }

/* --- Variant options ---------------------------------------------------- */

.options { margin: 0 0 26px; display: grid; gap: 16px; }

.option-name {
  margin: 0 0 8px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
}

.option-values { display: flex; flex-wrap: wrap; gap: 8px; }

.option-chip[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
  text-decoration: line-through;
}
.option-chip[disabled]:hover { border-color: var(--line); }

/* --- Email capture band ------------------------------------------------- */

.capture {
  background: linear-gradient(140deg, var(--deep) 0%, var(--deep2) 100%);
  color: #fdfbf7;
  padding: clamp(44px, 6vw, 72px) 0;
  margin-top: clamp(48px, 7vw, 86px);
  text-align: center;
}
.capture h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-style: italic;
  font-size: clamp(26px, 3.6vw, 38px);
  margin: 0 0 10px;
}
.capture p { margin: 0 auto 26px; max-width: 44ch; color: rgba(253, 251, 247, 0.8); font-size: 14px; }
.capture .eyebrow { color: var(--gold); }

.capture-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  max-width: 520px;
  margin-inline: auto;
}
.capture-form input {
  flex: 1 1 240px;
  min-width: 0;
  appearance: none;
  border: 1px solid rgba(253, 251, 247, 0.4);
  background: rgba(253, 251, 247, 0.06);
  color: #fdfbf7;
  font-family: var(--sans);
  font-size: 14px;
  padding: 14px 16px;
}
.capture-form input::placeholder { color: rgba(253, 251, 247, 0.55); }
.capture-form input:focus { outline: none; border-color: var(--gold); }

.capture-msg {
  margin: 16px 0 0;
  font-size: 13px;
  min-height: 20px;
  letter-spacing: 0.04em;
}
.capture-msg.is-error { color: #ffbcae; }
.capture-msg.is-ok { color: var(--gold-soft); }

/* --- Footer ------------------------------------------------------------- */

.site-footer {
  background: var(--paper);
  border-top: 1px solid var(--line);
  padding: 40px 0;
  font-size: 12px;
  color: var(--muted);
}
.site-footer .shell {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: space-between;
  align-items: center;
}
.site-footer a { color: var(--muted); text-decoration: none; letter-spacing: 0.16em; text-transform: uppercase; font-size: 11px; }
.site-footer a:hover { color: var(--deep); }

/* --- States ------------------------------------------------------------- */

.empty {
  text-align: center;
  color: var(--muted);
  padding: clamp(40px, 8vw, 90px) 0;
}
.empty h2 {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  color: var(--ink);
  font-size: clamp(24px, 3.4vw, 34px);
  margin: 0 0 12px;
}
.empty p { margin: 0 auto 18px; max-width: 44ch; }

.skeleton-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 24px; }
.skeleton {
  aspect-ratio: 3 / 4;
  background: linear-gradient(100deg, var(--gold-soft) 30%, #f6f1e7 50%, var(--gold-soft) 70%);
  background-size: 300% 100%;
  animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer {
  from { background-position: 150% 0; }
  to { background-position: -50% 0; }
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 16px);
  z-index: 60;
  background: var(--deep2);
  color: #fdfbf7;
  padding: 13px 22px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .hero-slide { transition: none; }
}
