/* ==========================================================================
   Quilva Asset Store — matches quilva.com (paper / deep green / peach,
   Fraunces + Inter + Libre Baskerville). Full-width, fluid layout.
   ========================================================================== */

:root {
  --green-deep: #2d5547;
  --green-darker: #234137;
  --green: #3a6856;
  --green-mid: #4f7a68;
  --green-soft: #8aa89a;
  --green-pale: #d4e0d8;

  --paper: #f4ebd9;
  --paper-warm: #ebe0c8;
  --paper-deep: #e0d2b5;
  --cream: #faf4e6;

  --peach: #e4b894;
  --peach-deep: #c89870;
  --coral: #d68a7a;
  --coral-deep: #b86a5a;
  --butter: #e8d68a;

  --ink: #2a241c;
  --ink-soft: #5a4f42;
  --ink-muted: #8a7e6e;

  --line: rgba(45, 85, 71, 0.15);
  --line-strong: rgba(45, 85, 71, 0.28);
  --shadow: rgba(45, 36, 28, 0.1);

  --nav-h: 115px;          /* updated by JS to the real nav height */
  --gutter: clamp(1rem, 2.4vw, 2.5rem);
  --radius: 10px;
  --cart-w: clamp(300px, 22vw, 380px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  font-size: 16px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
body > main { flex: 1; }
/* Paper grain, as on the main site */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.45;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.3 0 0 0 0 0.25 0 0 0 0 0.15 0 0 0 0 0.06 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
[hidden] { display: none !important; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--green-deep); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- NAV (mirrors quilva.com) ---------- */
nav.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 1rem var(--gutter);
  background: var(--green-deep);
  border-bottom: 1px solid rgba(0,0,0,0.12);
  box-shadow: 0 2px 12px rgba(45, 85, 71, 0.18);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  min-height: 83px;
}
.logo-wrap { display: flex; align-items: center; text-decoration: none; }
.logo-wrap img { height: 83px; width: auto; }
.wordmark {
  font-family: 'Fraunces', serif; font-style: italic; font-weight: 400;
  font-size: 2rem; color: var(--peach); letter-spacing: 0.02em;
}
nav.site-nav ul { list-style: none; display: flex; gap: 1.8rem; align-items: center; margin-left: auto; }
nav.site-nav ul a {
  color: rgba(244, 235, 217, 0.82);
  text-decoration: none;
  font-size: 0.93rem;
  font-weight: 500;
  transition: color 0.2s ease;
  position: relative;
}
nav.site-nav ul a:not(.cta-nav)::after {
  content: ""; position: absolute; bottom: -5px; left: 0;
  width: 0; height: 1.5px; background: var(--peach);
  transition: width 0.3s ease;
}
nav.site-nav ul a:not(.cta-nav):hover,
nav.site-nav ul a.active { color: var(--cream); }
nav.site-nav ul a:not(.cta-nav):hover::after,
nav.site-nav ul a.active::after { width: 100%; }
.cta-nav {
  background: var(--peach);
  color: var(--green-deep) !important;
  padding: 0.6rem 1.35rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.2s ease;
}
.cta-nav:hover { background: var(--cream); transform: translateY(-1px); }
.nav-actions { display: flex; align-items: center; gap: 0.4rem; }
.menu-toggle { display: none; background: none; border: none; cursor: pointer; padding: 0.5rem; color: var(--cream); }
.menu-toggle svg { width: 26px; height: 26px; display: block; }


/* ---------- STORE HERO ---------- */
.store-hero {
  margin-top: var(--nav-h);
  padding: 2.6rem var(--gutter) 2.2rem;
  background: var(--green-deep);
  color: var(--cream);
  position: relative;
  overflow: hidden;
  z-index: 2;
}
.store-hero::before {
  content: ""; position: absolute; inset: 0; opacity: 0.16; pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 400' fill='none' stroke='%23faf4e6' stroke-width='0.9' opacity='0.6'><path d='M50 80 Q150 60 230 100 T410 140 Q490 160 550 130 T700 110'/><path d='M780 50 Q860 80 920 130 Q980 180 1030 150 T1170 170'/><path d='M30 320 Q130 290 230 330 Q330 360 400 330 T560 350 Q640 360 700 340'/><path d='M860 280 Q940 260 1020 290 T1180 300'/><g stroke-dasharray='4 6' stroke='%23e4b894' stroke-width='1.3' opacity='0.7'><path d='M360 220 Q480 180 600 200 Q730 220 830 220'/></g><g stroke-width='0.7'><circle cx='1060' cy='200' r='30'/><circle cx='1060' cy='200' r='20'/><path d='M1060 170 L1063 200 L1060 230 L1057 200 Z' fill='%23faf4e6' opacity='0.55'/><path d='M1030 200 L1060 197 L1090 200 L1060 203 Z' fill='%23faf4e6' opacity='0.35'/></g></svg>");
  background-size: cover;
}
.store-hero-inner {
  position: relative; z-index: 1;
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 2rem; flex-wrap: wrap;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.16em;
  color: var(--peach);
  margin-bottom: 0.8rem;
  padding: 0.35rem 0.85rem;
  background: rgba(228, 184, 148, 0.12);
  border-radius: 100px;
  font-weight: 500;
}
.eyebrow::before {
  content: ""; width: 6px; height: 6px; background: var(--peach); border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(228, 184, 148, 0.2);
}
.store-hero h1 {
  font-family: 'Fraunces', serif; font-weight: 400;
  font-size: clamp(2rem, 4vw, 3.1rem);
  line-height: 1.05; letter-spacing: -0.02em;
  color: var(--cream);
}
.store-hero h1 .italic { font-style: italic; color: var(--peach); font-weight: 300; }
.store-hero p.tag {
  font-family: 'Libre Baskerville', serif; font-style: italic;
  color: rgba(244, 235, 217, 0.75);
  margin-top: 0.6rem; font-size: 1.02rem; max-width: 46ch;
}
.search-wrap { position: relative; width: min(420px, 100%); }
.search-wrap svg {
  position: absolute; left: 1rem; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: var(--green-soft); pointer-events: none;
}
.search-wrap input {
  width: 100%;
  padding: 0.85rem 2.6rem 0.85rem 2.8rem;
  border-radius: 100px;
  border: 1px solid rgba(244, 235, 217, 0.2);
  background: rgba(250, 244, 230, 0.96);
  color: var(--ink);
  font-size: 0.95rem;
  outline: none;
  transition: box-shadow 0.2s ease;
}
.search-wrap input:focus { box-shadow: 0 0 0 3px rgba(228, 184, 148, 0.55); }
.search-clear {
  position: absolute; right: 0.6rem; top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px; border-radius: 50%; border: none;
  background: var(--paper-warm); color: var(--ink-soft); cursor: pointer; font-size: 1rem; line-height: 1;
}

/* ---------- FILTER BAR (sticky) ---------- */
.filter-bar {
  position: sticky;
  top: var(--nav-h);
  z-index: 50;
  background: rgba(244, 235, 217, 0.92);
  backdrop-filter: saturate(1.2) blur(10px);
  -webkit-backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid var(--line);
  padding: 0.85rem var(--gutter);
}
.filter-inner { display: flex; align-items: center; gap: 1rem; }
.chips {
  display: flex; gap: 0.5rem; flex: 1; min-width: 0;
  overflow-x: auto; scrollbar-width: none;
  padding: 2px;          /* room for focus ring */
  mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 0.95rem;
  border-radius: 100px;
  border: 1px solid var(--line-strong);
  background: var(--cream);
  color: var(--ink-soft);
  font-size: 0.87rem; font-weight: 500;
  cursor: pointer; user-select: none;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.chip:hover { border-color: var(--green-mid); color: var(--ink); }
.chip:active { transform: scale(0.97); }
.chip:focus-visible { outline: 2px solid var(--peach-deep); outline-offset: 2px; }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--green)); }
.chip .n { font-size: 0.75rem; color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.chip[aria-pressed="true"] {
  background: var(--green-deep); border-color: var(--green-deep); color: var(--cream);
}
.chip[aria-pressed="true"] .n { color: var(--green-pale); }
.chip[aria-pressed="true"] .dot { box-shadow: 0 0 0 2px rgba(250,244,230,0.35); }
.chip .tick { display: none; width: 14px; height: 14px; }
.chip[aria-pressed="true"] .tick { display: block; }
.chip[aria-pressed="true"] .dot { display: none; }

.filter-right { display: flex; align-items: center; gap: 0.9rem; flex: none; }
.result-count { font-size: 0.85rem; color: var(--ink-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.select-wrap { position: relative; }
.select-wrap select {
  appearance: none; -webkit-appearance: none;
  padding: 0.5rem 2.1rem 0.5rem 0.9rem;
  border-radius: 8px; border: 1px solid var(--line-strong);
  background: var(--cream); font-size: 0.87rem; color: var(--ink-soft);
  cursor: pointer;
}
.select-wrap::after {
  content: ""; position: absolute; right: 0.85rem; top: 50%;
  width: 7px; height: 7px; border-right: 1.5px solid var(--ink-muted); border-bottom: 1.5px solid var(--ink-muted);
  transform: translateY(-70%) rotate(45deg); pointer-events: none;
}

/* ---------- PRODUCT GRID (masonry: cards keep their image ratio) ---------- */
.store-main { position: relative; z-index: 2; padding: 1.75rem var(--gutter) 3rem; }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr));
  column-gap: 1.4rem;
  grid-auto-rows: 4px;     /* masonry row unit — JS sets each card's span */
  align-items: start;
}
.grid.no-masonry { grid-auto-rows: auto; row-gap: 1.4rem; }

