/* ==========================================================================
   Ethereal Fits — storefront styles
   Palette taken from the logo: deep maroon, temple gold, warm cream.
   ========================================================================== */

:root {
  --maroon:      #4b1a12;
  --maroon-soft: #6b2a1e;
  --gold:        #c08a2e;
  --gold-light:  #e2b658;
  --cream:       #fdf8f1;
  --cream-deep:  #f5ece0;
  --ink:         #33231c;
  --ink-soft:    #7b675b;
  --line:        #e7d9c8;
  --white:       #fffdfa;
  --green:       #2f6b4f;
  --red:         #9c2b20;
  --radius:      14px;
  --radius-sm:   8px;
  --shadow:      0 2px 10px rgba(75, 26, 18, .06);
  --shadow-lg:   0 12px 34px rgba(75, 26, 18, .13);
  --serif:       "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans:        "Jost", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --wrap:        1220px;
}

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

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

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
}

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

a { color: var(--maroon); text-decoration: none; }
a:hover { color: var(--gold); }

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  color: var(--maroon);
  line-height: 1.2;
  margin: 0 0 .5em;
  letter-spacing: .01em;
}
h1 { font-size: clamp(2rem, 4vw, 2.9rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: 1.25rem; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; }

/* --------------------------------------------------------------- utilities */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.muted { color: var(--ink-soft); }
.center { text-align: center; }
.stack > * + * { margin-top: 1rem; }

/* ----------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  font-family: var(--sans); font-size: .95rem; font-weight: 500; letter-spacing: .06em;
  text-transform: uppercase;
  padding: .85em 1.7em; border-radius: 999px; border: 1px solid var(--maroon);
  background: var(--maroon); color: var(--cream); cursor: pointer;
  transition: transform .15s ease, background .2s ease, color .2s ease, box-shadow .2s ease;
}
.btn:hover { background: var(--maroon-soft); color: #fff; transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: none; }
.btn-gold { background: var(--gold); border-color: var(--gold); color: #2b1a10; }
.btn-gold:hover { background: var(--gold-light); border-color: var(--gold-light); color: #2b1a10; }
.btn-ghost { background: transparent; color: var(--maroon); }
.btn-ghost:hover { background: var(--maroon); color: var(--cream); }
.btn-sm { padding: .55em 1.1em; font-size: .8rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-disabled { opacity: .5; pointer-events: none; }

/* ------------------------------------------------------------------ header */
.topbar {
  background: var(--maroon); color: var(--cream-deep);
  font-size: .82rem; letter-spacing: .09em; text-transform: uppercase;
}
.topbar .wrap { display: flex; justify-content: center; gap: 1.5rem; padding: .55rem 20px; text-align: center; }

.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(253, 248, 241, .94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; gap: 1.2rem;
  padding-top: .7rem; padding-bottom: .7rem;
}
.logo img { height: 52px; width: auto; }
.header-spacer { flex: 1; }

.nav-main { display: flex; align-items: center; gap: 1.4rem; }
.nav-main a {
  font-size: .88rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink); position: relative; padding: .3rem 0;
}
.nav-main a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: 0; height: 1px;
  background: var(--gold); transition: right .25s ease;
}
.nav-main a:hover::after, .nav-main a.is-active::after { right: 0; }
.nav-main a.is-active { color: var(--maroon); }

/* dropdown for collections */
.has-sub { position: relative; }
.subnav {
  position: absolute; left: 50%; transform: translateX(-50%) translateY(6px);
  top: 100%; min-width: 250px; background: var(--white);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: .6rem; opacity: 0; visibility: hidden; transition: all .18s ease;
}
/* Hover/focus dropdown is desktop-only. Left unscoped it also fired on phones —
   a tap triggers :focus-within, and its translateX(-50%) slid the panel half
   off the left edge of the screen. */
