/* ==========================================================================
   DigitalFiles storefront — stylesheet
   Design: monochrome shell (#282a2d ink / white paper), product imagery is
   the only color. Light + dark via [data-theme]. One family (Inter).
   ========================================================================== */

/* ---- Theme tokens ---- */
:root,
[data-theme="light"] {
  --paper:      #ffffff;
  --paper-2:    #f7f7f8;   /* subtle raised surface */
  --ink:        #282a2d;   /* text + solid buttons */
  --ink-soft:   #6b6e73;   /* secondary text, meta */
  --line:       #e6e6e8;   /* hairlines */
  --line-soft:  #f0f0f1;
  --btn-bg:     #282a2d;
  --btn-fg:     #ffffff;
  --focus:      #282a2d;
}

[data-theme="dark"] {
  --paper:      #282a2d;   /* the chosen colour becomes the background */
  --paper-2:    #303338;
  --ink:        #f3f3f4;
  --ink-soft:   #a2a5aa;
  --line:       #3c3f44;
  --line-soft:  #34373b;
  --btn-bg:     #f3f3f4;
  --btn-fg:     #282a2d;
  --focus:      #f3f3f4;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--paper);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
  transition: background-color .2s ease, color .2s ease;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

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

/* ---- Layout ---- */
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* ---- Header ---- */
.site-header {
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.1) blur(8px);
}
.site-header .bar {
  display: flex; align-items: center; justify-content: space-between;
  height: 68px; gap: 20px;
}
.brand {
  display: inline-flex; align-items: center; white-space: nowrap;
}
.brand-logo {
  width: 148px; height: 40px; object-fit: contain; display: block;
}
/* Show the right logo for the active theme */
.brand-logo-dark { display: none; }
[data-theme="dark"] .brand-logo-light { display: none; }
[data-theme="dark"] .brand-logo-dark { display: block; }
.header-tools { display: flex; align-items: center; gap: 14px; }

/* icon buttons (theme toggle, search, cart) */
.icon-btn {
  width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 9px;
  background: transparent; color: var(--ink); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: border-color .15s ease, background-color .15s ease;
}
.icon-btn:hover { background: var(--paper-2); border-color: var(--ink-soft); }
.icon-btn svg { width: 18px; height: 18px; }
/* show the right theme glyph */
.icon-btn .i-sun { display: none; }
[data-theme="dark"] .icon-btn .i-sun { display: block; }
[data-theme="dark"] .icon-btn .i-moon { display: none; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--btn-bg); color: var(--btn-fg);
  border: 1px solid var(--btn-bg); border-radius: 10px;
  padding: 12px 22px; font-size: 15px; font-weight: 500; cursor: pointer;
  transition: opacity .15s ease;
}
.btn:hover { opacity: .88; text-decoration: none; }
.btn.ghost {
  background: transparent; color: var(--ink); border-color: var(--line);
}
.btn.ghost:hover { border-color: var(--ink); opacity: 1; }

/* ---- Hero ---- */
.hero { padding: 84px 0 76px; border-bottom: 1px solid var(--line-soft); overflow: hidden; }
.hero-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center;
}
.hero-copy h1 {
  font-size: clamp(2.4rem, 4.6vw, 3.8rem);
  line-height: 1.03; letter-spacing: -0.03em; font-weight: 600;
  margin: 0 0 20px; max-width: 15ch;
}
.hero-copy p {
  font-size: clamp(1.05rem, 1.7vw, 1.25rem); color: var(--ink-soft);
  margin: 0 0 32px; max-width: 42ch;
}

