/* ============================================================
   Home Crafts by Karin — home sewing shop
   ============================================================ */

:root {
  --linen: #f5efe6;
  --linen-2: #efe6d8;
  --ink: #3a2e2a;
  --ink-soft: #6b5a52;
  /* --rose is decorative only (borders, swatches, hearts). Text uses --rose-dark. */
  --rose: #c97a7a;
  --rose-dark: #9b5353;   /* 4.89:1 on linen, 4.52:1 on linen-2, 5.50:1 on card */
  --rose-deep: #8f4c4c;   /* hover states */
  --rose-btn: #a05757;    /* primary button fill — 4.60:1 with --linen text */
  --sage: #8a9a7a;
  --sage-dark: #6f7f60;
  --sage-text: #5e6e54;   /* 4.79:1 with --linen text */
  --gold: #d4a85a;
  --gold-text: #8a6323;   /* 4.72:1 on linen, 5.31:1 on card */
  --danger: #a03030;      /* 6.98:1 on card */
  --thread: #bfae9a;
  --thread-strong: #9c8b76;
  --line: rgba(58, 46, 42, .14);

  --font-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-body: "Karla", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;

  --radius: 16px;
  --wrap: 1180px;
  --shadow: 0 10px 30px rgba(58, 46, 42, .10);
  --shadow-lg: 0 22px 50px rgba(58, 46, 42, .16);
  --ease: cubic-bezier(.22, .8, .3, 1);
}

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