.card {
  --c: var(--green);
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 1px 2px var(--shadow);
  transition: box-shadow 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
  animation: cardIn 0.35s ease both;
}
.card:hover { box-shadow: 0 14px 34px -10px rgba(45, 36, 28, 0.22); transform: translateY(-3px); border-color: var(--line-strong); }
.card[hidden] { display: none; }
@keyframes cardIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.card-media {
  position: relative;
  display: block;
  background: var(--paper-warm);
  aspect-ratio: var(--ar, 375 / 300);
  overflow: hidden;
  cursor: zoom-in;
  border: none; padding: 0; width: 100%;
}
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.card:hover .card-media img { transform: scale(1.03); }
.card-media .ph {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: 'Fraunces', serif; font-style: italic; font-size: 1.1rem; color: var(--ink-muted);
}
.cat-pill {
  position: absolute; top: 0.75rem; left: 0.75rem;
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.28rem 0.65rem;
  border-radius: 100px;
  background: rgba(250, 244, 230, 0.93);
  color: var(--ink-soft);
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.02em;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.cat-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }

.card-body { padding: 1.05rem 1.15rem 1.15rem; display: flex; flex-direction: column; gap: 0.5rem; flex: 1; }
.card-title {
  font-family: 'Fraunces', serif; font-weight: 500; font-size: 1.22rem; line-height: 1.2;
  color: var(--ink); letter-spacing: -0.01em;
  background: none; border: none; text-align: left; cursor: pointer; padding: 0;
}
.card-title:hover { color: var(--green-deep); }
.card-desc {
  font-size: 0.9rem; color: var(--ink-soft); line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
/* Foot: price + "Download sample" on one line, full-width Add to cart below */
.card-foot {
  margin-top: auto; padding-top: 0.85rem;
  border-top: 1px dashed var(--line-strong);
  display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 0.7rem 0.6rem;
}
.card-foot .card-actions { display: contents; }
.card-foot .btn-ghost {
  justify-self: end; border: none; background: none; padding: 0.3rem 0;
  font-weight: 500; font-size: 0.82rem; color: var(--green-mid);
  text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px;
}
.card-foot .btn-ghost:hover { color: var(--coral-deep); text-decoration-color: currentColor; background: none; }
.card-foot [data-add] { grid-column: 1 / -1; width: 100%; padding: 0.7rem 1rem; }
.rm.linkish { display: inline; margin: 0; background: none; border: none; color: var(--ink-muted); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; font-size: inherit; }
.rm.linkish:hover { color: var(--coral-deep); }
.price {
  font-family: 'Fraunces', serif; font-weight: 500; font-size: 1.35rem; color: var(--green-deep);
  font-variant-numeric: lining-nums tabular-nums; letter-spacing: -0.01em;
}
.price.free { color: var(--coral-deep); font-style: italic; }
.card-actions { display: flex; gap: 0.45rem; margin-left: auto; }

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
  padding: 0.6rem 1rem;
  border-radius: 7px;
  border: 1px solid transparent;
  font-size: 0.86rem; font-weight: 600;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.1s ease;
}
.btn:active { transform: scale(0.97); }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn-primary { background: var(--green-deep); color: var(--cream); }
.btn-primary:hover { background: var(--green-darker); }
.btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--green-deep); }
.btn-ghost:hover { background: var(--paper-warm); border-color: var(--green-mid); }
.btn-peach { background: var(--peach); color: var(--green-deep); }
.btn-peach:hover { background: var(--peach-deep); color: var(--cream); }
.btn-lg { padding: 0.9rem 1.5rem; font-size: 0.97rem; border-radius: 8px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.5; pointer-events: none; }
.btn.in-cart { background: var(--peach); color: var(--green-deep); }
.btn.in-cart:hover { background: var(--peach-deep); color: var(--cream); }
.btn-icon { padding: 0.6rem; }

