/* =========================================================================
   Al Rayan storefront — self-contained stylesheet (no build step).
   Premium light theme, emerald brand to match the admin.
   ========================================================================= */

:root {
  --emerald-50: #ecfdf5;
  --emerald-100: #d1fae5;
  --emerald-600: #059669;
  --emerald-700: #047857;
  --emerald-800: #065f46;
  --gold: #c9a227;
  --ink: #1c1917;
  --ink-soft: #44403c;
  --muted: #78716c;
  --line: #e7e5e4;
  --bg: #faf9f7;
  --card: #ffffff;
  --danger: #b91c1c;
  --radius: 14px;
  /* Single source of truth for the page gutter — the header, every .container
     and the flash stack all read it, so they stay flush at any width. */
  --gutter: 32px;
  --header-h: 80px;
  --shadow-sm: 0 1px 2px rgba(28, 25, 23, .06);
  --shadow: 0 6px 24px rgba(28, 25, 23, .08);
  --shadow-lg: 0 18px 50px rgba(28, 25, 23, .12);
  --maxw: 1400px;

  /* ---- Liquid glass system -------------------------------------------- */
  --glass-bg: rgba(255, 255, 255, .55);
  --glass-bg-strong: rgba(255, 255, 255, .72);
  --glass-bg-soft: rgba(255, 255, 255, .38);
  --glass-blur: saturate(1.7) blur(16px);
  --glass-blur-lg: saturate(1.8) blur(24px);
  --glass-border: rgba(255, 255, 255, .55);
  --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, .8),
                     inset 0 0 0 1px rgba(255, 255, 255, .18);
  --glass-shadow: 0 8px 32px rgba(28, 25, 23, .12), 0 2px 8px rgba(28, 25, 23, .06);
  --glass-shadow-lg: 0 20px 60px rgba(28, 25, 23, .18), 0 4px 12px rgba(28, 25, 23, .08);
  --glass-tint-emerald: rgba(5, 150, 105, .10);
  --glass-tint-gold: rgba(201, 162, 39, .12);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* Scroll-scrubbed silk fabric sequence — sits at the very back of the site. */
#silk-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -3;
  display: block;
  pointer-events: none;
}

/* Light scrim + ambient brand glows over the silk, so the fabric reads as a
   faint luxury texture and dark text stays fully legible. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  /* background:
    radial-gradient(38rem 30rem at 8% -6%, rgba(5, 150, 105, .16), transparent 60%),
    radial-gradient(34rem 28rem at 100% 4%, rgba(201, 162, 39, .14), transparent 58%),
    radial-gradient(40rem 34rem at 50% 108%, rgba(4, 120, 87, .12), transparent 60%),
    linear-gradient(180deg, rgba(251, 250, 248, .74), rgba(250, 249, 247, .8)); */
    background:
    radial-gradient(38rem 30rem at 8% -6%, rgba(5, 150, 105, 0.08), transparent 60%),
    radial-gradient(34rem 28rem at 100% 4%, rgba(201, 162, 39, 0.07), transparent 58%),
    radial-gradient(40rem 34rem at 50% 108%, rgba(4, 120, 87, 0.06), transparent 60%),
    linear-gradient(180deg, rgba(251, 250, 248, 0.92), rgba(250, 249, 247, 0.95));
}

/* Reusable glass surface — apply the visual language consistently. */
.glass {
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-highlight), var(--glass-shadow);
}

h1, h2, h3, h4 {
  font-family: 'Playfair Display', Georgia, serif;
  color: var(--ink);
  line-height: 1.2;
  margin: 0 0 .4em;
  font-weight: 600;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto;
  padding-left: var(--gutter); padding-right: var(--gutter); }
.section { padding: 56px 0; }
.section-tight { padding: 32px 0; }

