/* ============================================================
   Loam Living — shared stylesheet (Scandinavian redesign)
   Calm palette, generous whitespace, thin lines, no heavy shadows.
   ============================================================ */

:root {
  --paper: #F7F5F0;      /* page background, warm off-white */
  --white: #FFFFFF;
  --mist: #EEEBE4;       /* image backdrops, soft panels */
  --ink: #1F1E1B;        /* text & primary buttons */
  --stone: #76726B;      /* secondary text */
  --line: #E3DFD7;       /* hairlines */
  --oak: #A98A62;        /* accent: light wood */
  --oak-dark: #8A6E48;
  --sage: #8B9A84;       /* secondary accent, used sparingly */

  --font-body: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-accent: 'Instrument Serif', Georgia, serif;

  --radius: 4px;
  --wrap: 1240px;
  --gutter: 32px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "tnum" 1;
}
a { color: inherit; }
img, svg { display: block; max-width: 100%; }
button { font-family: inherit; }
::selection { background: var(--mist); }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Typography helpers ---------- */
.eyebrow {
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--stone);
}
.serif-accent { font-family: var(--font-accent); font-style: italic; font-weight: 400; letter-spacing: 0; }
h1, h2, h3, h4 { font-weight: 500; letter-spacing: -0.015em; line-height: 1.15; }
.muted { color: var(--stone); }

/* ---------- Header ---------- */
header.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(247, 245, 240, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  height: 68px; gap: 24px;
}
.logo {
  font-size: 1.05rem; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase;
  text-decoration: none; white-space: nowrap;
}
.nav-links {
  display: flex; align-items: center; gap: 28px; list-style: none; justify-self: center;
  font-size: 0.84rem; font-weight: 500;
}
.nav-links a, #shopzo-nav a {
  text-decoration: none; color: var(--ink); padding: 4px 0;
  border-bottom: 1px solid transparent; transition: border-color .15s ease;
  white-space: nowrap;
}
.nav-links a:hover, #shopzo-nav a:hover { border-bottom-color: var(--ink); }
#shopzo-nav { display: flex; gap: 28px; align-items: center; }
.nav-actions { display: flex; align-items: center; gap: 22px; justify-self: end; }
.icon-btn {
  position: relative; display: inline-flex; align-items: center; gap: 8px;
  text-decoration: none; font-size: 0.84rem; font-weight: 500; color: var(--ink);
}
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn .count-badge {
  position: absolute; top: -7px; left: 12px;
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px;
  background: var(--ink); color: var(--white);
  font-size: 0.6rem; font-weight: 700; line-height: 16px; text-align: center;
  display: none; /* shown by shopzo-client.js when > 0 */
}
.icon-btn .label { display: none; }
.nav-login {
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  text-decoration: none; color: var(--ink);
  border: 1px solid var(--ink); padding: 9px 16px; border-radius: var(--radius);
  transition: background .15s ease, color .15s ease;
}
.nav-login:hover { background: var(--ink); color: var(--white); }

/* hamburger (mobile only) */
.menu-btn { display: none; width: 44px; height: 44px; margin-right: -10px; border: none; background: none; cursor: pointer; align-items: center; justify-content: center; color: var(--ink); border-radius: var(--radius); }
.menu-btn svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.menu-btn:active { background: var(--mist); }