/* ---------- EMPTY STATE ---------- */
.empty {
  text-align: center; padding: 5rem 1rem; color: var(--ink-soft);
}
.empty h3 { font-family: 'Fraunces', serif; font-weight: 400; font-size: 1.6rem; color: var(--ink); margin-bottom: 0.4rem; }
.empty p { font-family: 'Libre Baskerville', serif; font-style: italic; margin-bottom: 1.3rem; }

/* ---------- STORE LAYOUT: products + always-visible cart ---------- */
.store-layout { position: relative; z-index: 2; }
.store-col { min-width: 0; }

/* The cart is pinned to the right edge of the window on every screen of the
   store page; the hero, products and footer sit beside it. */
body.page-store .store-hero,
body.page-store .store-layout,
body.page-store footer.site-footer { margin-right: var(--cart-w); }

.cart-panel {
  position: fixed;
  top: var(--nav-h); right: 0; bottom: 0;
  width: var(--cart-w);
  display: flex; flex-direction: column;
  background: var(--cream);
  border-left: 1px solid var(--line-strong);
  box-shadow: -10px 0 30px -18px rgba(45, 36, 28, 0.25);
  z-index: 60;
}
.cart-head {
  display: flex; align-items: center; gap: 0.7rem;
  width: 100%; border: none; text-align: left; cursor: default;
  padding: 1.15rem 1.4rem;
  background: var(--green-deep); color: var(--cream);
}
.cart-title { font-family: 'Fraunces', serif; font-weight: 400; font-size: 1.45rem; line-height: 1.1; }
.cart-title .italic { font-style: italic; color: var(--peach); font-weight: 300; }
.cart-count {
  margin-left: auto;
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.02em;
  padding: 0.25rem 0.65rem; border-radius: 100px;
  background: rgba(228, 184, 148, 0.16); color: var(--peach);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.cart-count.bump { animation: bump 0.45s cubic-bezier(.3,1.6,.5,1); }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.25); } 100% { transform: scale(1); } }