.muted { color: var(--muted); }
.center { text-align: center; }
.flex { display: flex; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.gap-sm { gap: 8px; }

.section-head { display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 24px; gap: 16px; flex-wrap: wrap; }
.section-head h2 { font-size: 28px; margin: 0; }
.section-head .eyebrow { color: var(--emerald-700); font-weight: 600; letter-spacing: .12em;
  text-transform: uppercase; font-size: 12px; display: block; margin-bottom: 4px; }

/* ---- Buttons ---------------------------------------------------------- */
.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 999px; cursor: pointer;
  font: inherit; font-weight: 600; padding: 11px 22px;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
  white-space: nowrap; overflow: hidden;
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
}
/* Specular sheen shared by every button. */
.btn::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,.45), rgba(255,255,255,0) 45%);
  opacity: .8;
}
.btn-primary { background: linear-gradient(180deg, rgba(6,148,105,.92), rgba(4,120,87,.92));
  color: #fff; border-color: rgba(255,255,255,.25);
  box-shadow: var(--glass-highlight), 0 6px 18px rgba(4,120,87,.35); }
.btn-primary:hover { transform: translateY(-1px);
  box-shadow: var(--glass-highlight), 0 12px 28px rgba(4,120,87,.42); }
.btn-ghost { background: var(--glass-bg); border-color: var(--glass-border);
  color: var(--ink); box-shadow: var(--glass-highlight), var(--shadow-sm); }
.btn-ghost:hover { border-color: rgba(4,120,87,.5); color: var(--emerald-700);
  transform: translateY(-1px); box-shadow: var(--glass-highlight), var(--shadow); }
.btn-dark { background: linear-gradient(180deg, rgba(41,37,36,.9), rgba(12,10,9,.92));
  color: #fff; border-color: rgba(255,255,255,.15);
  box-shadow: var(--glass-highlight), var(--shadow); }
.btn-dark:hover { transform: translateY(-1px);
  box-shadow: var(--glass-highlight), var(--shadow-lg); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---- Header ----------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--glass-bg-strong);
  -webkit-backdrop-filter: var(--glass-blur-lg); backdrop-filter: var(--glass-blur-lg);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: 0 4px 24px rgba(28,25,23,.06), inset 0 -1px 0 rgba(255,255,255,.4);
}
.site-header .header-inner { padding-left: var(--gutter); padding-right: var(--gutter); }
.site-header .bar { display: flex; align-items: center; gap: 24px; height: var(--header-h);
  justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand img { width: 80px; height: 90px; flex: none; }
.brand .sub { color: var(--emerald-700); }
.brand-text {
  font-family: 'Cinzel', serif;
  font-size: 26px;
  font-weight: 500;
  letter-spacing: 3px;
  min-width: 0;
  text-transform: uppercase;
  white-space: nowrap;
  background: linear-gradient(
    180deg,
    #fff8e7 0%,
    #f7ddb1 15%,
    #d59b55 35%,
    #8c5524 50%,
    #d59b55 65%,
    #fff2d5 85%,
    #c88842 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow:
    1px 1px 0 #8b5a2b,
    -1px -1px 0 #fff3d0,
    0 2px 4px rgba(0,0,0,.45);
}
.main-nav { display: flex; align-items: center; gap: 4px; margin-left: 8px; }
.main-nav a { padding: 8px 14px; border-radius: 999px; color: var(--ink-soft);
  font-weight: 500; transition: .15s; white-space: nowrap; }
.main-nav a:hover { background: var(--emerald-50); color: var(--emerald-700); }
.header-actions { display: flex; align-items: center; gap: 8px; }

.search-mini { display: flex; align-items: center; background: var(--glass-bg-soft);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border); border-radius: 999px; padding: 6px 10px; gap: 6px;
  box-shadow: var(--glass-highlight); }
.search-mini:focus-within { border-color: rgba(4,120,87,.4);
  box-shadow: var(--glass-highlight), 0 0 0 3px var(--glass-tint-emerald); }
.search-mini input { border: 0; background: transparent; outline: 0; font: inherit;
  width: 150px; }
.search-mini button { border: 0; background: transparent; cursor: pointer; color: var(--muted);
  display: flex; }

.cart-link { position: relative; display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; border-radius: 999px; color: #fff; font-weight: 600;
  background: linear-gradient(180deg, rgba(6,148,105,.92), rgba(4,120,87,.92));
  border: 1px solid rgba(255,255,255,.25);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-highlight), 0 6px 18px rgba(4,120,87,.32);
  transition: transform .18s ease, box-shadow .18s ease; }