/* Tilted, layered product cards (composed from real thumbnails) */
.hero-stack {
  position: relative; height: 380px;
  display: flex; align-items: center; justify-content: center;
}
.hero-card {
  position: absolute; width: 300px; aspect-ratio: 3 / 2;
  border-radius: 16px; overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 24px 50px -18px rgba(0,0,0,.35), 0 6px 14px -6px rgba(0,0,0,.25);
  background: var(--paper-2);
  transition: transform .25s ease;
}
[data-theme="dark"] .hero-card {
  box-shadow: 0 30px 60px -20px rgba(0,0,0,.6), 0 8px 16px -6px rgba(0,0,0,.5);
}
.hero-card img { width: 100%; height: 100%; object-fit: cover; }

/* stacking: back, middle, front */
.hero-card-3 { transform: translate(46px, 58px) rotate(7deg);  z-index: 1; opacity: .96; width: 280px; }
.hero-card-2 { transform: translate(-38px, 20px) rotate(-6deg); z-index: 2; width: 290px; }
.hero-card-1 { transform: translate(10px, -46px) rotate(2deg); z-index: 3; }
/* gentle lift of the whole stack on hover of the front card */
.hero-card-1:hover { transform: translate(10px, -52px) rotate(2deg); }

/* single / two card fallbacks still look intentional */
.hero-stack:has(.hero-card-1:only-child) .hero-card-1 { transform: rotate(-2deg); }

/* ---- Section heading ---- */
.section { padding: 64px 0; }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 30px; gap: 16px;
}
.section-head h2 { font-size: 1.55rem; letter-spacing: -0.02em; font-weight: 600; margin: 0; }
.section-head a { color: var(--ink-soft); font-size: 15px; }
.section-head a:hover { color: var(--ink); }

/* ---- Category tiles ---- */
.cats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.cat-tile {
  border: 1px solid var(--line); border-radius: 14px; padding: 26px 22px;
  transition: border-color .15s ease, transform .15s ease;
  display: block;
}
.cat-tile:hover { border-color: var(--ink); text-decoration: none; transform: translateY(-2px); }
.cat-tile h3 { margin: 0 0 4px; font-size: 1.1rem; font-weight: 600; letter-spacing: -0.01em; }
.cat-tile span { color: var(--ink-soft); font-size: 14px; }

/* ---- Product grid ---- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 26px 22px; }
.card-product { display: block; }
.card-product .thumb {
  border-radius: 12px; overflow: hidden;
  background: var(--paper-2); border: 1px solid var(--line);
  line-height: 0;
}
.card-product .thumb img {
  width: 100%; height: auto; display: block;
}
.card-product:hover .thumb { border-color: var(--ink-soft); }
.card-product:hover { text-decoration: none; }
.card-product .p-title {
  margin: 12px 0 3px; font-size: 15px; font-weight: 500; line-height: 1.35;
  color: var(--ink);
}
.card-product .p-price { color: var(--ink-soft); font-size: 14px; }

/* empty state */
.empty {
  border: 1px dashed var(--line); border-radius: 14px; padding: 48px 24px;
  text-align: center; color: var(--ink-soft);
}

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--line); margin-top: 40px;
  padding: 40px 0; color: var(--ink-soft); font-size: 14px;
}
.site-footer .bar { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }

/* ---- Accessibility / motion ---- */
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---- Mobile ---- */
@media (max-width: 820px) {
  .hero-grid { grid-template-columns: 1fr; gap: 32px; }
  /* On mobile, hide the tilted 3-card stack but show ONE clean hero image */
  .hero-stack { position: relative; height: auto; display: block; }
  .hero-stack .hero-card-2, .hero-stack .hero-card-3 { display: none; }
  .hero-stack .hero-card-1 {
    position: relative; transform: none; margin: 0 auto; width: 100%; max-width: 340px;
  }
  .hero-stack .hero-card-1:hover { transform: none; }
}
@media (max-width: 640px) {
  .nav { display: none; }
  .hero { padding: 56px 0 46px; }
  .site-header .bar { height: 60px; }
}

/* ==========================================================================
   Product page
   ========================================================================== */
.product-wrap { padding: 28px 0 60px; }

