/**
 * base.css — shared "functional" styles used by every layout.
 *
 * It only covers what app.js generates at runtime (product cards, detail and bag
 * dialogs, reviews, toasts, the filter toolbar), so those parts stay usable and tidy
 * whichever layout is active. Each layout's own visual language lives in
 * layouts/<key>/style.css, loaded after this file, so a layout may override any rule.
 *
 * Colours go through CSS variables; --green is overridden at runtime by the
 * site's accent colour.
 */
:root{
  --green:#385749;
  --ink:#22302a;
  --muted:#7a8479;
  --bg:#faf8f3;
  --surface:#ffffff;
  --line:#e0ded4;
  --warn:#a5602a;
  --radius:10px;
  --font-body:-apple-system,"Segoe UI",Arial,sans-serif;
  --font-display:Georgia,serif;
  --art-bg:#eceadd;
  --art-ratio:1.18;
}
*{box-sizing:border-box}
[hidden]{display:none!important}
body{margin:0;background:var(--bg);color:var(--ink);font-size:15px;line-height:1.6;font-family:var(--font-body)}
button,input,select,textarea{font:inherit;color:inherit}
a{color:inherit;text-decoration:none}
button{cursor:pointer}
button:disabled{cursor:not-allowed;opacity:.55}

/* Keyboard skip link */
.skip-link{position:absolute;left:-9999px;top:0;background:var(--green);color:#fff;padding:10px 18px;z-index:100}
.skip-link:focus{left:0}

/* Shared buttons */
.outline{border:1px solid var(--line);border-radius:999px;padding:9px 18px;background:transparent;transition:border-color .2s,color .2s}
.outline:hover{border-color:var(--green)}
.icon-only{position:relative;line-height:1;padding:9px 13px}
.icon-only.on{background:var(--green);border-color:var(--green);color:#fff}
#fav-count{position:absolute;top:-5px;right:-5px;background:var(--warn);color:#fff;font-size:10px;border-radius:20px;padding:1px 6px;min-width:17px}
.button{display:inline-flex;justify-content:space-between;align-items:center;gap:24px;background:var(--green);color:#fff;border:0;border-radius:var(--radius);padding:15px 22px;transition:opacity .2s}
.button:hover:not(:disabled){opacity:.9}
.eyebrow{font-family:var(--font-body);font-size:11px;letter-spacing:.2em;font-weight:700;text-transform:uppercase}
h1,h2,h3{font-family:var(--font-display);font-weight:600;line-height:1.15}

/* Product card (structure generated by app.js) */
.card-wrap{position:relative}
.card{display:block;width:100%;text-align:left;border:0;background:none;color:inherit;padding:0}
.product-art{position:relative;background:var(--art-bg);border-radius:var(--radius);aspect-ratio:var(--art-ratio);overflow:hidden}
.product-art svg{width:100%;height:100%;display:block;transition:transform .35s}
.real-product-image{width:100%;height:100%;object-fit:cover;display:block}
.card:hover .product-art svg{transform:scale(1.04)}
.card small{display:block;font-size:10px;letter-spacing:.16em;text-transform:uppercase;color:var(--muted)}
.card h3{font-size:19px;margin:8px 0 4px}
.card-bottom{display:flex;justify-content:space-between;gap:10px;font-size:12px;color:var(--muted)}
.card-bottom span:first-child{flex:1}
.price{text-align:right;white-space:nowrap;font-weight:700;color:var(--ink)}
.price s{color:#a8b0a4;margin-right:6px;font-weight:400}
.price .off{color:var(--warn);font-weight:700;margin-right:6px}
.ribbon-tag{position:absolute;top:10px;left:10px;background:var(--green);color:#fff;font-size:10px;letter-spacing:.08em;padding:4px 10px;border-radius:999px}
.card-stars{color:#b89360;font-size:12px;margin-top:3px}
.card-stars small{display:inline;color:inherit;opacity:.75;letter-spacing:0;text-transform:none;font-size:11px}
.fav{position:absolute;top:8px;right:8px;width:34px;height:34px;border-radius:50%;border:1px solid var(--line);background:rgba(255,255,255,.94);color:#8d998f;font-size:15px;line-height:1;transition:color .2s,background .2s,border-color .2s}
.fav:hover{border-color:var(--green);color:var(--green)}
.fav.on{color:#c0503f;border-color:#e8bfb8;background:#fff4f2}

/* Filter toolbar */
.tools #categories{display:flex;flex-wrap:wrap;gap:6px}
#categories button{border:1px solid var(--line);background:transparent;border-radius:999px;padding:7px 14px;font-size:12px;transition:background .2s,color .2s}
#categories button.active{background:var(--green);color:#fff;border-color:var(--green)}
.tool-row{display:flex;gap:16px;align-items:flex-end;flex-wrap:wrap;margin-top:14px}
.tool-row label{display:flex;flex-direction:column;gap:5px;font-size:11px;letter-spacing:.1em;color:var(--muted)}
.tool-row select{border:1px solid var(--line);border-radius:8px;padding:8px 10px;background:var(--surface);min-width:150px;font-size:13px}
.search input{display:block;border:1px solid var(--line);border-radius:8px;background:var(--surface);padding:9px 12px;min-width:215px;font-size:14px}
.result-count{font-size:12px;color:var(--muted);margin:12px 0 0}
#empty{color:var(--muted);padding:26px 0}

/* Recently viewed */
.recent-list{display:flex;gap:10px;flex-wrap:wrap;margin-top:12px}
.recent-chip{background:var(--surface);border:1px solid var(--line);border-radius:999px;padding:9px 16px;display:flex;gap:10px;align-items:center;font-size:12.5px;transition:border-color .2s}
.recent-chip:hover{border-color:var(--green)}
.recent-chip small{color:var(--muted)}

/* Reviews */
.reviews{margin:12px 0 4px}
.reviews h3{font-size:15px;margin:0 0 8px}
.reviews h3 small{font-weight:400;opacity:.6;font-size:11px}
.review{margin:0 0 8px;padding:10px 12px;border-left:3px solid var(--green);background:rgba(0,0,0,.035);border-radius:0 6px 6px 0}
.review .stars{color:#b89360;letter-spacing:.1em}
.review p{margin:4px 0;font-size:13.5px}
.review footer{font-size:11.5px;opacity:.65}

/* Dialogs: product detail / bag */
dialog{background:var(--surface);color:var(--ink);border:0;border-radius:16px;padding:30px;max-width:860px;width:92%;max-height:90vh;overflow:auto}
dialog::backdrop{background:rgba(16,22,19,.55)}
.close{float:right;border:0;background:none;font-size:26px;line-height:1;padding:0 4px}
.detail-grid{display:grid;grid-template-columns:1fr 1fr;gap:28px;clear:both}
.detail-grid h2{font-size:27px;margin:6px 0 10px}
.detail-grid label{display:block;margin-top:12px;font-size:13px}
.detail-grid input,.detail-grid select,.detail-grid textarea{width:100%;padding:9px;border:1px solid var(--line);border-radius:8px;background:var(--bg);font:inherit}
.detail-grid textarea{min-height:80px}
.detail-grid li{font-size:13px}
.detail-grid details{margin:10px 0}
.photo-preview{max-height:120px;max-width:100%;margin-top:10px;border-radius:8px}
.stock{font-size:12px;color:var(--green)}
.stock.out{color:var(--warn)}
.hint,.sample-note{font-size:12px;color:var(--muted)}
.sample-note{margin-top:22px}

/* Bag */
.bag-line{padding:14px 0;border-bottom:1px solid var(--line)}
.bag-line b{display:block;font-size:14.5px}
.bag-line>span{display:block;margin-top:6px;font-weight:700}
.bag-line small{display:block;color:var(--muted);margin-top:4px;font-size:12px}
.qty-control{display:flex;align-items:center;gap:8px;margin-top:8px;flex-wrap:wrap}
.qty-control button{border:1px solid var(--line);border-radius:6px;padding:3px 11px;font-size:13px;background:transparent}
.qty-control button:hover{border-color:var(--green);color:var(--green)}
#cart h3{margin:18px 0 4px}
h3.total{margin:6px 0}
.promo-row{display:flex;gap:8px;margin:12px 0 4px}
.promo-row input{flex:1;padding:9px;border:1px solid var(--line);border-radius:8px;background:var(--bg);text-transform:uppercase}
.promo-line{display:flex;align-items:center;gap:8px;color:var(--green);font-weight:600;margin:6px 0}
.promo-remove{border:0;background:none;font-size:16px;opacity:.6;cursor:pointer}
.promo-remove:hover{opacity:1}
#promo-status{font-size:12px;color:var(--muted);margin:4px 0}
#draft-status{font-size:13px;color:var(--green);min-height:20px}
#draft-status a{text-decoration:underline}
/* Checkout block: only present when the owner configured a pay-to address.
   Kept visually distinct from the draft button so nobody mistakes one for the other. */
.checkout-slot:empty{display:none}
.checkout-block{margin:16px 0 0;padding:16px 0 0;border-top:1px solid var(--line)}
.checkout-block h3{margin:0 0 8px}
.checkout-to{display:flex;align-items:baseline;gap:10px;flex-wrap:wrap;margin:0 0 8px}
.checkout-to span{font-size:12px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}
.checkout-to b{font-size:15px;word-break:break-all}
.checkout-open{display:flex;justify-content:center;margin:4px 0 8px}
.checkout-block .outline{margin:6px 0 4px}
.checkout-block .hint{margin:4px 0 0}
.order-photo{max-width:100%;max-height:320px;border-radius:8px}
/* Seeing the photo on screen is not the same as getting it out of the draft;
   these two rules style the links that actually hand the file to the owner. */
.order-photo-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:8px 0 0}
.order-photo-actions a{padding:5px 11px;border:1px solid var(--line);border-radius:7px;background:#fff;font-size:12px;font-weight:500}
.order-photo-actions a:hover{border-color:var(--green);color:var(--green)}

/* Toast */
#toast{position:fixed;bottom:24px;left:50%;transform:translateX(-50%);background:var(--ink);color:var(--bg);padding:11px 22px;border-radius:8px;display:none;z-index:60;box-shadow:0 12px 30px rgba(0,0,0,.25);font-size:13.5px}

/* Accessibility */
a:focus-visible,button:focus-visible,summary:focus-visible,select:focus-visible,input:focus-visible,textarea:focus-visible{outline:3px solid #c48242;outline-offset:3px}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}*{transition:none!important;animation:none!important}}
@media(max-width:760px){
  dialog{padding:20px}
  .detail-grid{grid-template-columns:1fr;gap:18px}
  .search input{min-width:0;width:100%}
}

/* Homepage modules: video strip, brand intro, customer reviews.
   Behaviour-layer fallback only — each layout styles these in its own voice and
   loads its style.css after this file, so the grid shape below is just insurance
   against a layout that forgets a rule. */
#video-list{display:grid;grid-template-columns:repeat(3,1fr);gap:18px}
.video-frame{display:block;width:100%;padding:0;border:0;background:none;position:relative;cursor:pointer;aspect-ratio:16/9;overflow:hidden}
.video-poster{display:block;position:absolute;inset:0}
.video-poster svg{width:100%;height:100%;display:block}
.video-play{position:absolute;inset:0;margin:auto;width:54px;height:54px;border-radius:50%;display:grid;place-items:center;background:rgba(0,0,0,.55);color:#fff;font-size:19px;pointer-events:none}
.video-duration{position:absolute;right:8px;bottom:8px;background:rgba(0,0,0,.7);color:#fff;font-size:11px;padding:2px 7px;border-radius:5px;pointer-events:none}
.video-card h3{margin:10px 0 4px}
.video-card p{margin:0;font-size:13.5px;color:var(--muted)}
#story-art svg{width:100%;height:auto;display:block}
.story-points{list-style:none;padding:0;margin:16px 0 0;display:grid;gap:10px}
.story-points li{display:grid;gap:2px}
#review-list{display:grid;grid-template-columns:repeat(3,1fr);gap:18px}
.review-card blockquote{margin:8px 0 12px}
.review-card footer{display:flex;flex-wrap:wrap;gap:8px;align-items:baseline;font-size:13px}
.review-card footer em{font-style:normal;opacity:.7}
@media(max-width:860px){
  #video-list,#review-list{grid-template-columns:1fr}
}

/* Product deep links: related items inside the detail dialog and the copy-link
   affordance. Same deal as above — behaviour-layer fallback, each layout may
   restyle it. */
.detail-eyebrow{display:flex;justify-content:space-between;align-items:center;gap:12px}
.copy-link{background:none;border:1px solid currentColor;color:inherit;opacity:.7;font:inherit;font-size:11px;letter-spacing:.08em;text-transform:uppercase;padding:3px 9px;border-radius:999px;cursor:pointer}
.copy-link:hover{opacity:1}
.related{grid-column:1/-1;border-top:1px solid var(--line);margin-top:8px;padding-top:18px}
.related h3{margin:0;font-size:17px}
.related-note{margin:4px 0 14px;font-size:13px;color:var(--muted)}
.related-list{display:grid;grid-template-columns:repeat(3,1fr);gap:14px}
.related-card{display:grid;gap:6px;text-align:left;background:none;border:0;padding:0;font:inherit;color:inherit;cursor:pointer}
.related-art{display:block;background:var(--art-bg,#f0ede5);border-radius:var(--radius,9px);overflow:hidden}
.related-art svg{width:100%;height:auto;display:block}
.related-name{font-size:14px;line-height:1.4}
.related-price{font-size:13px;color:var(--muted)}
.related-card:hover .related-name{text-decoration:underline}
@media(max-width:760px){
  .related-list{grid-template-columns:repeat(2,1fr)}
}