.cart-link:hover { transform: translateY(-1px);
  box-shadow: var(--glass-highlight), 0 12px 26px rgba(4,120,87,.4); }
.cart-badge { background: var(--gold); color: #2a2300; border-radius: 999px;
  font-size: 11px; font-weight: 800; min-width: 18px; height: 18px; padding: 0 5px;
  display: inline-flex; align-items: center; justify-content: center; }

/* Hamburger — hidden until the desktop nav moves into the drawer at 1200px. */
.nav-toggle { display: none; flex: none; width: 44px; height: 44px; padding: 0;
  align-items: center; justify-content: center; cursor: pointer;
  border: 1px solid var(--glass-border); border-radius: 12px; color: var(--ink);
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-highlight), var(--shadow-sm); }
.nav-toggle .icon { width: 22px; height: 22px; }
.nav-toggle .icon-close, .nav-toggle[aria-expanded="true"] .icon-open { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }

/* Mobile drawer — search + the full link list the desktop bar can't hold. */
.mobile-nav { display: none; border-top: 1px solid var(--glass-border);
  padding: 14px var(--gutter) 20px; max-height: calc(100vh - var(--header-h));
  max-height: calc(100dvh - var(--header-h)); overflow-y: auto;
  -webkit-overflow-scrolling: touch; }
.mobile-nav[hidden] { display: none; }
.mobile-nav .search-mini { display: flex; width: 100%; margin-bottom: 12px; padding: 10px 14px; }
.mobile-nav .search-mini input { width: 100%; font-size: 16px; }
.mobile-nav-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.mobile-nav-links a { display: flex; align-items: center; min-height: 46px;
  padding: 10px 14px; border-radius: 12px; font-weight: 500; color: var(--ink-soft);
  border: 1px solid var(--glass-border); background: var(--glass-bg-soft); }
.mobile-nav-links a:active { background: var(--emerald-50); color: var(--emerald-700); }

.icon { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; }

/* ---- Hero ------------------------------------------------------------- */
.hero { position: relative; 
  overflow: hidden; }
  /* background:
    radial-gradient(1200px 400px at 80% -10%, var(--emerald-100), transparent 60%),
    linear-gradient(180deg, #fff, var(--bg)); border-bottom: 1px solid var(--line); */
.hero .container { display: grid; grid-template-columns: 1.1fr .9fr; gap: 140px;
  align-items: center; padding-top: 64px; padding-bottom: 64px; }
.hero .eyebrow { color: var(--emerald-700); font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; font-size: 12px; }
.hero h1 { font-size: clamp(34px, 5vw, 56px); margin: 12px 0 16px; }
.hero p { font-size: 17px; color: var(--ink-soft); max-width: 48ch; }
.hero .cta { margin-top: 26px; display: flex; gap: 12px; flex-wrap: wrap; }
.hero-art { max-height: 525px; position: relative; aspect-ratio: 4/5; border-radius: 20px; overflow: hidden;
  box-shadow: var(--shadow-lg); background: linear-gradient(135deg, var(--emerald-700), var(--emerald-800)); }
.hero-art .swatches { position: absolute; inset: 0; display: grid;
  grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); }
.hero-art .swatches span { display: block; }

/* ---- Category pills / strip ------------------------------------------ */
.cat-strip { display: flex; gap: 12px; flex-wrap: wrap; }
.cat-card { flex: 1 1 180px; min-width: 160px; background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius); padding: 20px; transition: .18s;
  box-shadow: var(--glass-highlight), var(--shadow-sm); }
.cat-card:hover { border-color: rgba(4,120,87,.4); transform: translateY(-2px);
  box-shadow: var(--glass-highlight), var(--glass-shadow); }