.crumbs { font-size: 13px; color: var(--ink-soft); margin-bottom: 24px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.crumbs a { color: var(--ink-soft); }
.crumbs a:hover { color: var(--ink); }
.crumbs .sep { opacity: .5; }
.crumbs .current { color: var(--ink); }

.product-layout {
  display: grid; grid-template-columns: 1.35fr 1fr; gap: 48px; align-items: start;
}

/* Gallery */
.gallery-main {
  aspect-ratio: 3 / 2; border: 1px solid var(--line); border-radius: 14px;
  overflow: hidden; background: var(--paper-2);
}
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-empty { display: flex; align-items: center; justify-content: center; color: var(--ink-soft); }
.gallery-thumbs { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.gthumb {
  width: 80px; height: 54px; padding: 0; border: 1px solid var(--line); border-radius: 8px;
  overflow: hidden; cursor: pointer; background: var(--paper-2);
}
.gthumb img { width: 100%; height: 100%; object-fit: cover; }
.gthumb.is-active { border-color: var(--ink); }

/* Buy panel */
.buy { position: sticky; top: 92px; }
.p-h1 { font-size: 1.7rem; line-height: 1.15; letter-spacing: -0.02em; font-weight: 600; margin: 0 0 14px; }
.price-line { display: flex; align-items: baseline; gap: 10px; margin-bottom: 22px; }
.price-line .price { font-size: 1.7rem; font-weight: 600; }
.price-line .price-note { color: var(--ink-soft); font-size: 14px; }

.field { margin-bottom: 20px; }
.field > label { display: block; font-size: 13px; color: var(--ink-soft); margin-bottom: 7px; }
.field select {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--paper); color: var(--ink); font-size: 15px; font-family: inherit;
}

.addon { display: flex; gap: 11px; align-items: flex-start; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; cursor: pointer; }
.addon input { margin-top: 3px; }
.addon-label { font-size: 14px; font-weight: 500; }
.addon-price { color: var(--ink-soft); font-weight: 400; }
.addon-desc { display: block; color: var(--ink-soft); font-size: 13px; margin-top: 2px; }

.total-row { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 0; border-top: 1px solid var(--line); margin: 6px 0 16px; }
.total-row strong { font-size: 1.3rem; }
.btn-buy { width: 100%; padding: 14px; font-size: 16px; }
.buy-note { font-size: 13px; color: var(--ink-soft); margin: 12px 0 0; text-align: center; }
.sku { font-size: 12px; color: var(--ink-soft); margin-top: 18px; }

/* Description + specs */
.detail-cols { display: grid; grid-template-columns: 1.5fr 1fr; gap: 48px; margin-top: 56px; padding-top: 40px; border-top: 1px solid var(--line-soft); }
.description { font-size: 15.5px; line-height: 1.75; }
.description h2 { font-size: 1.2rem; margin: 1.4em 0 .5em; letter-spacing: -0.01em; }
.description h3 { font-size: 1.05rem; margin: 1.2em 0 .4em; }
.description ul, .description ol { padding-left: 1.3em; }
.description li { margin: .3em 0; }
.description a { text-decoration: underline; text-underline-offset: 2px; }

.specs h2 { font-size: 1.1rem; margin: 0 0 12px; letter-spacing: -0.01em; }
.specs table { width: 100%; border-collapse: collapse; }
.specs th, .specs td { text-align: left; padding: 10px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; vertical-align: top; }
.specs th { color: var(--ink-soft); font-weight: 500; width: 42%; }

/* Tags */
.tags-row { margin-top: 44px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tags-label { color: var(--ink-soft); font-size: 13px; margin-right: 4px; }
.tag-chip { border: 1px solid var(--line); border-radius: 20px; padding: 5px 13px; font-size: 13px; color: var(--ink-soft); }
.tag-chip:hover { border-color: var(--ink); color: var(--ink); text-decoration: none; }

@media (max-width: 860px) {
  .product-layout { grid-template-columns: 1fr; gap: 30px; }
  .buy { position: static; }
  .detail-cols { grid-template-columns: 1fr; gap: 34px; }
}

/* ---- Category page ---- */
.cat-wrap { padding: 28px 0 60px; }
.cat-head { margin-bottom: 34px; }
.cat-head h1 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); letter-spacing: -0.025em; font-weight: 600; margin: 0 0 10px; }
.cat-intro { color: var(--ink-soft); font-size: 1.05rem; max-width: 60ch; margin: 0; }