html { scroll-behavior: smooth; scroll-padding-top: 92px; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--linen);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.08; margin: 0 0 .5em; }
h1 { font-size: clamp(2.6rem, 6vw, 4.6rem); font-weight: 600; }
h1 em, h2 em { font-style: italic; font-weight: 500; color: var(--rose); }
h2 { font-size: clamp(1.9rem, 3.6vw, 2.9rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }
a { color: var(--rose-dark); text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { color: var(--rose-deep); }

:focus-visible { outline: 3px solid var(--rose); outline-offset: 3px; border-radius: 4px; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: clamp(1.2rem, 4vw, 2rem); }

.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; }

.skip-link { position: absolute; left: 1rem; top: -60px; z-index: 200; background: var(--ink); color: var(--linen); padding: .6rem 1.1rem; border-radius: 0 0 10px 10px; transition: top .2s var(--ease); }
.skip-link:focus { top: 0; }

/* ---------- Type helpers ---------- */
.eyebrow { font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .16em; color: var(--rose-dark); margin-bottom: .9rem; }
.eyebrow.light { color: #f4d4d4; }
.lede { font-size: clamp(1.05rem, 1.6vw, 1.22rem); color: var(--ink-soft); max-width: 36em; }
.section-head { max-width: 640px; margin-bottom: 2.4rem; }
.section-sub { color: var(--ink-soft); }
.muted { color: var(--ink-soft); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font: inherit; font-weight: 600; font-size: .95rem;
  padding: .72rem 1.5rem; border-radius: 999px; border: 1.6px solid transparent;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform .18s var(--ease), background-color .18s var(--ease), box-shadow .18s var(--ease), color .18s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--rose-btn); color: var(--linen); box-shadow: 0 6px 16px rgba(160, 87, 87, .32); }
.btn-primary:hover { background: var(--rose-deep); color: var(--linen); }
.btn-primary:disabled { background: var(--thread); color: var(--ink-soft); box-shadow: none; cursor: not-allowed; transform: none; }
.btn-ghost { background: transparent; color: var(--ink); border-color: rgba(58, 46, 42, .3); }
.btn-ghost:hover { background: rgba(58, 46, 42, .05); color: var(--ink); }
.btn-cream { background: var(--linen); color: var(--rose-dark); }
.btn-cream:hover { background: #fff; color: var(--rose-deep); }
.btn-lg { padding: .9rem 1.9rem; font-size: 1.02rem; }
.btn-sm { padding: .5rem .9rem; font-size: .85rem; min-height: 44px; }
.btn-block { width: 100%; }
.btn.added { background: var(--sage-text); border-color: var(--sage-text); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(245, 239, 230, .85);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s var(--ease), box-shadow .25s var(--ease);
}
.site-header.scrolled { border-bottom-color: var(--line); box-shadow: 0 4px 20px rgba(58, 46, 42, .06); }

.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; min-height: 72px; }

.brand { display: inline-flex; align-items: center; gap: .65rem; text-decoration: none; color: var(--ink); }
.brand-mark { width: 40px; height: 40px; flex: none; }
.brand-text { font-family: var(--font-display); font-weight: 600; font-size: 1.3rem; letter-spacing: -.01em; }
.brand-text em { font-style: italic; color: var(--rose); }

.site-nav { display: flex; align-items: center; gap: 1.6rem; }
.site-nav a { color: var(--ink); text-decoration: none; font-weight: 600; font-size: .95rem; }
.site-nav a:not(.btn):hover { color: var(--rose); }
.site-nav .nav-cta { color: var(--linen); }

.header-actions { display: flex; align-items: center; gap: .8rem; }

.cart-btn {
  position: relative; width: 44px; height: 44px; border-radius: 50%;
  border: 1.6px solid var(--line); background: #fffdf8; color: var(--ink);
  display: grid; place-items: center; cursor: pointer;
  transition: transform .18s var(--ease), border-color .18s var(--ease);
}
.cart-btn:hover { transform: translateY(-2px); border-color: var(--rose); color: var(--rose); }
.cart-btn svg { width: 20px; height: 20px; }
.cart-count {
  position: absolute; top: -4px; right: -4px;
  min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 999px; background: var(--rose); color: var(--linen);
  font-size: .72rem; font-weight: 700; display: grid; place-items: center;
  border: 2px solid var(--linen);
}
.cart-count.bump { animation: bump .35s var(--ease); }
@keyframes bump { 0% { transform: scale(1); } 50% { transform: scale(1.35); } 100% { transform: scale(1); } }

.nav-toggle {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 44px; height: 44px; padding: 10px;
  background: transparent; border: 1.6px solid var(--line); border-radius: 12px; cursor: pointer;
}
.nav-toggle span { display: block; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .25s var(--ease), opacity .2s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero { position: relative; padding: clamp(3rem, 7vw, 5.5rem) 0; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; top: -160px; left: -120px; width: 480px; height: 480px;
  background: radial-gradient(circle, rgba(201, 122, 122, .18), transparent 70%); border-radius: 50%;
  pointer-events: none;
}
.hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .9rem; margin: 1.8rem 0 1.4rem; }
.trust-line { display: flex; align-items: center; gap: .6rem; font-size: .9rem; color: var(--ink-soft); }
.trust-line .heart { color: var(--rose); font-size: 1.1rem; }

.swatch-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.swatch {
  margin: 0; border-radius: 16px; overflow: hidden; position: relative;
  border: 6px solid var(--linen); box-shadow: var(--shadow);
  transform: rotate(-1.5deg); transition: transform .3s var(--ease);
}
.swatch:nth-child(2) { transform: rotate(2deg); }
.swatch:nth-child(3) { transform: rotate(1.5deg); }
.swatch:nth-child(4) { transform: rotate(-2deg); }
.swatch:hover { transform: rotate(0) scale(1.03); z-index: 2; }
.swatch svg { width: 100%; height: auto; aspect-ratio: 1 / 1; }
.swatch-label {
  position: absolute; bottom: 8px; left: 8px;
  background: rgba(255, 253, 248, .92); color: var(--ink);
  font-size: .75rem; font-weight: 700; padding: .25rem .6rem;
  border-radius: 999px; border: 1px dashed var(--thread);
}
.swatch-note { margin-top: 1.1rem; font-size: .85rem; color: var(--ink-soft); font-style: italic; text-align: center; }

/* ---------- Pillars ---------- */
.pillars { padding: clamp(3rem, 7vw, 5rem) 0; background: var(--linen-2); }
.pillar-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.pillar-grid article { text-align: center; padding: 1.6rem 1rem; }
.pillar-icon { font-size: 2.2rem; margin-bottom: .7rem; }
.pillar-grid h3 { margin-bottom: .4rem; }
.pillar-grid p { color: var(--ink-soft); font-size: .95rem; margin: 0; }

/* ---------- Shop ---------- */
.shop { padding: clamp(3.5rem, 8vw, 6.5rem) 0; }
.shop-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem 1.5rem; flex-wrap: wrap; margin-bottom: .9rem; }
.shop-toolbar-controls { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; margin-left: auto; }
.shop-search { position: relative; display: flex; align-items: center; }
.shop-search svg { position: absolute; left: .8rem; width: 18px; height: 18px; color: var(--ink-soft); pointer-events: none; }
.shop-search input { padding-left: 2.4rem; min-height: 44px; min-width: 220px; }
.shop-status { font-size: .86rem; color: var(--ink-soft); margin: 0 0 1.4rem; }
.filters { display: flex; flex-wrap: wrap; gap: .6rem; }
.filter {
  font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer;
  padding: .5rem 1.15rem; min-height: 44px; border-radius: 999px;
  border: 1.5px dashed var(--thread-strong); background: transparent; color: var(--ink-soft);
  transition: all .18s var(--ease);
}
.filter:hover { border-color: var(--rose-dark); color: var(--rose-dark); border-style: solid; }
.filter.is-active { background: var(--ink); border-color: var(--ink); border-style: solid; color: var(--linen); }