.cat-card h3 { font-size: 18px; margin: 0 0 4px; }
.cat-card .count { color: var(--muted); font-size: 13px; }
.cat-card .arrow { color: var(--emerald-700); font-weight: 700; margin-top: 10px; display: inline-block; }

/* ---- Product grid + cards -------------------------------------------- */
.product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.product-card { background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border); border-radius: var(--radius);
  overflow: hidden; transition: .18s; display: flex; flex-direction: column;
  box-shadow: var(--glass-highlight), var(--shadow-sm); }
.product-card:hover { transform: translateY(-3px);
  box-shadow: var(--glass-highlight), var(--glass-shadow); border-color: rgba(4,120,87,.35); }
.product-thumb { position: relative; aspect-ratio: 3/4; overflow: hidden; }
.product-thumb img { width: 100%; height: 100%; object-fit: cover; transition: .3s; }
.product-card:hover .product-thumb img { transform: scale(1.04); }
.thumb-fallback { width: 100%; height: 100%; display: grid;
  grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(2, 1fr); }
.thumb-fallback span { display: block; }
.thumb-logo { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  pointer-events: none; }
.thumb-logo span { background: rgba(255,255,255,.82); color: var(--ink); font-weight: 700;
  font-family: 'Playfair Display', serif; padding: 6px 12px; border-radius: 999px; font-size: 13px;
  letter-spacing: .03em; }