.cart-head .chev { display: none; width: 20px; height: 20px; transition: transform 0.25s ease; }

.cart-list { flex: 1; overflow-y: auto; padding: 0.25rem 1.4rem; overscroll-behavior: contain; }
.cart-item {
  display: grid; grid-template-columns: 58px 1fr auto; gap: 0.85rem; align-items: center;
  padding: 0.9rem 0; border-bottom: 1px solid var(--line);
}
.cart-item.new { animation: itemIn 0.9s ease both; }
@keyframes itemIn {
  0% { opacity: 0; transform: translateX(14px); background: rgba(228, 184, 148, 0.45); }
  35% { opacity: 1; transform: none; background: rgba(228, 184, 148, 0.45); }
  100% { background: transparent; }
}
.cart-item .thumb { width: 58px; height: 58px; border-radius: 7px; overflow: hidden; background: var(--paper-warm); border: 1px solid var(--line); }
.cart-item .thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-item .t { font-family: 'Fraunces', serif; font-weight: 500; font-size: 0.98rem; line-height: 1.25; }
.cart-item .c { font-size: 0.75rem; color: var(--ink-muted); margin-top: 0.15rem; }
.cart-item .p { font-family: 'Fraunces', serif; font-weight: 500; color: var(--green-deep); text-align: right; white-space: nowrap; }
.cart-item .rm {
  display: block; margin: 0.2rem 0 0 auto;
  background: none; border: none; color: var(--ink-muted); font-size: 0.74rem; cursor: pointer;
  text-decoration: underline; text-underline-offset: 2px;
}
.cart-item .rm:hover { color: var(--coral-deep); }
.cart-empty { text-align: center; padding: 2.8rem 0.5rem; color: var(--ink-soft); }
.cart-empty .glyph { font-family: 'Fraunces', serif; font-size: 2.4rem; color: var(--peach-deep); line-height: 1; margin-bottom: 0.6rem; }
.cart-empty p { font-family: 'Libre Baskerville', serif; font-style: italic; font-size: 0.95rem; }
.cart-empty small { display: block; margin-top: 0.4rem; font-size: 0.8rem; color: var(--ink-muted); }
.cart-foot { padding: 1.1rem 1.4rem 1.3rem; border-top: 1px solid var(--line); background: var(--paper); }
.totals { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 0.2rem; }
.totals .lbl { font-size: 0.9rem; color: var(--ink-soft); }
.totals .val { font-family: 'Fraunces', serif; font-weight: 500; font-size: 1.6rem; color: var(--green-deep); font-variant-numeric: lining-nums tabular-nums; }
.cart-foot .note { font-size: 0.76rem; color: var(--ink-muted); margin-bottom: 0.9rem; }
#checkoutBtn[aria-disabled="true"] { opacity: 0.45; pointer-events: none; }