/* ---- Search ---- */
.cat-wrap .search-form { display: flex; gap: 10px; max-width: 620px; margin-top: 6px; }
.search-form input[type="search"] {
  flex: 1; padding: 13px 15px; border: 1px solid var(--line); border-radius: 11px;
  background: var(--paper); color: var(--ink); font-size: 16px; font-family: inherit;
}
.search-form input[type="search"]:focus { border-color: var(--ink); outline: none; }
.search-form .btn { padding: 13px 24px; }
@media (max-width: 560px) {
  .search-form { flex-direction: column; }
  .search-form .btn { width: 100%; }
}

/* ---- Cart badge ---- */
.cart-icon { position: relative; }
.cart-badge {
  position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px;
  padding: 0 5px; border-radius: 10px; background: var(--ink); color: var(--paper);
  font-size: 11px; font-weight: 600; display: flex; align-items: center; justify-content: center;
  line-height: 1;
}

/* ---- Cart page ---- */
.cart-wrap { padding: 28px 0 60px; max-width: 860px; }
.cart-wrap h1 { font-size: clamp(1.7rem,3vw,2.3rem); letter-spacing:-0.025em; font-weight:600; margin:0 0 26px; }
.cart-table { border-top: 1px solid var(--line); }
.cart-line {
  display: grid; grid-template-columns: 84px 1fr 80px 90px; gap: 16px; align-items: center;
  padding: 18px 0; border-bottom: 1px solid var(--line);
}
.cart-thumb { width: 84px; height: 56px; border-radius: 8px; overflow: hidden; background: var(--paper-2); border: 1px solid var(--line); }
.cart-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-title { font-weight: 500; }
.cart-meta { color: var(--ink-soft); font-size: 13px; margin-top: 2px; }
.cart-qty input { width: 64px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink); font-size: 15px; text-align: center; }
.cart-price { text-align: right; font-weight: 600; }
.cart-actions { padding: 16px 0; }
.cart-summary { margin-top: 26px; max-width: 340px; margin-left: auto; }
.cart-subtotal { display: flex; justify-content: space-between; align-items: baseline; font-size: 1.1rem; }
.cart-subtotal strong { font-size: 1.4rem; }
.btn-checkout { width: 100%; padding: 15px; font-size: 16px; }
@media (max-width: 620px) {
  .cart-line { grid-template-columns: 64px 1fr 72px; }
  .cart-price { grid-column: 2 / 4; text-align: left; }
  .cart-summary { max-width: none; }
}

/* ---- Gallery zoom cue + lightbox ---- */
.gallery-main { position: relative; cursor: zoom-in; }
.zoom-cue {
  position: absolute; bottom: 10px; right: 10px;
  width: 34px; height: 34px; border-radius: 8px;
  background: color-mix(in srgb, var(--paper) 80%, transparent);
  border: 1px solid var(--line); color: var(--ink);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .15s ease; pointer-events: none;
}
.gallery-main:hover .zoom-cue { opacity: 1; }