.badge-row { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.badge { font-size: 11px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase;
  padding: 4px 9px; border-radius: 999px; }
.badge-sale { background: var(--gold); color: #2a2300; }
.badge-new { background: var(--emerald-700); color: #fff; }
.badge-soft { background: var(--emerald-50); color: var(--emerald-800); }
.product-body { padding: 14px 15px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.product-meta { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.product-name { font-family: 'Inter', sans-serif; font-weight: 600; font-size: 15px; color: var(--ink);
  line-height: 1.35; margin: 0; }
.swatch-row { display: flex; gap: 5px; margin-top: 2px; }
.swatch { width: 15px; height: 15px; border-radius: 50%; border: 1px solid rgba(0,0,0,.15);
  box-shadow: inset 0 0 0 2px #fff; }
.price-row { margin-top: auto; display: flex; align-items: baseline; gap: 8px; padding-top: 8px; }
.price { font-weight: 800; font-size: 17px; color: var(--ink); }
.price-old { color: var(--muted); text-decoration: line-through; font-size: 13px; }
.price-off { color: var(--danger); font-size: 12px; font-weight: 700; }

/* ---- Shop layout: filters + results ---------------------------------- */
.shop-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 32px; align-items: start; }
.filters { position: sticky; top: calc(var(--header-h) + 10px); background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius); padding: 18px;
  box-shadow: var(--glass-highlight), var(--shadow-sm); }
.filters h4 { font-family: 'Inter', sans-serif; font-size: 12px; text-transform: uppercase;
  letter-spacing: .08em; color: var(--muted); margin: 18px 0 8px; }
.filters h4:first-child { margin-top: 0; }
/* The filter panel is a <details> so it can collapse on narrow screens with no
   JS; the summary is hidden on desktop, where it is always open. */
.filters > summary { display: none; }
.filters-summary { display: flex; align-items: center; justify-content: space-between;
  gap: 10px; cursor: pointer; list-style: none; font-weight: 700; min-height: 24px; }
.filters-summary::-webkit-details-marker { display: none; }
.filters-summary .chev { transition: transform .2s ease; color: var(--muted); }
.filters[open] > .filters-summary .chev { transform: rotate(180deg); }
.filters-summary .n { background: var(--emerald-700); color: #fff; border-radius: 999px;
  font-size: 11px; font-weight: 800; padding: 1px 7px; margin-left: auto; }
.filter-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.filter-list a { display: flex; justify-content: space-between; padding: 6px 10px; border-radius: 8px;
  color: var(--ink-soft); font-size: 14px; }
.filter-list a:hover { background: var(--emerald-50); }
.filter-list a.active { background: var(--emerald-700); color: #fff; font-weight: 600; }
.color-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.color-grid a { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line);
  box-shadow: inset 0 0 0 2px #fff; }
.color-grid a.active { outline: 2px solid var(--emerald-700); outline-offset: 1px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 20px; flex-wrap: wrap; }
.toolbar .count { color: var(--muted); font-size: 14px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--glass-tint-emerald);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border: 1px solid rgba(4,120,87,.18);
  color: var(--emerald-800); border-radius: 999px; padding: 5px 12px; font-size: 13px; font-weight: 600;
  box-shadow: var(--glass-highlight); }
.chip a { color: var(--emerald-800); font-weight: 800; }
select.sort, .field-input { font: inherit; padding: 9px 12px; border: 1px solid var(--glass-border);
  border-radius: 10px; background: var(--glass-bg-soft);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  color: var(--ink); outline: none; box-shadow: var(--glass-highlight); }
.field-input:focus, select.sort:focus { border-color: rgba(4,120,87,.5);
  background: var(--glass-bg-strong);
  box-shadow: var(--glass-highlight), 0 0 0 3px var(--glass-tint-emerald); }

/* ---- Pagination ------------------------------------------------------- */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 36px; flex-wrap: wrap; }
.pagination a, .pagination span { padding: 8px 13px; border-radius: 9px; border: 1px solid var(--glass-border);
  background: var(--glass-bg); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  color: var(--ink-soft); font-weight: 600; box-shadow: var(--glass-highlight); }
.pagination .current { background: var(--emerald-700); color: #fff; border-color: var(--emerald-700); }
.pagination a:hover { border-color: var(--emerald-700); color: var(--emerald-700); }

/* ---- Product detail --------------------------------------------------- */
.pdp { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 44px;
  align-items: start; }
.gallery .main { aspect-ratio: 3/4; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--glass-border); background: var(--glass-bg);
  box-shadow: var(--glass-highlight), var(--shadow-sm); }
.gallery .main img, .gallery .main .thumb-fallback { width: 100%; height: 100%; object-fit: cover; }
.pdp h1 { font-size: 34px; margin-top: 6px; }
.pdp .meta { color: var(--muted); text-transform: uppercase; letter-spacing: .07em; font-size: 12px; }
.pdp .price-row { font-size: 22px; }
.pdp .price { font-size: 28px; }
.pdp .lead { color: var(--ink-soft); margin: 16px 0; }
.option-block { margin: 22px 0; }
.option-block label.h { display: block; font-weight: 700; margin-bottom: 10px; font-size: 14px; }
.opt-colors { display: flex; gap: 10px; flex-wrap: wrap; }
.opt-color { cursor: pointer; }
.opt-color input { position: absolute; opacity: 0; pointer-events: none; }
.opt-color .dot { width: 36px; height: 36px; border-radius: 50%; border: 1px solid rgba(0,0,0,.15);
  box-shadow: inset 0 0 0 3px #fff; transition: .15s; display: block; }
.opt-color input:checked + .dot { outline: 2px solid var(--emerald-700); outline-offset: 2px; }
.opt-color .nm { display: block; text-align: center; font-size: 11px; color: var(--muted); margin-top: 4px; }
.meter-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--glass-border);
  border-radius: 10px; overflow: hidden; background: var(--glass-bg-soft);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-highlight); }
.qty button { border: 0; background: rgba(255,255,255,.35); width: 38px; height: 40px;
  font-size: 18px; cursor: pointer; transition: background .15s; }
.qty button:hover { background: rgba(255,255,255,.6); }
.qty input { width: 48px; height: 40px; text-align: center; border: 0; outline: 0; font: inherit; }
.pdp .actions { display: flex; gap: 12px; margin-top: 22px; flex-wrap: wrap; }
.spec-table { width: 100%; border-collapse: collapse; margin-top: 18px; font-size: 14px; }
.spec-table th, .spec-table td { text-align: left; padding: 9px 0; border-bottom: 1px solid var(--line); }
.spec-table th { color: var(--muted); font-weight: 600; width: 40%; }
.trust { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 18px; color: var(--ink-soft);
  font-size: 13px; }
.trust div { display: flex; align-items: center; gap: 7px; }

/* ---- Cart / checkout -------------------------------------------------- */
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 32px; align-items: start; }
.panel { background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border); border-radius: var(--radius);
  box-shadow: var(--glass-highlight), var(--shadow-sm); }