/* ---------- OVERLAY: quick view ---------- */
.scrim {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(35, 65, 55, 0.42);
  backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease;
}
.scrim.open { opacity: 1; pointer-events: auto; }

/* Quick view */
.modal {
  position: fixed; inset: 0; z-index: 220;
  display: grid; place-items: center; padding: var(--gutter);
  pointer-events: none;
}
.modal-card {
  width: min(980px, 100%); max-height: calc(100vh - 2 * var(--gutter));
  background: var(--cream); border-radius: 14px; overflow: hidden;
  box-shadow: 0 30px 80px rgba(20, 30, 25, 0.35);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  opacity: 0; transform: translateY(14px) scale(0.98);
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.modal.open { pointer-events: auto; }
.modal.open .modal-card { opacity: 1; transform: none; }
.modal-media { background: var(--paper-warm); display: grid; place-items: center; padding: 1.5rem; overflow: auto; }
.modal-media img {
  max-height: calc(100vh - 2 * var(--gutter) - 3rem);
  width: auto; max-width: 100%;
  border-radius: 6px; box-shadow: 0 10px 30px rgba(45, 36, 28, 0.18);
}
.modal-info { padding: 2rem 2rem 1.75rem; display: flex; flex-direction: column; gap: 0.9rem; overflow-y: auto; position: relative; }
.modal-info .cat-pill { position: static; align-self: flex-start; background: var(--paper); box-shadow: none; border: 1px solid var(--line); }
.modal-info h2 { font-family: 'Fraunces', serif; font-weight: 400; font-size: clamp(1.6rem, 2.6vw, 2.2rem); line-height: 1.1; letter-spacing: -0.015em; padding-right: 2.5rem; }
.modal-info .desc { color: var(--ink-soft); white-space: pre-line; font-size: 0.97rem; }
.modal-info .meta { font-size: 0.82rem; color: var(--ink-muted); }
.modal-info .price { font-size: 1.9rem; }
.modal-info .actions { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: auto; padding-top: 1rem; border-top: 1px dashed var(--line-strong); align-items: center; }
.modal-info .actions .price { margin-right: auto; }
.modal-close {
  position: absolute; top: 1rem; right: 1rem;
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line-strong);
  background: var(--cream); color: var(--ink-soft); cursor: pointer; display: grid; place-items: center;
}
.modal-close:hover { background: var(--paper-warm); }
.modal-close svg { width: 18px; height: 18px; }