.lightbox {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(20,21,23,.92);
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(3px);
}
.lightbox[hidden] { display: none; }
.lb-img {
  max-width: 90vw; max-height: 86vh; object-fit: contain;
  border-radius: 8px; box-shadow: 0 20px 60px -12px rgba(0,0,0,.6);
}
.lb-close {
  position: absolute; top: 18px; right: 22px;
  width: 44px; height: 44px; border-radius: 10px; border: 0;
  background: rgba(255,255,255,.1); color: #fff; font-size: 28px; line-height: 1;
  cursor: pointer; transition: background .15s ease;
}
.lb-close:hover { background: rgba(255,255,255,.2); }
.lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 52px; height: 52px; border-radius: 50%; border: 0;
  background: rgba(255,255,255,.1); color: #fff; font-size: 30px; line-height: 1;
  cursor: pointer; transition: background .15s ease;
}
.lb-nav:hover { background: rgba(255,255,255,.22); }
.lb-prev { left: 20px; }
.lb-next { right: 20px; }
.lb-count {
  position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
  color: rgba(255,255,255,.75); font-size: 13px; letter-spacing: .5px;
}
@media (max-width: 640px) {
  .lb-nav { width: 42px; height: 42px; font-size: 24px; }
  .lb-prev { left: 8px; } .lb-next { right: 8px; }
  .lb-close { top: 10px; right: 12px; }
}

/* ---- Static content pages ---- */
.page-wrap { padding: 28px 0 70px; max-width: 780px; }
.page-content h1 { font-size: clamp(1.8rem,3.4vw,2.5rem); letter-spacing:-0.025em; font-weight:600; margin: 6px 0 22px; }
.page-body { font-size: 16px; line-height: 1.75; color: var(--ink); }
.page-body h2 { font-size: 1.3rem; letter-spacing:-0.01em; margin: 1.6em 0 .5em; }
.page-body h3 { font-size: 1.1rem; margin: 1.3em 0 .4em; }
.page-body p { margin: 0 0 1em; }
.page-body ul, .page-body ol { padding-left: 1.4em; margin: 0 0 1em; }
.page-body li { margin: .35em 0; }
.page-body a { text-decoration: underline; text-underline-offset: 2px; }
.page-body table { width:100%; border-collapse: collapse; margin: 1em 0; }
.page-body th, .page-body td { text-align:left; padding: 10px 12px; border:1px solid var(--line); font-size: 15px; }
.page-body th { background: var(--paper-2); }