/* mobile drawer */
.drawer {
  position: fixed; inset: 0; z-index: 100; background: var(--paper);
  display: flex; flex-direction: column; padding: 0 var(--gutter) 24px;
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s;
  overflow-y: auto;
}
.drawer.open { opacity: 1; visibility: visible; transform: none; }
body.menu-open { overflow: hidden; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; height: 60px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.drawer-head .menu-btn { display: flex; }
.drawer-nav [data-shopzo-nav] { display: flex; flex-direction: column; }
.drawer-nav a { display: block; text-decoration: none; color: var(--ink); font-size: 1.35rem; font-weight: 400; padding: 15px 0; border-bottom: 1px solid var(--line); }
.drawer-nav a:active { color: var(--oak-dark); }
.drawer-secondary { margin-top: 26px; display: flex; flex-direction: column; gap: 4px; }
.drawer-secondary a { position: relative; display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); font-size: 0.95rem; font-weight: 500; padding: 12px 0; }
.drawer-secondary a svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.drawer-secondary .count-badge { position: static; margin-left: 2px; display: none; }
.drawer-secondary .btn { margin-top: 16px; padding: 16px; }
.drawer-foot { margin-top: auto; padding-top: 28px; font-size: 0.74rem; color: var(--stone); text-align: center; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-weight: 600; font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 15px 26px; border-radius: var(--radius); text-decoration: none;
  border: 1px solid var(--ink); cursor: pointer; line-height: 1;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.btn--primary { background: var(--ink); color: var(--white); }
.btn--primary:hover { background: #000; }
.btn--primary:disabled { opacity: .45; cursor: not-allowed; }
.btn--outline { background: transparent; color: var(--ink); }
.btn--outline:hover { background: var(--ink); color: var(--white); }
.btn--block { width: 100%; }
.text-link {
  font-size: 0.82rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  text-decoration: none; border-bottom: 1px solid var(--ink); padding-bottom: 3px;
}
.text-link:hover { color: var(--oak-dark); border-color: var(--oak-dark); }

/* ---------- Page head / breadcrumb ---------- */
.breadcrumb { font-size: 0.78rem; color: var(--stone); padding: 28px 0 0; letter-spacing: 0.02em; }
.breadcrumb a { text-decoration: none; color: var(--stone); }
.breadcrumb a:hover { color: var(--ink); }
.breadcrumb span.sep { margin: 0 8px; opacity: .6; }
.page-head { padding: 18px 0 36px; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: clamp(2rem, 4vw, 2.8rem); font-weight: 400; }
.page-head .count { font-size: 0.82rem; color: var(--stone); }

/* ---------- Product grid & card (markup from shopzo-client.js) ---------- */
.products { display: grid; grid-template-columns: repeat(3, 1fr); column-gap: 28px; row-gap: 48px; }
.product-card { text-decoration: none; color: var(--ink); display: block; }
.product-photo {
  aspect-ratio: 4 / 5; position: relative; overflow: hidden;
  background: var(--mist) !important; border-radius: var(--radius); margin-bottom: 16px;
}
.product-photo > img { transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.product-card:hover .product-photo > img { transform: scale(1.03); }

/* photo slider on cards: native scroll-snap (swipe on touch) + small arrows */
.product-photo .slides {
  position: absolute; inset: 0; display: flex; overflow-x: auto;
  scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.product-photo .slides::-webkit-scrollbar { display: none; }
.product-photo .slides img { flex: 0 0 100%; width: 100%; height: 100%; object-fit: cover; scroll-snap-align: start; }
.card-arrow, .pd-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 30px; height: 30px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(255,255,255,0.92); color: var(--ink);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 6px rgba(31,30,27,0.12);
  transition: opacity .15s ease, background .15s ease;
}
.card-arrow svg, .pd-arrow svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.card-arrow:hover, .pd-arrow:hover { background: var(--white); }
.card-arrow:disabled { opacity: 0; pointer-events: none; }
.card-arrow--prev, .pd-arrow--prev { left: 8px; }
.card-arrow--next, .pd-arrow--next { right: 8px; }
.card-dots { position: absolute; left: 0; right: 0; bottom: 10px; z-index: 2; display: flex; justify-content: center; gap: 5px; pointer-events: none; }
.card-dots span { width: 5px; height: 5px; border-radius: 50%; background: rgba(255,255,255,0.6); transition: background .15s ease, transform .15s ease; }
.card-dots span.on { background: var(--white); transform: scale(1.25); }
/* arrows are discreet on desktop (appear on hover), always visible on touch screens */
@media (hover: hover) {
  .card-arrow { opacity: 0; }
  .product-card:hover .card-arrow:not(:disabled) { opacity: 1; }
}

/* main photo arrows on the product page */
.pd-arrow { width: 38px; height: 38px; }
.pd-arrow svg { width: 18px; height: 18px; }
.pd-counter { position: absolute; right: 12px; bottom: 12px; z-index: 2; font-size: 0.68rem; font-weight: 600; letter-spacing: 0.1em; color: var(--ink); background: rgba(255,255,255,0.9); padding: 5px 9px; border-radius: 2px; }
.product-photo .sale-flag {
  position: absolute; top: 12px; left: 12px;
  background: var(--white); color: var(--ink);
  font-size: 0.62rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 5px 9px; border-radius: 2px;
}
.product-photo .top-flag { background: var(--ink); color: var(--white); }
.fav-btn {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255,255,255,0.9); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s ease;
}
.fav-btn:hover { background: var(--white); }
.fav-btn svg { width: 17px; height: 17px; fill: none; stroke: var(--ink); stroke-width: 1.6; }
.fav-btn.active svg { fill: var(--ink); stroke: var(--ink); }
.tag-row { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
/* tag pills come with inline pastel colours from the shared script; neutralise them */
.ptag {
  background: transparent !important; color: var(--stone) !important;
  border: 1px solid var(--line); border-radius: 2px;
  font-size: 0.62rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 3px 7px;
}
.product-card h3 { font-size: 0.98rem; font-weight: 500; margin-bottom: 3px; }
.product-card .sub { font-size: 0.78rem; color: var(--stone); margin-bottom: 8px; }
.price-row { display: flex; align-items: baseline; gap: 10px; }
.price { font-size: 0.92rem; font-weight: 500; }
.price-sale { color: var(--oak-dark); }
.price-old { font-size: 0.8rem; color: var(--stone); text-decoration: line-through; }
.grid-note { grid-column: 1 / -1; padding: 40px 0; color: var(--stone); font-size: 0.9rem; }
.grid-note.error { color: var(--oak-dark); }

/* ---------- Category / filter tabs ---------- */
.cat-tabs { display: flex; gap: 26px; overflow-x: auto; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.cat-tabs::-webkit-scrollbar { display: none; }
.cat-pill {
  flex-shrink: 0; background: none; border: none; cursor: pointer; text-decoration: none;
  font-family: inherit; font-size: 0.84rem; font-weight: 500; color: var(--stone);
  padding: 12px 0 14px; border-bottom: 1px solid transparent; margin-bottom: -1px;
  transition: color .15s ease, border-color .15s ease; white-space: nowrap;
}
.cat-pill:hover { color: var(--ink); }
.cat-pill.active { color: var(--ink); border-bottom-color: var(--ink); }

/* ---------- Form controls ---------- */
.field { margin-top: 18px; }
.field label { display: block; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--stone); margin-bottom: 8px; }
.field input, .input {
  width: 100%; padding: 13px 14px; border: 1px solid var(--line); border-radius: var(--radius);
  font-family: inherit; font-size: 0.92rem; background: var(--white); color: var(--ink);
  transition: border-color .15s ease;
}
.field input:focus, .input:focus { outline: none; border-color: var(--ink); }
select.select {
  appearance: none; -webkit-appearance: none;
  padding: 10px 36px 10px 14px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--white) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%231F1E1B' stroke-width='1.6'><path d='m6 9 6 6 6-6'/></svg>") no-repeat right 12px center;
  font-family: inherit; font-size: 0.84rem; color: var(--ink); cursor: pointer;
}
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 0.84rem; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--ink); }