/* ---------- SIMPLE PAGES (checkout, downloads) ---------- */
.page-hero { margin-top: var(--nav-h); padding: 2.2rem var(--gutter) 2rem; }
.page-wrap { position: relative; z-index: 2; padding: 0 var(--gutter) 4rem; }
.page-narrow { max-width: 920px; margin: 0 auto; }
.panel {
  background: var(--cream); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 4px 16px var(--shadow);
  padding: clamp(1.25rem, 3vw, 2rem);
}
.panel + .panel { margin-top: 1.25rem; }
.panel h2 { font-family: 'Fraunces', serif; font-weight: 400; font-size: 1.45rem; margin-bottom: 1rem; }
.checkout-grid > .panel + .panel { margin-top: 0; }
.checkout-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.line-item { display: grid; grid-template-columns: 56px 1fr auto; gap: 0.9rem; align-items: center; padding: 0.8rem 0; border-bottom: 1px solid var(--line); }
.line-item:last-child { border-bottom: none; }
.line-item .thumb { width: 56px; height: 56px; border-radius: 6px; overflow: hidden; background: var(--paper-warm); border: 1px solid var(--line); }
.line-item .thumb img { width: 100%; height: 100%; object-fit: cover; }
.line-item .t { font-family: 'Fraunces', serif; font-weight: 500; font-size: 1.02rem; line-height: 1.25; }
.line-item .c { font-size: 0.78rem; color: var(--ink-muted); }
.line-item .p { font-family: 'Fraunces', serif; font-weight: 500; color: var(--green-deep); }
.field { margin-bottom: 1rem; }
.field label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--ink-soft); margin-bottom: 0.35rem; }
.field input {
  width: 100%; padding: 0.75rem 0.9rem; border: 1px solid var(--line-strong); border-radius: 8px;
  background: #fffdf8; font-size: 0.95rem; outline: none;
}
.field input:focus { border-color: var(--green-mid); box-shadow: 0 0 0 3px rgba(79, 122, 104, 0.15); }
.muted-count { font-family: 'Inter', sans-serif; font-size: 0.9rem; color: var(--ink-muted); }
.field label .hint { font-weight: 400; color: var(--ink-muted); }
.field select {
  width: 100%; padding: 0.75rem 2.2rem 0.75rem 0.9rem; border: 1px solid var(--line-strong); border-radius: 8px;
  background: #fffdf8 url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232d5547' stroke-width='2'><path d='M6 9l6 6 6-6'/></svg>") no-repeat right 0.8rem center / 16px;
  appearance: none; -webkit-appearance: none; font-size: 0.95rem; outline: none; cursor: pointer;
}
.field select:focus { border-color: var(--green-mid); box-shadow: 0 0 0 3px rgba(79, 122, 104, 0.15); }
.field-row { display: grid; grid-template-columns: 1fr 1.3fr; gap: 0.8rem; }
.pay-h { font-family: 'Fraunces', serif; font-weight: 500; font-size: 1.1rem; margin: 1.3rem 0 0.7rem; padding-top: 1.1rem; border-top: 1px dashed var(--line-strong); }
#card-container {
  background: #fffdf8; border: 1px solid var(--line-strong); border-radius: 8px;
  padding: 0.9rem 0.9rem 0.2rem; min-height: 64px; margin-bottom: 1rem;
}
#card-container:focus-within { border-color: var(--green-mid); box-shadow: 0 0 0 3px rgba(79, 122, 104, 0.15); }
.card-loading { display: block; font-size: 0.85rem; color: var(--ink-muted); padding: 0.4rem 0 0.9rem; }
#payBtn { margin-top: 0.4rem; }
#payBtn.is-busy { opacity: 0.7; cursor: progress; }
.msg { display: flex; align-items: center; gap: 0.6rem; padding: 0.75rem 0.95rem; border-radius: 8px; font-size: 0.88rem; margin: 0.4rem 0 0.8rem; line-height: 1.45; }
.msg.error { background: rgba(214, 138, 122, 0.15); color: var(--coral-deep); border-left: 3px solid var(--coral); }
.msg.status { background: var(--green-pale); color: var(--green-deep); border-left: 3px solid var(--green-deep); font-weight: 500; }
.spinner { width: 15px; height: 15px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin 0.8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.squareimg { display: block; margin: 1.1rem auto 0; max-width: 200px; height: auto; opacity: 0.7; }
.trust-row { display: flex; justify-content: center; flex-wrap: wrap; gap: 0.5rem 1.3rem; margin-top: 1.1rem; font-size: 0.78rem; color: var(--ink-soft); }
.trust-row span { display: inline-flex; align-items: center; gap: 0.35rem; }
.trust-row svg { width: 14px; height: 14px; color: var(--green-deep); }
.test-banner {
  display: flex; gap: 0.7rem; align-items: flex-start;
  background: rgba(232, 214, 138, 0.35); border: 1px solid rgba(200, 154, 58, 0.35);
  color: var(--ink-soft); border-radius: 8px; padding: 0.75rem 0.9rem; font-size: 0.83rem; margin-bottom: 1rem;
}
.test-banner strong { color: var(--ink); }
.summary-row { display: flex; justify-content: space-between; font-size: 0.92rem; color: var(--ink-soft); padding: 0.3rem 0; }
.summary-row.total { font-family: 'Fraunces', serif; font-size: 1.4rem; color: var(--green-deep); border-top: 1px dashed var(--line-strong); margin-top: 0.5rem; padding-top: 0.8rem; }
.alert { padding: 0.8rem 1rem; border-radius: 8px; margin-bottom: 1rem; font-size: 0.9rem; border-left: 3px solid var(--coral-deep); background: rgba(214, 138, 122, 0.14); }

/* Downloads page */
.dl-product { display: grid; grid-template-columns: 110px 1fr; gap: 1.25rem; padding: 1.25rem 0; border-bottom: 1px solid var(--line); }
.dl-product:last-child { border-bottom: none; padding-bottom: 0.25rem; }
.dl-product:first-child { padding-top: 0.25rem; }
.dl-product .thumb { width: 110px; border-radius: 8px; overflow: hidden; background: var(--paper-warm); border: 1px solid var(--line); aspect-ratio: var(--ar, 375/300); }
.dl-product .thumb img { width: 100%; height: 100%; object-fit: cover; }
.dl-product h3 { font-family: 'Fraunces', serif; font-weight: 500; font-size: 1.2rem; line-height: 1.2; }
.dl-product .c { font-size: 0.8rem; color: var(--ink-muted); margin-bottom: 0.7rem; }
.dl-files { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.dl-file {
  display: flex; align-items: center; gap: 0.85rem;
  padding: 0.65rem 0.7rem 0.65rem 0.9rem;
  background: var(--paper); border: 1px solid var(--line); border-radius: 8px;
}
.dl-file .ico { width: 34px; height: 34px; border-radius: 7px; background: var(--green-pale); color: var(--green-deep); display: grid; place-items: center; flex: none; }
.dl-file .ico svg { width: 17px; height: 17px; }
.dl-file .nm { flex: 1; min-width: 0; }
.dl-file .nm b { display: block; font-weight: 600; font-size: 0.9rem; overflow-wrap: anywhere; }
.dl-file .nm span { font-size: 0.76rem; color: var(--ink-muted); }
.dl-file.done .ico { background: var(--peach); }
.success-mark {
  width: 58px; height: 58px; border-radius: 50%;
  background: var(--peach); color: var(--green-deep);
  display: grid; place-items: center; margin-bottom: 1rem;
  box-shadow: 0 0 0 8px rgba(228, 184, 148, 0.2);
}
.success-mark svg { width: 28px; height: 28px; }
.order-meta { display: flex; flex-wrap: wrap; gap: 0.4rem 1.6rem; font-size: 0.85rem; color: rgba(244, 235, 217, 0.75); margin-top: 0.9rem; }
.order-meta b { color: var(--cream); font-weight: 500; }

/* ---------- FOOTER (mirrors quilva.com) ---------- */
footer.site-footer {
  background: var(--green-darker);
  color: rgba(244, 235, 217, 0.7);
  padding: 3rem var(--gutter) 2rem;
  position: relative; z-index: 2;
}
.footer-grid {
  display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 3rem;
  padding-bottom: 2.25rem; border-bottom: 1px solid rgba(244, 235, 217, 0.1);
}
.footer-brand img { height: 65px; width: auto; margin-bottom: 0.85rem; }
.footer-brand p { font-size: 0.88rem; line-height: 1.6; max-width: 340px; }
.footer-col h5 { color: var(--cream); font-family: 'Fraunces', serif; font-weight: 500; font-size: 1rem; margin-bottom: 0.85rem; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 0.45rem; }
.footer-col a { color: rgba(244, 235, 217, 0.7); text-decoration: none; font-size: 0.88rem; transition: color 0.2s ease; }
.footer-col a:hover { color: var(--peach); }
.footer-bottom { padding-top: 1.5rem; display: flex; justify-content: space-between; align-items: center; font-size: 0.82rem; flex-wrap: wrap; gap: 1rem; }
.footer-bottom .mark { font-family: 'Libre Baskerville', serif; font-style: italic; color: var(--peach); }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1100px) {
  nav.site-nav ul { gap: 1.3rem; }
}
@media (max-width: 960px) {
  nav.site-nav { padding: 0.75rem var(--gutter); }
  .nav-inner { min-height: 56px; }
  .logo-wrap img { height: 50px; }
  nav.site-nav ul {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch;
    background: var(--green-deep);
    padding: 1.25rem var(--gutter);
    border-bottom: 1px solid rgba(0,0,0,0.12);
    gap: 0.6rem;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
  }
  nav.site-nav ul.open { display: flex; }
  nav.site-nav ul a { display: block; padding: 0.5rem 0; }
  nav.site-nav ul a::after { display: none; }
  nav.site-nav .cta-nav { text-align: center; }
  .menu-toggle { display: block; }
  /* Cart becomes a bar pinned to the bottom of the screen; tap to expand */
  body.page-store .store-hero,
  body.page-store .store-layout,
  body.page-store footer.site-footer { margin-right: 0; }
  .cart-panel {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto;
    width: auto; height: auto; max-height: 80vh;
    border-left: none; border-top: 1px solid var(--line-strong);
    border-radius: 14px 14px 0 0; overflow: hidden;
    box-shadow: 0 -12px 34px rgba(35, 30, 20, 0.22);
    z-index: 90;
  }
  .cart-panel.is-empty { display: none; }
  body.has-cart { padding-bottom: 132px; }
  .cart-head { cursor: pointer; padding: 0.75rem 1.1rem; }
  .cart-title { font-size: 1.15rem; }
  .cart-head .chev { display: block; }
  .cart-list { display: none; max-height: 48vh; padding: 0 1.1rem; }
  .cart-panel.open .cart-list { display: block; }
  .cart-panel.open .chev { transform: rotate(180deg); }
  .cart-foot { display: flex; align-items: center; gap: 1rem; padding: 0.7rem 1.1rem calc(0.8rem + env(safe-area-inset-bottom)); }
  .cart-foot .note { display: none; }
  .totals { flex-direction: column; align-items: flex-start; margin: 0; }
  .totals .lbl { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; }
  .totals .val { font-size: 1.35rem; line-height: 1.1; }
  .cart-foot #checkoutBtn { flex: 1; width: auto; }

  .modal-card { grid-template-columns: 1fr; overflow-y: auto; }
  .modal-media { padding: 1rem; }
  .modal-media img { max-height: 55vh; }
  .modal-info { overflow: visible; padding: 1.5rem; }
  .checkout-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
}
@media (max-width: 640px) {
  .store-hero { padding-top: 1.8rem; padding-bottom: 1.6rem; }
  .store-hero p.tag { font-size: 0.95rem; }
  .search-wrap { width: 100%; }
  .filter-bar { padding-top: 0.65rem; padding-bottom: 0.65rem; }
  .filter-inner { gap: 0.5rem; }
  .result-count { display: none; }
  .chip { padding: 0.45rem 0.8rem; font-size: 0.84rem; }
  .select-wrap select { max-width: 118px; padding: 0.45rem 1.9rem 0.45rem 0.7rem; font-size: 0.84rem; }
  .dl-product { grid-template-columns: 72px 1fr; gap: 0.9rem; }
  .dl-product .thumb { width: 72px; }
  .dl-file { flex-wrap: wrap; }
  .dl-file .btn { width: 100%; }
  .footer-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