@media (min-width: 761px) {
  .has-sub:hover .subnav, .has-sub:focus-within .subnav { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
}
.subnav a { display: block; padding: .45rem .7rem; border-radius: var(--radius-sm); text-transform: none; letter-spacing: .02em; font-size: .92rem; }
.subnav a:hover { background: var(--cream-deep); }
.subnav a::after { display: none; }
.subnav .sub-head { font-family: var(--serif); font-size: 1.02rem; color: var(--maroon); font-weight: 600; }
.subnav .sub-child { padding-left: 1.4rem; color: var(--ink-soft); font-size: .86rem; }

.header-actions { display: flex; align-items: center; gap: .6rem; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid transparent;
  background: none; color: var(--maroon); cursor: pointer;
}
.icon-btn:hover { background: var(--cream-deep); }
.cart-link { position: relative; }
.cart-count {
  position: absolute; top: 2px; right: 0;
  background: var(--gold); color: #2b1a10; font-size: .68rem; font-weight: 600;
  min-width: 18px; height: 18px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
}
.nav-toggle { display: none; }

.search-bar { display: none; border-top: 1px solid var(--line); background: var(--white); }
.search-bar.is-open { display: block; }
.search-bar form { display: flex; gap: .6rem; padding: .9rem 0; }
.search-bar input { flex: 1; }

/* -------------------------------------------------------------------- hero */
.hero {
  background: linear-gradient(135deg, #572016 0%, #7d3521 55%, #a45c2c 100%);
  color: var(--cream);
  padding: clamp(1.4rem, 3vw, 2rem) 0;
  position: relative; overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 82% 18%, rgba(226, 182, 88, .32), transparent 55%);
  pointer-events: none;
}
.hero .wrap { position: relative; z-index: 1; max-width: 820px; text-align: center; }
.hero h1 { color: var(--cream); font-size: clamp(1.7rem, 4vw, 2.4rem); margin-bottom: .25em; }
.hero .eyebrow {
  font-size: .72rem; letter-spacing: .32em; text-transform: uppercase;
  color: var(--gold-light); margin: 0 0 .5rem;
}
.hero p { font-size: .98rem; line-height: 1.5; color: #f6e7d6; max-width: 580px; margin: 0 auto 1.2rem; }
.hero .btn { border-color: var(--gold); padding: .6em 1.5em; font-size: .82rem; }

/* The verse sits with the hero so it is among the first things a visitor reads. */
.hero-quote {
  margin: 1.3rem auto 0;
  max-width: 660px;
  padding-top: 1.4rem;
  position: relative;
}
/* Small gold ornament instead of a rule, so nothing has to match the gradient behind it. */
.hero-quote::before {
  content: "";
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 132px; height: 10px;
  background:
    radial-gradient(circle at center, var(--gold-light) 0 3px, transparent 3.5px) center/10px 10px no-repeat,
    linear-gradient(to right, transparent, rgba(226, 182, 88, .5) 22%, rgba(226, 182, 88, .5) 78%, transparent) center/100% 1px no-repeat;
}
.hero-quote blockquote {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  font-style: italic;
  line-height: 1.35;
  color: #fdf1e0;
}
.hero-quote figcaption {
  margin-top: .5rem;
  font-size: .68rem; letter-spacing: .26em; text-transform: uppercase;
  color: var(--gold-light);
}

/* ---------------------------------------------------------------- sections */
/* Vertical only — several pages carry .wrap and .section on the same element, and a
   padding shorthand here would wipe .wrap's side gutters (content hit the screen edge). */
.section { padding-top: clamp(2.5rem, 6vw, 4.5rem); padding-bottom: clamp(2.5rem, 6vw, 4.5rem); }
.section-alt { background: var(--cream-deep); }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 2.5rem; }
.section-head p { color: var(--ink-soft); margin: 0; }
.ornament {
  display: block; width: 120px; height: 14px; margin: .6rem auto 1.2rem;
  background:
    radial-gradient(circle at center, var(--gold) 0 3px, transparent 3.5px) center/14px 14px no-repeat,
    linear-gradient(to right, transparent, var(--line) 20%, var(--line) 80%, transparent) center/100% 1px no-repeat;
}

/* ------------------------------------------------------------ category grid */
.cat-grid {
  display: grid; gap: 1.4rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.cat-card {
  position: relative; display: block; border-radius: var(--radius); overflow: hidden;
  background: var(--white); border: 1px solid var(--line); box-shadow: var(--shadow);
  transition: transform .22s ease, box-shadow .22s ease;
}
.cat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
/* Square frame matches the square artwork, so the deity images are never cropped;
   the few portrait garment photos centre-crop cleanly inside it. */
.cat-card .thumb { aspect-ratio: 1; background: #faf5ed; }
.cat-card .thumb img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.cat-card .body { padding: 1rem 1.2rem 1.3rem; }
.cat-card h3 { margin-bottom: .2rem; }
.cat-card .count { font-size: .82rem; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); }
.cat-card .kids { margin: .6rem 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: .35rem; }
.cat-card .kids li { font-size: .78rem; color: var(--ink-soft); background: var(--cream-deep); border-radius: 999px; padding: .15rem .6rem; }

/* ------------------------------------------------------------- product grid */
.product-grid {
  display: grid; gap: 1.5rem;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}
.product-card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform .22s ease, box-shadow .22s ease;
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.product-card .thumb { display: block; aspect-ratio: 1; background: #faf5ed; overflow: hidden; }
.product-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.product-card:hover .thumb img { transform: scale(1.04); }
.product-card .body { padding: .9rem 1rem 1.1rem; display: flex; flex-direction: column; flex: 1; gap: .4rem; }
.product-card .title {
  font-family: var(--serif); font-size: 1.05rem; line-height: 1.3; color: var(--maroon);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.product-card .price { font-weight: 600; color: var(--ink); margin-top: auto; }
.price-was { color: var(--ink-soft); text-decoration: line-through; font-weight: 400; margin-right: .3em; }
.badge {
  display: inline-block; font-size: .7rem; letter-spacing: .12em; text-transform: uppercase;
  padding: .18em .7em; border-radius: 999px; background: var(--cream-deep); color: var(--maroon);
}
.badge-out { background: #f1e2e0; color: var(--red); }
.badge-sale { background: var(--gold); color: #2b1a10; }
.badge-low { background: #fbeede; color: #8a5a10; }

/* stock messaging */
.stock-line { margin: 0 0 1.2rem; font-size: .95rem; }
.card-stock { font-size: .78rem; letter-spacing: .04em; color: var(--ink-soft); margin-top: -.15rem; }
.card-stock.is-low { color: #a4620f; }
.stock-in { color: var(--green); }
.stock-low { color: #a4620f; font-weight: 500; }
.stock-out { color: var(--red); font-weight: 500; }
.variant-options label small { color: var(--ink-soft); font-size: .78rem; }
.card-actions { display: flex; gap: .5rem; }

/* ----------------------------------------------------------- shop / listing */
.shop-layout { display: grid; grid-template-columns: 250px 1fr; gap: 2.5rem; align-items: start; }
.sidebar { position: sticky; top: 92px; }
.sidebar h3 { font-size: 1.05rem; border-bottom: 1px solid var(--line); padding-bottom: .5rem; }
.sidebar ul { list-style: none; margin: 0 0 1.6rem; padding: 0; }
.sidebar li a { display: block; padding: .3rem 0; font-size: .95rem; color: var(--ink); }
.sidebar li a:hover, .sidebar li a.is-active { color: var(--gold); }
.sidebar .child a { padding-left: 1rem; font-size: .88rem; color: var(--ink-soft); }
.sidebar .count { color: var(--ink-soft); font-size: .8rem; }

.listing-head { display: flex; flex-wrap: wrap; gap: 1rem; align-items: end; justify-content: space-between; margin-bottom: 1.6rem; }
.listing-head h1 { margin: 0; }

.breadcrumbs { font-size: .84rem; color: var(--ink-soft); margin: 1.2rem 0; }
.breadcrumbs a { color: var(--ink-soft); }
.breadcrumbs a:hover { color: var(--gold); }
.breadcrumbs span { margin: 0 .4rem; }

.pagination { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center; margin-top: 2.5rem; }
.pagination a, .pagination span {
  min-width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--white);
  font-size: .9rem; color: var(--ink); padding: 0 .6rem;
}
.pagination .is-current { background: var(--maroon); color: var(--cream); border-color: var(--maroon); }

/* ------------------------------------------------------------ product page */
.product-layout { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 3rem; align-items: start; }
.gallery-main {
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  background: var(--white); aspect-ratio: 1;
}
.gallery-main img { width: 100%; height: 100%; object-fit: contain; }
.gallery-thumbs { display: flex; gap: .6rem; margin-top: .8rem; flex-wrap: wrap; }
.gallery-thumbs button {
  width: 72px; height: 72px; padding: 0; border-radius: var(--radius-sm); overflow: hidden;
  border: 1px solid var(--line); background: var(--white); cursor: pointer;
}
.gallery-thumbs button.is-active { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(192, 138, 46, .25); }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; }

.product-detail h1 { margin-bottom: .25em; }
.product-price { font-family: var(--serif); font-size: 2rem; color: var(--maroon); margin: .2rem 0 1rem; }
.product-meta { font-size: .88rem; color: var(--ink-soft); margin-bottom: 1.2rem; }
.product-desc { border-top: 1px solid var(--line); margin-top: 2rem; padding-top: 1.5rem; }
.product-desc p { margin: 0 0 .8rem; }

.variant-picker { margin: 1.2rem 0; }
.variant-picker .label { font-size: .82rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: .5rem; }
.variant-options { display: flex; flex-wrap: wrap; gap: .5rem; }
.variant-options label {
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .5rem 1rem;
  cursor: pointer; background: var(--white); font-size: .92rem; transition: all .15s ease;
}
.variant-options input { position: absolute; opacity: 0; pointer-events: none; }
.variant-options input:checked + span { color: var(--maroon); }
.variant-options label:has(input:checked) { border-color: var(--maroon); background: var(--cream-deep); box-shadow: inset 0 0 0 1px var(--maroon); }
.variant-options label.is-out { opacity: .45; cursor: not-allowed; text-decoration: line-through; }

.add-row { display: flex; gap: .8rem; align-items: stretch; margin-top: 1.2rem; }
.qty-input { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; background: var(--white); }
.qty-input button { width: 40px; height: 46px; border: 0; background: none; font-size: 1.2rem; color: var(--maroon); cursor: pointer; }
.qty-input input { width: 44px; border: 0; text-align: center; font-size: 1rem; background: none; color: var(--ink); }
.qty-input input::-webkit-outer-spin-button, .qty-input input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.assurances { list-style: none; padding: 0; margin: 1.8rem 0 0; display: grid; gap: .5rem; font-size: .9rem; color: var(--ink-soft); }
.assurances li { display: flex; gap: .6rem; align-items: flex-start; }
.assurances svg { flex: none; color: var(--gold); margin-top: .2rem; }

/* ------------------------------------------------------------ cart & forms */
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: .78rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-soft); font-weight: 500; padding: .6rem .8rem; border-bottom: 1px solid var(--line);
}
.table td { padding: 1rem .8rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table .num { text-align: right; }
.cart-item { display: flex; gap: 1rem; align-items: center; }
.cart-item img { width: 76px; height: 76px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--line); }
.cart-item .name { font-family: var(--serif); font-size: 1.05rem; color: var(--maroon); }

/* Smaller photo used in order/checkout summary tables, where several rows stack. */
.order-line { display: flex; gap: .8rem; align-items: center; }
.order-line-thumb { width: 52px; height: 52px; flex: none; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--line); background: #faf5ed; }

.cart-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 2.5rem; align-items: start; }
.panel {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.5rem; box-shadow: var(--shadow);
}
.panel h2, .panel h3 { margin-top: 0; }
.totals { list-style: none; margin: 0 0 1.2rem; padding: 0; }
.totals li { display: flex; justify-content: space-between; padding: .45rem 0; }
.totals .grand { border-top: 1px solid var(--line); margin-top: .4rem; padding-top: .8rem; font-size: 1.2rem; font-family: var(--serif); color: var(--maroon); }

label.field { display: block; margin-bottom: 1rem; }
label.field > span { display: block; font-size: .82rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: .35rem; }
input[type=text], input[type=email], input[type=tel], input[type=password], input[type=number], input[type=search], input[type=date], select, textarea {
  width: 100%; padding: .7rem .9rem; font: inherit; font-size: .98rem; color: var(--ink);
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-sm);
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(192, 138, 46, .16); }
textarea { min-height: 130px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.hp { position: absolute; left: -9999px; }

/* ----------------------------------------------------------------- notices */
.notice {
  border-radius: var(--radius-sm); padding: .9rem 1.1rem; margin: 1.2rem 0;
  border: 1px solid var(--line); background: var(--white); font-size: .95rem;
}
.notice-success { border-color: #bcd8c8; background: #f0f8f3; color: var(--green); }
.notice-error { border-color: #e6c3bf; background: #fbf1f0; color: var(--red); }
.notice-info { border-color: var(--gold); background: #fdf5e6; color: #7a5510; }

.announce {
  background: var(--cream-deep); border: 1px dashed var(--gold);
  border-radius: var(--radius); padding: 1.1rem 1.3rem; margin: 0 0 2rem;
}
.announce h3 { font-size: 1.05rem; margin-bottom: .3rem; }
.announce p { margin: 0; font-size: .94rem; color: var(--ink-soft); white-space: pre-line; }

.empty-state { text-align: center; padding: 4rem 1rem; }
.empty-state h2 { margin-bottom: .4rem; }

/* ------------------------------------------------------------------- quote */
.quote-band { background: var(--maroon); color: var(--cream-deep); text-align: center; padding: clamp(2.5rem, 6vw, 4rem) 0; }
.quote-band blockquote {
  font-family: var(--serif); font-size: clamp(1.3rem, 3vw, 1.9rem); line-height: 1.45;
  margin: 0 auto; max-width: 760px; color: var(--cream);
}
.quote-band .attrib { display: block; margin-top: 1rem; font-family: var(--sans); font-size: .8rem; letter-spacing: .3em; text-transform: uppercase; color: var(--gold-light); }

/* ------------------------------------------------------------------ footer */
.site-footer { background: #3a140e; color: #e9d9c6; padding: 3.5rem 0 2rem; margin-top: 4rem; }
.site-footer h4 { color: var(--gold-light); font-family: var(--sans); font-size: .8rem; letter-spacing: .18em; text-transform: uppercase; margin-bottom: 1rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(2, 1fr); gap: 2.5rem; }
.site-footer a { color: #e9d9c6; font-size: .95rem; }
.site-footer a:hover { color: var(--gold-light); }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .45rem; }
.site-footer .logo img { height: 46px; }
.site-footer p { font-size: .92rem; color: #c9b6a2; }
.footer-bottom {
  border-top: 1px solid rgba(233, 217, 198, .18); margin-top: 2.5rem; padding-top: 1.4rem;
  display: flex; flex-wrap: wrap; gap: .6rem; justify-content: space-between; font-size: .84rem; color: #b8a390;
}

/* -------------------------------------------- collapsible filters (mobile) */
/* On phones the 19-item collection list would push products below the fold, so it
   collapses into a tap-to-open panel. On desktop it is always shown. */
.filters > summary {
  display: none;
  cursor: pointer;
  list-style: none;
  padding: .85rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--white);
  font-size: .95rem;
  color: var(--maroon);
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
}
.filters > summary::-webkit-details-marker { display: none; }
.filters > summary::after {
  content: "";
  width: 9px; height: 9px; flex: none;
  border-right: 2px solid var(--gold); border-bottom: 2px solid var(--gold);
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform .2s ease;
}
.filters[open] > summary::after { transform: rotate(-135deg) translate(-2px, -2px); }

/* ------------------------------------------------------------- responsive */
@media (max-width: 980px) {
  .shop-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .filters > summary { display: flex; }
  .filters[open] > .filters-body {
    padding: 1rem 1.1rem .4rem;
    border: 1px solid var(--line); border-top: 0;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    background: var(--white);
    margin-top: -1px;
  }
  .sidebar ul { display: flex; flex-wrap: wrap; gap: .4rem 1rem; }
  .product-layout { grid-template-columns: 1fr; gap: 2rem; }
  .cart-layout { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
}

@media (max-width: 760px) {
  /* Tighter rhythm on phones so products appear sooner. */
  .section { padding-top: 2rem; padding-bottom: 2rem; }
  .section-head { margin-bottom: 1.5rem; }
  .section-head p { font-size: .95rem; }
  .cat-grid { gap: 1rem; }
  .cat-card .thumb { aspect-ratio: 16 / 11; }      /* shorter cards, whole image still shown */
  .cat-card .thumb img { object-fit: contain; }
  .cat-card .kids { display: none; }               /* sub-collections live in the menu and on the page itself */
  .cat-card .body { padding: .85rem 1rem 1rem; }

  /* Title first, sort control full width underneath — side by side is cramped at 390px. */
  .listing-head { flex-direction: column; align-items: stretch; gap: .8rem; }
  .listing-head form { width: 100%; }
  .listing-head h1 { font-size: 1.7rem; }

  /* Two products per row: most visitors browse on a phone, and one-up wastes the screen. */
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; }
  .product-card .body { padding: .7rem .75rem .9rem; gap: .3rem; }
  .product-card .title { font-size: .95rem; -webkit-line-clamp: 2; }
  .product-card .price { font-size: .95rem; }
  .card-stock { font-size: .72rem; }
  .product-card .btn { width: 100%; padding: .6em .8em; }
  .card-actions form { width: 100%; }

  /* Comfortable thumbs: nothing important smaller than ~44px. */
  .btn { min-height: 44px; }
  .btn-sm { min-height: 40px; padding: .6em 1.1em; }
  .icon-btn { width: 44px; height: 44px; }
  .sidebar li a { padding: .55rem 0; }
  .variant-options label { padding: .7rem 1.1rem; }
  .qty-input button { width: 46px; height: 48px; }

  /* 16px inputs stop iOS Safari zooming in when a field is focused. */
  input[type=text], input[type=email], input[type=tel], input[type=password],
  input[type=number], input[type=search], input[type=date], select, textarea {
    font-size: 16px;
    padding: .75rem .9rem;
  }

  .nav-toggle { display: inline-flex; }
  .nav-main {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--white); border-bottom: 1px solid var(--line); padding: .6rem 20px 1.2rem;
    box-shadow: var(--shadow-lg);
  }
  .nav-main.is-open { display: flex; }
  /* The panel can never grow past the screen — it scrolls instead. */
  .nav-main {
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }
  .nav-main a { padding: .85rem 0; border-bottom: 1px solid var(--line); }
  .nav-main a::after { display: none; }

  /* Collections is collapsed by default on phones; with 18 sub-links expanded it
     pushed About and Contact off the bottom of the screen. */
  .has-sub { display: block; border-bottom: 1px solid var(--line); }
  .has-sub > a {
    display: flex; align-items: center; justify-content: space-between;
    border-bottom: 0; pointer-events: auto;
  }
  .has-sub > a::after {
    /* Reset the desktop underline styles this pseudo-element carries, then draw a chevron. */
    content: ""; display: block;
    position: static; left: auto; right: auto; bottom: auto; background: none;
    width: 9px; height: 9px; flex: none; margin-right: .2rem;
    border-right: 2px solid var(--gold); border-bottom: 2px solid var(--gold);
    transform: rotate(45deg) translate(-2px, -2px);
    transition: transform .2s ease;
  }
  .has-sub.is-open > a::after { transform: rotate(-135deg) translate(-2px, -2px); }
  /* Written with .has-sub in the selector so no desktop rule can out-rank these. */
  .has-sub .subnav,
  .has-sub:hover .subnav,
  .has-sub:focus-within .subnav {
    display: none;
    position: static; inset: auto; transform: none;
    opacity: 1; visibility: visible; box-shadow: none;
    min-width: 0; width: 100%;
    border: 0; border-radius: 0; padding: 0 0 .6rem .8rem;
  }
  .has-sub.is-open .subnav,
  .has-sub.is-open:hover .subnav,
  .has-sub.is-open:focus-within .subnav { display: block; }
  .subnav a { padding: .6rem 0; border-bottom: 0; }
  .logo img { height: 42px; }
  /* Stacked table rows carry their own labels, since the header row is hidden. */
  .table thead { display: none; }
  .table td { display: flex; align-items: center; justify-content: space-between; gap: 1rem; border: 0; padding: .35rem .2rem; }
  .table td[data-label]::before {
    content: attr(data-label);
    font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft);
  }
  .table tbody tr { display: block; border-bottom: 1px solid var(--line); padding: 1rem 0; }
  .table .num { text-align: right; }
  .cart-item { width: 100%; }
  .order-line { width: 100%; }
  .form-row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
}

/* -------------------------------------------------------------- print/misc */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