.sort-wrap { display: flex; align-items: center; gap: .5rem; }
.sort-wrap label { margin: 0; white-space: nowrap; font-weight: 600; font-size: .86rem; }
.sort-wrap select { width: auto; min-width: 190px; min-height: 44px; }

.product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }

.product-card {
  background: #fffdf8; border: 1px solid rgba(58, 46, 42, .1); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.product-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.product-art { aspect-ratio: 1 / 1; overflow: hidden; position: relative; background: var(--linen-2); }
.product-art-link { display: block; text-decoration: none; color: inherit; }
.product-name a { color: inherit; text-decoration: none; }
.product-name a:hover { color: var(--rose); }
.product-art svg { width: 100%; height: 100%; transition: transform .4s var(--ease); }
.product-card:hover .product-art svg { transform: scale(1.05); }
.product-badge {
  position: absolute; top: 10px; left: 10px;
  background: var(--gold); color: var(--ink); font-size: .7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .1em;
  padding: .25rem .6rem; border-radius: 999px;
}
.product-badge.badge-out { background: #a04b2d; color: #fff; left: auto; right: 10px; }
.product-badge.badge-low { background: var(--gold); color: var(--ink); left: auto; right: 10px; }
.product-body { padding: 1.1rem 1.2rem 1.2rem; display: flex; flex-direction: column; flex: 1; }
.product-name { font-family: var(--font-display); font-size: 1.18rem; font-weight: 600; margin: 0 0 .25rem; }
.product-meta { font-size: .82rem; color: var(--ink-soft); margin-bottom: .6rem; }
.product-foot { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-top: auto; padding-top: .7rem; border-top: 1px dashed var(--thread-strong); }
.product-price { font-family: var(--font-display); font-size: 1.25rem; font-weight: 700; color: var(--rose-dark); }
.stock-chip { font-size: .74rem; font-weight: 700; padding: .18rem .55rem; border-radius: 999px; white-space: nowrap; }
.stock-chip-low { background: rgba(212, 168, 90, .3); color: #6b4d13; }
.stock-chip-out { background: rgba(58, 46, 42, .1); color: var(--ink-soft); }
.product-actions { display: flex; align-items: center; gap: .5rem; margin-top: .75rem; }
.product-actions .btn { flex: 1; }
.icon-btn {
  width: 44px; height: 44px; flex: none; border-radius: 50%;
  border: 1.5px solid var(--line); background: #fffdf8; color: var(--ink);
  display: grid; place-items: center; cursor: pointer; font-size: .9rem;
  transition: all .18s var(--ease);
}
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:hover { background: var(--rose-btn); border-color: var(--rose-btn); color: var(--linen); }
.icon-btn.added { background: var(--sage-text); border-color: var(--sage-text); color: var(--linen); }

.filter-empty { margin-top: 1.8rem; color: var(--ink-soft); font-style: italic; }
.link-btn { background: none; border: none; padding: 0; font: inherit; font-style: inherit; color: var(--rose-dark); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link-btn:hover { color: var(--rose-deep); }

/* Catalog could not be loaded */
.catalog-error {
  grid-column: 1 / -1; text-align: center; padding: 2.5rem 1rem;
  background: #fffdf8; border: 1px dashed var(--thread-strong); border-radius: var(--radius);
}
.catalog-error p { margin: 0 0 .5rem; }
.catalog-error .btn { margin-top: .9rem; }

/* ---------- Product detail page ---------- */
.pd-page { padding-top: 1.5rem; padding-bottom: 4rem; }
.breadcrumbs { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; font-size: .86rem; color: var(--ink-soft); margin-bottom: 1.4rem; }
.breadcrumbs a { color: var(--rose-dark); text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }
.breadcrumbs li { display: flex; align-items: center; gap: .45rem; }
.breadcrumbs ol { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; }
.breadcrumbs li + li::before { content: "/"; color: var(--thread-strong); }
.pd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.pd-art { border-radius: 20px; overflow: hidden; background: var(--linen-2); border: 1px solid var(--line); }
.pd-art img, .pd-art svg { width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; }
.pd-price { font-family: var(--font-display); font-size: 2rem; font-weight: 700; color: var(--rose-dark); margin: .4rem 0 .8rem; }
.pd-meta { color: var(--ink-soft); font-size: .9rem; font-style: italic; }
.pd-desc { color: var(--ink-soft); margin: 1rem 0; }
.pd-stock { margin: .4rem 0 1rem; }
.pd-actions { display: flex; gap: .8rem; flex-wrap: wrap; align-items: center; margin-top: 1.2rem; }
.qty-wrap { display: flex; align-items: center; gap: .4rem; }
.qty-wrap input { width: 68px; text-align: center; min-height: 48px; }
.pd-buy { margin-left: auto; }
.pd-trust { list-style: none; margin: 1.6rem 0 0; padding: 1.2rem 0 0; border-top: 1px dashed var(--thread-strong); display: grid; gap: .5rem; }
.pd-trust li { display: flex; gap: .6rem; align-items: flex-start; font-size: .9rem; color: var(--ink-soft); }
.pd-trust li::before { content: "♥"; color: var(--rose-dark); font-size: .8rem; line-height: 1.6; }
.pd-section { margin-top: 2.6rem; }
.pd-section h2 { font-size: 1.5rem; margin-bottom: .6rem; }
.pd-related { margin-top: 3.5rem; padding-top: 2.5rem; border-top: 1px dashed var(--thread-strong); }
.pd-related h2 { font-size: 1.6rem; margin-bottom: 1.4rem; }

/* ---------- Custom orders ---------- */
.custom { padding: clamp(3.5rem, 8vw, 6.5rem) 0; background: var(--linen-2); }
.custom-grid { display: grid; grid-template-columns: 1fr 1.15fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.custom-list { list-style: none; padding: 0; margin: 1.6rem 0 0; display: flex; flex-direction: column; gap: .5rem; }
.custom-list li { padding-left: 1.5rem; position: relative; color: var(--ink-soft); font-size: .95rem; }
.custom-list li::before { content: "♥"; position: absolute; left: 0; top: 0; color: var(--rose); font-size: .85rem; }
.custom-form {
  background: #fffdf8; border: 1px solid rgba(58, 46, 42, .1);
  border-radius: var(--radius); padding: 1.9rem; box-shadow: var(--shadow);
}
.custom-form textarea {
  font: inherit; width: 100%; padding: .72rem .95rem;
  border: 1.5px solid rgba(58, 46, 42, .22); border-radius: 12px;
  background: #fffdf8; color: var(--ink); resize: vertical;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.custom-form textarea:focus { outline: none; border-color: var(--rose); box-shadow: 0 0 0 3px rgba(201, 122, 122, .18); }

/* ---------- Reviews ---------- */
.reviews { padding: clamp(3.5rem, 8vw, 6.5rem) 0; }
.review-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.6rem; }
.review {
  background: #fffdf8; border: 1px solid rgba(58, 46, 42, .1); border-radius: var(--radius);
  padding: 1.8rem; box-shadow: var(--shadow);
}
.stars { color: var(--gold-text); font-size: 1.05rem; letter-spacing: .15em; margin-bottom: .8rem; }
.review p { font-family: var(--font-display); font-size: 1.06rem; line-height: 1.5; margin-bottom: 1rem; }
.review footer { font-size: .86rem; color: var(--ink-soft); display: flex; flex-direction: column; gap: .15rem; }
.review footer span { font-size: .8rem; }
.review-verified { display: inline-flex; align-items: center; gap: .3rem; color: var(--sage-text); font-weight: 700; font-size: .74rem !important; margin-top: .3rem; }
.review-verified::before { content: "✓"; font-weight: 700; }

/* ---------- FAQ ---------- */
.faq { padding: clamp(3.5rem, 8vw, 6.5rem) 0; background: var(--linen-2); }
.faq-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.accordion { display: flex; flex-direction: column; gap: .7rem; }
.accordion details {
  background: #fffdf8; border: 1px solid rgba(58, 46, 42, .1);
  border-left: 3px dashed var(--thread-strong); border-radius: 12px;
  padding: 1rem 1.3rem; transition: border-left-color .18s var(--ease);
}
.accordion details[open] { border-left-color: var(--rose-dark); border-left-style: solid; }
.accordion summary {
  cursor: pointer; font-weight: 700; font-size: .98rem; list-style: none;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary::after { content: "+"; font-size: 1.3rem; color: var(--rose); transition: transform .2s var(--ease); }
.accordion details[open] summary::after { transform: rotate(45deg); }
.accordion details p { color: var(--ink-soft); font-size: .93rem; margin: .8rem 0 0; }

/* ---------- Newsletter band ---------- */
.newsletter-band { background: var(--rose-btn); color: var(--linen); padding: clamp(3rem, 6vw, 4.5rem) 0; }
.newsletter-inner { display: flex; align-items: center; justify-content: space-between; gap: 2.5rem; flex-wrap: wrap; }
.newsletter-inner h2 { color: var(--linen); margin-bottom: .4em; }
.newsletter-inner .eyebrow { color: #f7dede; }
.newsletter-inner p:not(.eyebrow) { max-width: 44ch; opacity: .95; margin: 0; }
.nl-form { display: flex; gap: .7rem; flex: 1 1 320px; max-width: 460px; flex-wrap: wrap; }
.nl-form input { flex: 1 1 200px; min-height: 48px; }
.nl-form .btn { min-height: 48px; }
.nl-form .btn-primary { background: var(--ink); color: var(--linen); box-shadow: none; }
.nl-form .btn-primary:hover { background: #2a211e; color: var(--linen); }
.nl-note { width: 100%; font-size: .88rem; font-weight: 600; margin: .4rem 0 0; min-height: 1.2em; color: #fdf3f3; }
.nl-note.is-error { color: #ffffff; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
.form-note { width: 100%; font-size: .88rem; font-weight: 600; margin: .4rem 0 0; min-height: 1.2em; color: var(--ink-soft); }
.form-note.is-error { color: var(--danger); }

/* ---------- About ---------- */
.about { padding: clamp(3.5rem, 8vw, 6.5rem) 0; }
.about-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.maker-photo { margin: 0; position: relative; border-radius: 20px; overflow: hidden; box-shadow: var(--shadow-lg); border: 6px solid var(--linen); transform: rotate(-1.5deg); }
.maker-photo svg { width: 100%; height: auto; }
.tape {
  position: absolute; top: -10px; right: 24px;
  background: var(--gold); color: var(--ink);
  font-family: var(--font-display); font-style: italic; font-size: .9rem;
  padding: .35rem .9rem; border-radius: 4px;
  box-shadow: 0 2px 8px rgba(58, 46, 42, .18);
  transform: rotate(4deg);
}

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #d9c9b8; padding: 3.5rem 0 1.5rem; }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 2.2rem; padding-bottom: 2.5rem; }
.footer-brand .brand-text { color: var(--linen); }
.footer-brand p { font-size: .92rem; max-width: 32ch; margin: 1rem 0 0; color: #c3b4a3; }
.footer-col h4 { color: var(--linen); font-size: 1rem; margin-bottom: .9rem; }
.footer-col a { display: block; color: #d9c9b8; text-decoration: none; font-size: .92rem; padding: .22rem 0; }
.footer-col a:hover { color: var(--gold); }
.footer-bottom { display: flex; flex-direction: column; gap: .7rem; border-top: 1px solid rgba(255, 255, 255, .12); padding-top: 1.4rem; }
.footer-bottom-row { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.footer-bottom p { margin: 0; font-size: .82rem; color: #c3b4a3; }
.footer-credit { text-align: center; }
.footer-credit a { color: #c3b4a3; text-decoration: none; }
.footer-credit a:hover { color: var(--gold); text-decoration: underline; }
.footer-heart { color: var(--gold); font-size: 1.05em; vertical-align: -1px; }
.site-footer a:focus-visible, .site-footer button:focus-visible { outline-color: var(--gold); }

/* ---------- Honeypot (spam protection) ---------- */
.hp-field {
  position: absolute !important;
  left: -9999px !important;
  top: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* ---------- Forms ---------- */
input[type="email"], input[type="text"], input[type="date"], select, textarea {
  font: inherit; width: 100%; padding: .72rem .95rem;
  border: 1.5px solid rgba(58, 46, 42, .22); border-radius: 12px;
  background: #fffdf8; color: var(--ink);
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--rose); box-shadow: 0 0 0 3px rgba(201, 122, 122, .18); }
input.is-error { border-color: var(--rose-dark); background: #fdf1ec; }
label { font-weight: 700; font-size: .86rem; margin-top: .6rem; display: block; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-row > div { display: flex; flex-direction: column; gap: .35rem; }

/* ---------- Cart drawer ---------- */
.cart-drawer { position: fixed; inset: 0; z-index: 300; display: none; }
.cart-drawer.open { display: block; }
.cart-backdrop { position: absolute; inset: 0; background: rgba(58, 46, 42, .5); backdrop-filter: blur(3px); animation: fade-in .25s var(--ease); }
.cart-panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: min(420px, 92vw); background: var(--linen);
  display: flex; flex-direction: column;
  box-shadow: -12px 0 40px rgba(58, 46, 42, .2);
  animation: slide-in .3s var(--ease);
}
@keyframes slide-in { from { transform: translateX(100%); } }
@keyframes fade-in { from { opacity: 0; } }
.cart-head { display: flex; align-items: center; justify-content: space-between; padding: 1.4rem 1.6rem; border-bottom: 1px dashed var(--line); }
.cart-head h2 { margin: 0; font-size: 1.5rem; }
.cart-items { flex: 1; overflow: auto; padding: 1rem 1.6rem; display: flex; flex-direction: column; gap: .8rem; }
.cart-item { display: grid; grid-template-columns: 56px 1fr auto; gap: .8rem; align-items: center; padding: .7rem 0; border-bottom: 1px dashed var(--thread-strong); }
.cart-item-art { width: 56px; height: 56px; border-radius: 10px; overflow: hidden; background: var(--linen-2); }
.cart-item-art svg, .cart-item-art img { width: 100%; height: 100%; object-fit: cover; }
.cart-item-name { font-weight: 700; font-size: .95rem; margin-bottom: .15rem; }
.cart-item-meta { font-size: .8rem; color: var(--ink-soft); }
.cart-item-qty { display: flex; align-items: center; gap: .4rem; margin-top: .35rem; }
.cart-item-qty span { min-width: 1.5ch; text-align: center; font-weight: 600; }
.qty-btn { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: #fffdf8; color: var(--ink); cursor: pointer; font-weight: 700; font-size: 1rem; }
.qty-btn:hover { background: var(--rose-btn); border-color: var(--rose-btn); color: var(--linen); }
.cart-item-line-price { font-weight: 700; color: var(--rose-dark); margin-bottom: .3rem; white-space: nowrap; }
.cart-item-remove { background: none; border: none; color: var(--ink-soft); cursor: pointer; font-size: 1.2rem; padding: .2rem .35rem; line-height: 1; }
.cart-item-remove:hover { color: var(--danger); }
.cart-empty { flex: 1; display: grid; place-items: center; text-align: center; padding: 2rem; color: var(--ink-soft); }
.cart-foot { padding: 1.2rem 1.6rem 1.4rem; border-top: 1px dashed var(--thread-strong); }
.cart-subtotal { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .4rem; }
.cart-subtotal strong { font-family: var(--font-display); font-size: 1.4rem; color: var(--rose-dark); }
.cart-note { font-size: .82rem; color: var(--ink-soft); margin-bottom: 1rem; }
.cart-error { font-size: .85rem; font-weight: 600; color: var(--danger); margin: 0 0 .8rem; }
body.cart-open, body.modal-open { overflow: hidden; }

/* ---------- Free-shipping meter ---------- */
.shipping-meter { margin: 0 0 1rem; }
.shipping-meter-text { font-size: .82rem; font-weight: 600; color: var(--ink-soft); margin-bottom: .4rem; }
.shipping-meter-track { height: 8px; border-radius: 999px; background: rgba(58, 46, 42, .12); overflow: hidden; }
.shipping-meter-bar { height: 100%; width: 0; border-radius: 999px; background: var(--rose-btn); transition: width .35s var(--ease); }
.shipping-meter.is-met .shipping-meter-text { color: var(--sage-text); }
.shipping-meter.is-met .shipping-meter-bar { background: var(--sage-text); }

/* ---------- Toasts ---------- */
.toast-region { position: fixed; left: 50%; bottom: 1.2rem; transform: translateX(-50%); z-index: 500; display: flex; flex-direction: column; gap: .6rem; align-items: center; pointer-events: none; width: min(92vw, 460px); }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: .8rem; width: 100%;
  background: var(--ink); color: var(--linen); padding: .75rem .9rem .75rem 1.1rem;
  border-radius: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .28); font-size: .9rem; font-weight: 600;
  animation: toast-in .25s var(--ease);
}
@keyframes toast-in { from { opacity: 0; transform: translateY(14px); } }
.toast-action { background: none; border: 1px solid rgba(250, 245, 236, .5); color: var(--linen); font: inherit; font-weight: 700; font-size: .84rem; padding: .3rem .7rem; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.toast-action:hover { background: rgba(250, 245, 236, .14); }
.toast-close { background: none; border: none; color: var(--linen); opacity: .75; font-size: 1.25rem; line-height: 1; cursor: pointer; padding: 0 .2rem; margin-left: auto; }
.toast-close:hover { opacity: 1; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 1.2rem; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(58, 46, 42, .55); backdrop-filter: blur(4px); }
.modal-card {
  position: relative; width: min(720px, 100%); max-height: 90vh; overflow: auto;
  background: var(--linen); border-radius: 22px; padding: 2.2rem;
  box-shadow: var(--shadow-lg); animation: modal-in .3s var(--ease);
}
@keyframes modal-in { from { opacity: 0; transform: translateY(18px) scale(.97); } }
.modal-close {
  position: absolute; top: 1rem; right: 1.1rem;
  width: 38px; height: 38px; border-radius: 50%;
  border: 1.5px solid var(--line); background: transparent;
  font-size: 1.4rem; line-height: 1; color: var(--ink-soft); cursor: pointer;
  transition: background .18s var(--ease), color .18s var(--ease);
}
.modal-close:hover { background: var(--ink); color: var(--linen); }
.modal-success { text-align: center; }
.modal-success svg { width: 76px; height: 76px; margin: 0 auto 1.2rem; }
.modal-success .btn { margin-top: 1rem; }

.qv-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 1.6rem; align-items: start; }
.qv-art { border-radius: 16px; overflow: hidden; background: var(--linen-2); border: 1px solid var(--line); }
.qv-art svg, .qv-art img { width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; }
.qv-price { font-family: var(--font-display); font-size: 1.7rem; font-weight: 700; color: var(--rose-dark); margin-bottom: .8rem; }
.qv-desc { color: var(--ink-soft); font-size: .95rem; }
.qv-meta { font-size: .85rem; color: var(--ink-soft); font-style: italic; margin-top: .8rem; }
.qv-stock { font-size: .86rem; font-weight: 700; margin-top: .9rem; }
.qv-actions { display: flex; gap: .7rem; flex-wrap: wrap; margin-top: 1.4rem; }

/* ---------- Stock states ---------- */
.stock-ok { color: var(--sage-text); }
.stock-low { color: #6b4d13; }
.stock-out { color: var(--danger); }
.stock-badge { display: inline-block; font-size: .78rem; font-weight: 700; padding: .2rem .6rem; border-radius: 999px; }
.stock-badge.low { background: rgba(212, 168, 90, .3); color: #6b4d13; }
.stock-badge.out { background: rgba(160, 75, 45, .14); color: #8f3620; }

/* ---------- Reveal ----------
   Content is VISIBLE BY DEFAULT. The scroll-reveal animation is opt-in: the
   `js-reveal` class is added by a small inline script, and a failsafe reveals
   anything the IntersectionObserver misses. This means a slow observer, a
   blocked script or JavaScript being off can never leave the page blank. */
.reveal { transition: opacity .7s var(--ease), transform .7s var(--ease); transition-delay: var(--d, 0s); }
/* Product cards are excluded: they are hidden by nothing, ever. Even if a
   stale cached script still tags them `reveal`, the stylesheet will not hide
   them — their entrance comes from the keyframes further down instead. */
.js-reveal .reveal:not(.product-card) { opacity: 0; transform: translateY(18px); }
.js-reveal .reveal.in { opacity: 1; transform: none; }

/* ---------- Product cards ----------
   The shop is the most important thing on the page, so the cards get their
   entrance from pure CSS rather than from the scroll-reveal script. A CSS
   animation always applies, so the products can never be left invisible by a
   failed observer, a blocked script or a stale cached stylesheet.

   The entrance animates TRANSFORM ONLY, never opacity. An opacity animation
   that starts at 0 is just another way to hide content: a browser that
   throttles the animation timeline (background tab, low-power mode) leaves
   the card parked at opacity 0 forever. Animating only the transform means
   the card's opacity is always 1 — it can never be invisible. */
@keyframes card-in { from { transform: translateY(18px); } to { transform: none; } }
.js-reveal .product-card { animation: card-in .55s var(--ease); }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .product-grid { grid-template-columns: repeat(3, 1fr); }
  .review-grid, .pillar-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .about-grid, .custom-grid, .faq-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .nav-toggle { display: flex; }
  .site-nav {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--linen); border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow); padding: .5rem 1.2rem 1.2rem;
    display: none;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: .8rem 0; border-bottom: 1px dashed var(--thread-strong); }
  .site-nav .nav-cta { margin-top: .9rem; border-bottom: none; justify-content: center; }
  .hero-grid { grid-template-columns: 1fr; }
  .qv-grid { grid-template-columns: 1fr; }
  .pd-grid { grid-template-columns: 1fr; }
  .shop-toolbar-controls { margin-left: 0; width: 100%; justify-content: space-between; }
  .shop-search { flex: 1 1 200px; }
  .shop-search input { min-width: 0; width: 100%; }
}

@media (max-width: 640px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .review-grid, .pillar-grid, .footer-grid, .form-row { grid-template-columns: 1fr; }
  .nl-form { flex-direction: column; }
  .nl-form .btn { width: 100%; }
  .modal-card { padding: 1.6rem; }
  .swatch-grid { grid-template-columns: 1fr 1fr; }
  .qty-btn { width: 44px; height: 44px; }
  .cart-item { grid-template-columns: 48px 1fr auto; }
  .cart-item-art { width: 48px; height: 48px; }
  .pd-actions .btn { flex: 1 1 100%; }
  .qty-wrap { width: 100%; }
  .qty-wrap input { flex: 1; }
}

@media (max-width: 460px) {
  .product-grid { grid-template-columns: 1fr; }
  .shop-toolbar-controls { flex-direction: column; align-items: stretch; }
  .sort-wrap { justify-content: space-between; }
  .sort-wrap select { flex: 1; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  /* Needs to match the specificity of `.js-reveal .reveal` or it won't win. */
  .reveal, .js-reveal .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .product-card, .swatch, .cart-panel, .toast { transition: none; animation: none; }
  .cart-panel, .modal-card { animation: none; }
  .cart-count.bump { animation: none; }
  .shipping-meter-bar { transition: none; }
}