/* ---------- Quantity stepper ---------- */
.qty-stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
.qty-stepper button { width: 40px; height: 44px; border: none; background: transparent; font-size: 1.05rem; cursor: pointer; color: var(--ink); }
.qty-stepper button:hover { background: var(--mist); }
.qty-stepper span { min-width: 34px; text-align: center; font-weight: 600; font-size: 0.9rem; }

/* ---------- Empty state ---------- */
.empty-state { text-align: center; padding: 80px 20px 100px; max-width: 460px; margin: 0 auto; }
.empty-state .icon svg { width: 36px; height: 36px; margin: 0 auto 18px; fill: none; stroke: var(--ink); stroke-width: 1.2; }
.empty-state h2 { font-size: 1.5rem; font-weight: 400; margin-bottom: 10px; }
.empty-state p { color: var(--stone); font-size: 0.92rem; margin-bottom: 26px; }

/* ---------- Footer ---------- */
footer.site-footer { border-top: 1px solid var(--line); margin-top: 96px; padding: 64px 0 32px; background: var(--paper); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; }
.footer-brand .logo { display: inline-block; margin-bottom: 14px; }
.footer-brand p { font-size: 0.86rem; color: var(--stone); max-width: 300px; line-height: 1.65; }
.footer-col h5 { font-size: 0.68rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--stone); margin-bottom: 16px; }
.footer-col a { display: block; font-size: 0.88rem; text-decoration: none; margin-bottom: 10px; color: var(--ink); }
.footer-col a:hover { color: var(--oak-dark); }
.footer-bottom {
  margin-top: 56px; padding-top: 22px; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: 0.76rem; color: var(--stone);
}
.footer-bottom a { text-decoration: none; }
.footer-bottom a:hover { color: var(--ink); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  :root { --gutter: 20px; }
  .nav { grid-template-columns: auto 1fr; height: 60px; }
  .nav-links { display: none; }
  .nav-actions { gap: 16px; }
  .nav .nav-login { display: none; }   /* lives in the drawer on phones */
  .menu-btn { display: flex; }
  .icon-btn { width: 40px; height: 40px; justify-content: center; }
  .icon-btn .count-badge { left: 22px; top: 2px; }
  .fav-btn { width: 40px; height: 40px; }
  .btn { padding: 16px 22px; }
  .breadcrumb { padding-top: 18px; }
  .page-head { padding: 12px 0 24px; }
  .page-head h1 { font-size: 1.9rem; }
  .products { grid-template-columns: repeat(2, 1fr); column-gap: 16px; row-gap: 34px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  .products { column-gap: 12px; row-gap: 28px; }
  .tag-row { gap: 4px; }                    /* all tags stay visible, just tighter */
  .ptag { font-size: 0.56rem; padding: 2px 5px; letter-spacing: 0.06em; }
  .product-card h3 { font-size: 0.9rem; }
  .footer-grid { grid-template-columns: 1fr; gap: 26px; }
  footer.site-footer { margin-top: 64px; padding: 44px 0 24px; }
}