.panel .panel-head { padding: 16px 20px; border-bottom: 1px solid var(--glass-border);
  font-weight: 700; background: linear-gradient(180deg, rgba(255,255,255,.5), transparent); }
.panel .panel-body { padding: 20px; }
/* Summary rows are "label … amount" pairs: let the label wrap, never the
   amount, and keep a gap so the two can't collide on a narrow screen. */
.panel-body .row { gap: 12px; }
.panel-body .row > :last-child { white-space: nowrap; }
.summary { position: sticky; top: calc(var(--header-h) + 10px); }
.summary .row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0;
  color: var(--ink-soft); }
.summary .row.total { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 14px;
  font-size: 19px; font-weight: 800; color: var(--ink); }
.cart-item { display: grid; gap: 6px 16px; padding: 16px 0;
  grid-template-columns: 84px minmax(0, 1fr) auto;
  grid-template-areas: "thumb info  total"
                       "thumb acts  total";
  border-bottom: 1px solid var(--line); align-items: center; }
.cart-item:last-child { border-bottom: 0; }
.cart-item > .thumb { grid-area: thumb; align-self: center; }
.cart-item > .ci-info { grid-area: info; min-width: 0; align-self: end; }
.cart-item > .ci-actions { grid-area: acts; align-self: start;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.cart-item > .ci-total { grid-area: total; text-align: right; white-space: nowrap; }
.cart-item .thumb { width: 84px; height: 104px; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--line); }
.cart-item .thumb img, .cart-item .thumb .thumb-fallback { width: 100%; height: 100%; object-fit: cover; }
.cod-banner { display: flex; gap: 10px; align-items: center; background: var(--glass-tint-emerald);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  color: var(--emerald-800); border: 1px solid rgba(4,120,87,.2); border-radius: 12px;
  padding: 12px 14px; font-weight: 600; font-size: 14px;
  box-shadow: var(--glass-highlight); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 600; font-size: 13px; }
.field .field-input, .field select, .field textarea { width: 100%; }
.field .errorlist { color: var(--danger); font-size: 12px; margin: 2px 0 0; padding-left: 16px; }
.empty { text-align: center; padding: 70px 20px; }
.empty .big { font-size: 54px; margin-bottom: 8px; }

/* ---- Messages --------------------------------------------------------- */
.flash-wrap { position: fixed; top: calc(var(--header-h) + 4px); right: var(--gutter);
  left: auto; z-index: 80; display: flex;
  flex-direction: column; gap: 10px; width: 340px; max-width: calc(100vw - var(--gutter) * 2); }
.flash { background: var(--glass-bg-strong);
  -webkit-backdrop-filter: var(--glass-blur-lg); backdrop-filter: var(--glass-blur-lg);
  border: 1px solid var(--glass-border); border-left: 4px solid var(--emerald-700);
  border-radius: 10px; padding: 12px 16px; box-shadow: var(--glass-highlight), var(--glass-shadow);
  font-size: 14px; animation: slideIn .25s ease; }
.flash.error { border-left-color: var(--danger); }
.flash.info { border-left-color: var(--gold); }
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