/* Contact form */
.contact-form { margin-top: 26px; max-width: 520px; }
.contact-form label { display:block; font-size: 14px; font-weight:500; margin: 14px 0 6px; }
.contact-form input, .contact-form textarea {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--paper); color: var(--ink); font-size: 15px; font-family: inherit;
}
.contact-form input:focus, .contact-form textarea:focus { border-color: var(--ink); outline: none; }
.flash-ok { background:#e9f7ef; border:1px solid #b7e0c7; color:#1c6b3f; padding:14px 16px; border-radius:10px; margin-top:20px; }
[data-theme="dark"] .flash-ok { background:#16321f; border-color:#245537; color:#7fd6a0; }
.flash-err { background:#fdecec; border:1px solid #e6b3b3; color:#8a1f1f; padding:12px 16px; border-radius:10px; margin:16px 0; }
[data-theme="dark"] .flash-err { background:#3a1d1d; border-color:#6b3535; color:#e79a9a; }


/* ---- Footer (three-column) ---- */
.site-footer { border-top: 1px solid var(--line); margin-top: 60px; padding: 54px 0 28px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.footer-h { font-size: 1.15rem; font-weight: 600; letter-spacing:-0.01em; color: var(--ink); margin-bottom: 18px; }
.footer-tag { color: var(--ink-soft); font-size: 14.5px; line-height: 1.65; max-width: 34ch; margin: 0 0 20px; }
.footer-social { display: flex; gap: 14px; }
.footer-social a {
  width: 34px; height: 34px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  color: var(--ink); border: 1px solid var(--line); transition: border-color .15s ease, background .15s ease;
}
.footer-social a:hover { border-color: var(--ink); background: var(--paper-2); }
.footer-col a { display: block; color: var(--ink-soft); font-size: 14.5px; margin: 11px 0; }
.footer-col a:hover { color: var(--ink); text-decoration: none; }
.footer-bottom { display:flex; justify-content:space-between; flex-wrap:wrap; gap:10px; padding-top: 22px; border-top: 1px solid var(--line-soft); color: var(--ink-soft); font-size: 13px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; gap: 30px; } }

/* ---- Sort dropdown (list pages) ---- */
.list-head { display:flex; align-items:center; justify-content:space-between; gap:16px; }
.sort-form { display:flex; align-items:center; gap:8px; }
.sort-form label { color: var(--ink-soft); font-size: 13px; }
.sort-form select {
  padding: 8px 30px 8px 12px; border:1px solid var(--line); border-radius:9px;
  background: var(--paper); color: var(--ink); font-size:14px; font-family:inherit; cursor:pointer;
}
.sort-form select:focus { border-color: var(--ink); outline:none; }

/* ---- Category filters ---- */
.cat-layout { display: grid; grid-template-columns: 240px 1fr; gap: 36px; align-items: start; }
.filters { position: sticky; top: 90px; }
.filter-block { padding: 0 0 20px; margin-bottom: 20px; border-bottom: 1px solid var(--line-soft); }
.filter-block:last-of-type { border-bottom: 0; }
.filter-h { font-size: 14px; font-weight: 600; margin-bottom: 12px; }
.filter-opt { display: flex; align-items: center; gap: 9px; margin: 8px 0; font-size: 14px; color: var(--ink); cursor: pointer; }
.filter-opt input { width: auto; accent-color: var(--ink); }
.filter-cnt { color: var(--ink-soft); font-size: 13px; }
.price-inputs { display: flex; align-items: center; gap: 8px; }
.price-inputs input { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink); font-size: 14px; }
.price-inputs span { color: var(--ink-soft); }
.filter-actions { margin-top: 6px; }
.filter-clear { display: block; text-align: center; margin-top: 10px; font-size: 13px; color: var(--ink-soft); }
.filter-clear:hover { color: var(--ink); }

/* Mobile: filters above grid, collapsible */
.filters-toggle { display: none; }
@media (max-width: 820px) {
  .cat-layout { grid-template-columns: 1fr; gap: 20px; }
  .filters { position: static; }
  .filters-toggle {
    display: block; width: 100%; padding: 12px; border: 1px solid var(--line);
    border-radius: 10px; background: var(--paper); color: var(--ink); font-size: 15px;
    font-weight: 500; cursor: pointer; margin-bottom: 8px; text-align: left;
  }
  .filters form { display: none; padding: 16px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 16px; }
  .filters.open form { display: block; }
}

/* ---- Related products ---- */
.related { margin-top: 60px; padding-top: 40px; border-top: 1px solid var(--line-soft); }
.related h2 { font-size: 1.35rem; letter-spacing:-0.02em; font-weight: 600; margin: 0 0 24px; }

/* ---- Nav with dropdowns ---- */
.nav { display: flex; align-items: center; gap: 4px; }
.nav-item { position: relative; }
.nav-link {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--ink-soft); font-size: 15px; padding: 10px 14px; border-radius: 8px;
  transition: color .15s ease, background .15s ease;
}
.nav-link:hover { color: var(--ink); text-decoration: none; background: var(--paper-2); }
.nav-caret { opacity: .6; transition: transform .18s ease; }
.has-dropdown:hover .nav-caret { transform: rotate(180deg); }

.nav-dropdown {
  position: absolute; top: 100%; left: 0; min-width: 210px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 16px 40px -12px rgba(0,0,0,.22); padding: 8px;
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity .16s ease, transform .16s ease, visibility .16s;
  z-index: 60;
}
[data-theme="dark"] .nav-dropdown { box-shadow: 0 20px 50px -14px rgba(0,0,0,.6); }
.has-dropdown:hover .nav-dropdown,
.has-dropdown:focus-within .nav-dropdown { opacity: 1; visibility: visible; transform: translateY(2px); }
.nav-dropdown a {
  display: block; padding: 9px 12px; border-radius: 7px; font-size: 14.5px; color: var(--ink);
}
.nav-dropdown a:hover { background: var(--paper-2); text-decoration: none; }
.nav-dd-all { color: var(--ink-soft) !important; font-size: 13px !important; border-bottom: 1px solid var(--line-soft); border-radius: 0 !important; margin-bottom: 4px; }

@media (max-width: 640px) { .nav { display: none; } }

/* ============================================================
   MOBILE REFINEMENTS (added for launch polish)
   ============================================================ */
@media (max-width: 560px) {
  /* Comfortable side gutters everywhere — nothing touches screen edges */
  .wrap { padding: 0 16px; }

  /* Product page: ensure gallery + text have breathing room */
  .product-wrap { padding: 16px 0 44px; }
  .product-wrap.wrap, .page-wrap.wrap { padding-left: 16px; padding-right: 16px; }
  .gallery, .gallery-main, .buy { max-width: 100%; }
  .gallery-main { border-radius: 10px; overflow: hidden; }
  .gallery-main img { max-width: 100%; height: auto; }
  .p-h1 { font-size: 1.4rem; }

  /* Static pages: breadcrumb needs room below the header bar */
  .page-wrap { padding-top: 20px; }
  .crumbs { margin-top: 4px; }

  /* Footer: two columns on mobile instead of one long stack */
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 24px 20px;
  }
  .footer-about { grid-column: 1 / -1; }
  .footer-tag { max-width: none; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 6px; }
}

/* Very small phones */
@media (max-width: 380px) {
  .footer-grid { grid-template-columns: 1fr; }
}

/* ---- 3-column grid variant (homepage showcase) ---- */
.grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 820px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .grid-3 { grid-template-columns: 1fr; } }

/* ---- Pagination ---- */
.pagination { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 40px; }
.page-link {
  min-width: 40px; padding: 9px 13px; border: 1px solid var(--line); border-radius: 9px;
  text-align: center; color: var(--ink); font-size: 14px; text-decoration: none;
  transition: border-color .15s ease, background .15s ease;
}
.page-link:hover { border-color: var(--ink); background: var(--paper-2); text-decoration: none; }
.page-link.is-current { background: var(--ink); color: var(--paper); border-color: var(--ink); font-weight: 600; }

/* ---- Custom hero image ---- */
.hero-visual { display: flex; align-items: center; justify-content: center; }
.hero-visual img { width: 100%; height: auto; max-width: 560px; border-radius: 14px; display: block; }
@media (max-width: 820px) {
  .hero-visual img { max-width: 440px; margin: 0 auto; }
}

/* ---- Category SEO content (below product grid) ---- */
/* Align with the products column: offset by the filter sidebar (240px) + gap (36px) */
.cat-content {
  margin: 56px 0 0;
  padding-top: 40px;
  border-top: 1px solid var(--line-soft);
  font-size: 16px; line-height: 1.75; color: var(--ink);
  margin-left: 276px;      /* 240px sidebar + 36px gap = aligns with products */
  max-width: 780px;
}
@media (max-width: 820px) {
  /* Sidebar stacks on mobile, so no offset needed */
  .cat-content { margin-left: 0; max-width: 100%; }
}
.cat-content h2 { font-size: 1.4rem; letter-spacing: -0.02em; margin: 1.4em 0 .5em; }
.cat-content h3 { font-size: 1.15rem; margin: 1.2em 0 .4em; }
.cat-content p { margin: 0 0 1em; }
.cat-content ul, .cat-content ol { padding-left: 1.4em; margin: 0 0 1em; }
.cat-content li { margin: .35em 0; }
.cat-content a { text-decoration: underline; text-underline-offset: 2px; }