/* ---- Footer ----------------------------------------------------------- */
.site-footer { background: linear-gradient(180deg, rgba(28,25,23,.88), rgba(12,10,9,.92));
  -webkit-backdrop-filter: var(--glass-blur-lg); backdrop-filter: var(--glass-blur-lg);
  color: #d6d3d1; margin-top: 64px; border-top: 1px solid rgba(255,255,255,.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06); }
.site-footer .container { padding-top: 48px; padding-bottom: 32px; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 30px; }
.site-footer h5 { color: #fff; font-family: 'Inter', sans-serif; font-size: 13px; letter-spacing: .06em;
  text-transform: uppercase; margin: 0 0 12px; }
.site-footer a { color: #a8a29e; display: block; padding: 4px 0; }
.site-footer a:hover { color: #fff; }
.foot-brand { display: flex; align-items: center; gap: 10px; font-family: 'Playfair Display', serif;
  font-size: 22px; color: #fff; font-weight: 700; margin-bottom: 12px; }
.foot-brand img { width: 32px; height: 32px; }
.foot-bottom { border-top: 1px solid #292524; margin-top: 30px; padding-top: 18px;
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13px; color: #78716c; }

/* ---- App download prompt ---------------------------------------------- */
/* Floating card offering the Android APK. store.js unhides it (and remembers a
   dismissal), so it never flashes on screen for people who closed it. */
.app-promo {
  position: fixed; z-index: 90;
  right: var(--gutter); bottom: 24px; width: 320px; max-width: calc(100vw - var(--gutter) * 2);
  display: flex; gap: 14px; padding: 16px 16px 16px 14px;
  border-radius: 18px; border: 1px solid var(--glass-border);
  background: var(--glass-bg-strong);
  -webkit-backdrop-filter: var(--glass-blur-lg); backdrop-filter: var(--glass-blur-lg);
  box-shadow: var(--glass-highlight), var(--glass-shadow-lg);
  animation: promoIn .32s cubic-bezier(.22, 1, .36, 1);
}
/* [hidden] loses to the display:flex above without this. */
.app-promo[hidden] { display: none; }
.app-promo.is-leaving { animation: promoOut .22s ease forwards; }
.app-promo-logo { width: 52px; height: 60px; object-fit: contain; flex: none; align-self: flex-start; }
.app-promo-body { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.app-promo-body strong { font-family: 'Playfair Display', serif; font-size: 17px; letter-spacing: .01em; }
.app-promo-body p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.45; }
.app-promo-cta { align-self: flex-start; margin-top: 4px; padding: 9px 18px; font-size: 14px; }
.app-promo-cta .icon { width: 17px; height: 17px; }
.app-promo-hint { font-size: 11.5px; color: var(--muted); line-height: 1.4; }
.app-promo-close {
  position: absolute; top: 8px; right: 8px; width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 999px; background: transparent; color: var(--muted); cursor: pointer;
  transition: background .18s ease, color .18s ease;
}
.app-promo-close:hover { background: rgba(28,25,23,.07); color: var(--ink); }
.app-promo-close .icon { width: 16px; height: 16px; }
@keyframes promoIn { from { opacity: 0; transform: translateY(16px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes promoOut { to { opacity: 0; transform: translateY(12px) scale(.97); } }

/* ---- Responsive ------------------------------------------------------- */
/* The full bar (brand + eight links + search + cart) measures ~1390px, so it
   only fits at the very top end. Below that it steps down: compact, then a
   drawer. */
@media (max-width: 1360px) {
  .brand img { width: 60px; height: 68px; }
  .brand-text { font-size: 22px; letter-spacing: 2px; }
  .main-nav { margin-left: 0; }
  .main-nav a { padding: 8px 10px; font-size: 14px; }
  .search-mini input { width: 110px; }
  .site-header .bar { gap: 16px; }
}

@media (max-width: 1200px) {
  :root { --gutter: 24px; }
  .hero .container { gap: 64px; }
  /* Nav and search move into the drawer — together they need ~1190px. */
  .main-nav { display: none; }
  .header-actions .search-mini { display: none; }
  .nav-toggle { display: inline-flex; }
  .mobile-nav:not([hidden]) { display: block; }
}

/* With the filter rail taking 240px, four cards get too narrow to read on a
   tablet — drop to three before the layout itself changes. */
@media (max-width: 1100px) {
  .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1000px) {
  .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero .container { grid-template-columns: minmax(0, 1fr); gap: 36px; justify-items: start; }
  .hero-art { width: 100%; max-width: 420px; }
  .hero p { max-width: none; }
  .pdp { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .gallery .main { max-width: 460px; }
  .cols { grid-template-columns: minmax(0, 1fr); }
  .summary { position: static; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  :root { --header-h: 64px; }
  /* The 240px filter rail squeezes the cards past readable below this, so it
     becomes a collapsed disclosure above the results instead. */
  .shop-layout { grid-template-columns: minmax(0, 1fr); }
  .filters { position: static; padding: 14px 16px; }
  .filters > summary { display: flex; }
  .filters[open] > summary { margin-bottom: 6px; }
  .site-header .bar { gap: 12px; }
  .brand img { width: 46px; height: 52px; }
  .brand-text { font-size: 18px; letter-spacing: 2px; }
  .cart-link { padding: 9px 14px; }
}

@media (max-width: 760px) {
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .section { padding: 40px 0; }
  .section-head h2 { font-size: 24px; }
  .pdp h1 { font-size: 27px; }
  .hero .container { padding-top: 40px; padding-bottom: 40px; }
  .cat-card { flex-basis: calc(50% - 6px); min-width: 0; }
  /* 16px is the threshold below which iOS Safari zooms the page on focus. */
  .field-input, select.sort, .search-mini input, .qty input,
  input[type="text"], input[type="tel"], input[type="email"], textarea, select { font-size: 16px; }
  .qty button { width: 44px; height: 44px; }
  .qty input { height: 44px; }
}

@media (max-width: 560px) {
  .cart-item { grid-template-columns: 72px minmax(0, 1fr);
    grid-template-areas: "thumb info"
                         "thumb total"
                         "acts  acts"; }
  .cart-item > .thumb { align-self: start; }
  .cart-item > .ci-info { align-self: start; }
  .cart-item > .ci-total { text-align: left; align-self: start; }
  .cart-item > .ci-actions { margin-top: 12px; }
  .cart-item .thumb { width: 72px; height: 90px; }
  .trust { gap: 10px 16px; }
  .pdp .actions { flex-direction: column; align-items: stretch; }
  .pdp .actions .btn { width: 100%; }
  /* Phones get a bottom sheet instead of a corner card — it is the device the
     APK is actually for, so the offer earns the full width. */
  .app-promo { left: 10px; right: 10px; width: auto; max-width: none;
    bottom: calc(10px + env(safe-area-inset-bottom)); border-radius: 20px; }
  .app-promo-cta { align-self: stretch; }
}

@media (max-width: 420px) {
  :root { --gutter: 16px; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .foot-grid { grid-template-columns: minmax(0, 1fr); }
  .cat-strip { gap: 10px; }
  .product-body { padding: 12px 12px 14px; }
  .price { font-size: 15px; }
  .hero .cta .btn { flex: 1 1 100%; }
}

/* Very small phones (≤360px) — keep the brand from crowding out the cart. */
@media (max-width: 360px) {
  .brand-text { font-size: 15px; letter-spacing: 1px; }
  .brand img { width: 38px; height: 44px; }
  .cart-link span:not(.cart-badge) { display: none; }
}

/* ---- Graceful degradation for the liquid-glass layer ------------------ */
/* Browsers without backdrop-filter get solid surfaces so nothing turns to
   an unreadable transparent wash. */
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .site-header, .search-mini, .cat-card, .product-card, .filters, .panel,
  .gallery .main, .pagination a, .pagination span, .flash, .btn-ghost,
  select.sort, .field-input, .nav-toggle, .mobile-nav,
  .mobile-nav-links a, .app-promo { background: var(--card); }
  .chip, .cod-banner { background: var(--emerald-50); }
}

/* Respect users who ask the OS to reduce transparency. */
@media (prefers-reduced-transparency: reduce) {
  body::before { background: linear-gradient(180deg, #fbfaf8, var(--bg)); }
  .site-header, .flash, .mobile-nav { background: #fff; }
  .search-mini, .cat-card, .product-card, .filters, .panel, .gallery .main,
  .pagination a, .pagination span, .btn-ghost, select.sort, .field-input,
  .nav-toggle, .mobile-nav, .mobile-nav-links a, .app-promo { background: var(--card); }
  .chip, .cod-banner { background: var(--emerald-50); }
}
