/* Storefront — "premium barber" identity: charcoal, brass, warm paper. Mobile-first.
   Logical properties keep Arabic (RTL) and French (LTR) layouts correct. */
:root {
  --st-ink: #1b1d22;
  --st-charcoal: #22252c;
  --st-brass: #b8892d;
  --st-brass-dark: #94701f;
  --st-paper: #f7f4ee;
  --st-card: #ffffff;
  --st-line: #e6e1d6;
  --st-muted: #6f6b63;
  --st-ok: #1e6b34;
  --st-low: #8a5a00;
  --st-out: #a4231a;
  --radius-lg: 14px;
}

body.store { background: var(--st-paper); color: var(--st-ink); }
.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; }
.muted { color: var(--st-muted); }
.small { font-size: .85rem; }
.skip-link { position: absolute; inset-inline-start: -999px; top: 0; background: #fff; padding: .5rem 1rem; z-index: 100; }
.skip-link:focus { inset-inline-start: 8px; }

/* ---- Header ---- */
.st-header { background: var(--st-charcoal); color: #fff; position: sticky; top: 0; z-index: 40; }
.st-header-inner { display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "menu brand actions" "search search search"; gap: .6rem .75rem; align-items: center; padding-block: .7rem; }
.st-menu-btn { grid-area: menu; background: none; border: 1px solid rgba(255,255,255,.25); color: #fff; border-radius: 8px; font-size: 1.15rem; padding: .2rem .55rem; cursor: pointer; }
.st-brand { grid-area: brand; color: #fff; text-decoration: none; font-weight: 800; letter-spacing: .01em; font-size: .98rem; display: flex; align-items: center; gap: .45rem; min-width: 0; white-space: nowrap; overflow: hidden; }
.st-brand-name { overflow: hidden; text-overflow: ellipsis; }
.st-brand-mark { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--st-brass); color: var(--st-ink); font-size: .95rem; flex-shrink: 0; }
.st-search { grid-area: search; display: flex; background: #fff; border-radius: 999px; overflow: hidden; }
.st-search input { flex: 1; border: 0; padding: .6rem 1rem; font: inherit; min-width: 0; color: var(--st-ink); }
.st-search input:focus { outline: none; }
.st-search:focus-within { box-shadow: 0 0 0 3px var(--st-brass); }
.st-search button { border: 0; background: var(--st-brass); padding: 0 1rem; cursor: pointer; font-size: 1rem; }
.st-actions { grid-area: actions; display: flex; align-items: center; gap: .5rem; }
.st-lang { color: #fff; text-decoration: none; font-size: .85rem; border: 1px solid rgba(255,255,255,.3); border-radius: 999px; padding: .2rem .6rem; }
.st-cart { position: relative; color: #fff; text-decoration: none; font-size: 1.35rem; padding: .1rem .35rem; }
.st-cart-count { position: absolute; top: -6px; inset-inline-end: -8px; background: var(--st-brass); color: var(--st-ink); border-radius: 999px; font-size: .72rem; font-weight: 800; min-width: 20px; text-align: center; padding: 0 .3rem; line-height: 20px; }
.st-cart-count[hidden] { display: none; }

.st-nav { background: var(--st-ink); display: none; }
.st-nav.open { display: block; }
.st-nav ul { list-style: none; margin: 0; padding: .4rem 0; display: grid; }
.st-nav a { display: block; color: #e6dfcf; text-decoration: none; padding: .55rem 0; font-size: .95rem; }
.st-nav a:hover, .st-nav a.active { color: var(--st-brass); }

.st-main { padding-block: 1.25rem 3rem; min-height: 60vh; }

/* ---- Buttons ---- */
.btn-gold { background: var(--st-brass); color: var(--st-ink); }
.btn-gold:hover { background: var(--st-brass-dark); color: #fff; filter: none; }
.btn-ghost { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.5); }
.btn-ghost-dark { background: transparent; color: var(--st-ink); border: 1px solid var(--st-line); }
.btn-block { display: block; width: 100%; text-align: center; }
.btn-sm { padding: .3rem .7rem; font-size: .85rem; }
.btn[disabled], .btn.is-disabled { opacity: .5; pointer-events: none; }
.link-button { background: none; border: 0; color: var(--st-muted); cursor: pointer; font: inherit; padding: .25rem; }
.link-button:hover { color: var(--st-out); }

/* ---- Hero ---- */
.hero { background: radial-gradient(circle at 85% 15%, #3a3528 0%, var(--st-charcoal) 55%); color: #fff; border-radius: var(--radius-lg); padding: 1.75rem 1.25rem; display: grid; gap: 1.5rem; margin-bottom: 2rem; }
.hero-kicker { color: var(--st-brass); text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 700; margin: 0 0 .5rem; }
.hero h1 { font-size: clamp(1.5rem, 5vw, 2.4rem); line-height: 1.2; margin: 0 0 .75rem; }
.hero-sub { color: #d9d2c2; margin: 0 0 1.25rem; max-width: 52ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.hero-points { list-style: none; padding: 0; margin: 0; display: grid; gap: .75rem; }
.hero-points li { border-inline-start: 3px solid var(--st-brass); padding-inline-start: .8rem; display: grid; }
.hero-points span { color: #cfc8b8; font-size: .9rem; }

/* ---- Sections ---- */
.st-section { margin-bottom: 2.25rem; }
.st-section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.st-h1 { font-size: 1.5rem; margin: 0 0 .75rem; }
.st-h2 { font-size: 1.2rem; margin: 0 0 1rem; }
.st-h3 { font-size: 1.05rem; margin: 0 0 .75rem; }
.st-more { color: var(--st-brass-dark); font-weight: 600; text-decoration: none; white-space: nowrap; }

.cat-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; }
.cat-grid a { display: grid; gap: .15rem; background: var(--st-card); border: 1px solid var(--st-line); border-radius: 10px; padding: .85rem; text-decoration: none; color: var(--st-ink); height: 100%; }
.cat-grid a:hover { border-color: var(--st-brass); }
.cat-name { font-weight: 700; }
.cat-count { color: var(--st-muted); font-size: .8rem; }

/* ---- Product cards ---- */
.product-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.card-product { background: var(--st-card); border: 1px solid var(--st-line); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.card-product.is-out .card-media img { opacity: .55; }
.card-media { position: relative; display: block; aspect-ratio: 1; background: #fbfaf7; }
.card-media img { width: 100%; height: 100%; object-fit: contain; padding: .5rem; }
.card-tag { position: absolute; top: .5rem; inset-inline-start: .5rem; background: var(--st-ink); color: var(--st-brass); font-size: .7rem; font-weight: 700; padding: .15rem .5rem; border-radius: 999px; }
.card-body { padding: .7rem; display: flex; flex-direction: column; gap: .3rem; flex: 1; }
.card-title { font-size: .92rem; margin: 0; line-height: 1.35; font-weight: 600; }
.card-title a { color: var(--st-ink); text-decoration: none; }
.card-title a:hover { color: var(--st-brass-dark); }
.card-price { font-weight: 800; font-size: 1.05rem; margin: 0; font-variant-numeric: tabular-nums; }
.card-stock { font-size: .8rem; margin: 0; font-weight: 600; }
.card-stock.ok { color: var(--st-ok); }
.card-stock.low { color: var(--st-low); }
.card-stock.out { color: var(--st-out); }
.card-add { margin-top: auto; padding-top: .35rem; }
.card-add .btn { padding: .5rem .6rem; font-size: .9rem; }

/* ---- Listing ---- */
.crumbs { font-size: .85rem; color: var(--st-muted); margin-bottom: .75rem; }
.crumbs a { color: var(--st-muted); }
.listing-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .75rem; margin-bottom: .75rem; }
.listing-head .st-h1 { margin: 0; }
.listing-tools { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.listing-tools select { font: inherit; padding: .45rem .6rem; border: 1px solid var(--st-line); border-radius: 8px; background: #fff; }
.check { display: inline-flex; gap: .45rem; align-items: center; cursor: pointer; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.chip { padding: .3rem .8rem; border: 1px solid var(--st-line); border-radius: 999px; background: #fff; color: var(--st-ink); text-decoration: none; font-size: .88rem; }
.chip:hover { border-color: var(--st-brass); }
.panel-empty { background: var(--st-card); border: 1px dashed var(--st-line); border-radius: var(--radius-lg); text-align: center; padding: 2.5rem 1rem; }
.pagination { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: 1.5rem; }
.pagination-links { display: flex; align-items: center; gap: .5rem; }

/* ---- Product page ---- */
.pdp { display: grid; gap: 1.25rem; margin-bottom: 2rem; }
.pdp-main { background: #fff; border: 1px solid var(--st-line); border-radius: var(--radius-lg); aspect-ratio: 1; display: grid; place-items: center; overflow: hidden; }
.pdp-main img { width: 100%; height: 100%; object-fit: contain; padding: 1rem; }
.pdp-thumbs { list-style: none; padding: 0; margin: .6rem 0 0; display: flex; gap: .5rem; overflow-x: auto; }
.pdp-thumbs button { border: 2px solid transparent; border-radius: 8px; padding: 0; background: #fff; cursor: pointer; }
.pdp-thumbs button.active { border-color: var(--st-brass); }
.pdp-thumbs img { width: 64px; height: 64px; object-fit: contain; display: block; }
.pdp-brand { color: var(--st-brass-dark); font-weight: 700; text-transform: uppercase; font-size: .8rem; letter-spacing: .08em; margin: 0 0 .25rem; }
.pdp-price { font-size: 1.6rem; font-weight: 800; margin: .5rem 0; font-variant-numeric: tabular-nums; }
.pdp-add { display: flex; gap: .6rem; flex-wrap: wrap; margin: 1rem 0 .4rem; }
.pdp-add .btn { flex: 1; min-width: 160px; padding-block: .75rem; }
.pdp-points { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: .35rem; font-size: .9rem; }
.pdp-points li::before { content: "✓ "; color: var(--st-ok); font-weight: 700; }
.pdp-desc p { white-space: pre-line; }

.qty { display: inline-flex; border: 1px solid var(--st-line); border-radius: 8px; overflow: hidden; background: #fff; }
.qty button { width: 38px; border: 0; background: #faf8f3; font-size: 1.1rem; cursor: pointer; }
.qty button:hover { background: #f0ebe0; }
.qty input { width: 58px; border: 0; text-align: center; font: inherit; font-weight: 700; -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ---- Cart & checkout ---- */
.cart-layout { display: grid; gap: 1.25rem; align-items: start; }
.cart-lines { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.cart-line { background: #fff; border: 1px solid var(--st-line); border-radius: 12px; padding: .75rem; display: grid; grid-template-columns: 64px 1fr auto; grid-template-areas: "img info remove" "img qty total"; gap: .4rem .75rem; align-items: center; }
.cart-img { grid-area: img; }
.cart-img img { width: 64px; height: 64px; object-fit: contain; border-radius: 8px; background: #fbfaf7; }
.cart-info { grid-area: info; display: grid; min-width: 0; }
.cart-name { color: var(--st-ink); font-weight: 600; text-decoration: none; }
.cart-qty { grid-area: qty; }
.cart-total { grid-area: total; margin: 0; font-weight: 800; text-align: end; font-variant-numeric: tabular-nums; }
.cart-remove { grid-area: remove; justify-self: end; }
.summary { background: #fff; border: 1px solid var(--st-line); border-radius: var(--radius-lg); padding: 1.1rem; display: grid; gap: .8rem; }
.summary-lines { list-style: none; padding: 0; margin: 0; display: grid; gap: .4rem; font-size: .92rem; }
.summary-lines li { display: flex; justify-content: space-between; gap: 1rem; }
.totals { margin: 0; display: grid; gap: .3rem; }
.totals > div { display: flex; justify-content: space-between; gap: 1rem; }
.totals dd { margin: 0; font-variant-numeric: tabular-nums; }
.totals .grand { font-weight: 800; font-size: 1.15rem; border-top: 1px solid var(--st-line); padding-top: .5rem; margin-top: .2rem; }
.ship-note { margin: 0; font-size: .88rem; padding: .5rem .7rem; border-radius: 8px; background: #f6f1e4; color: var(--st-low); }
.ship-note.is-free { background: #e8f4ea; color: var(--st-ok); }
.checkout-form { background: #fff; border: 1px solid var(--st-line); border-radius: var(--radius-lg); padding: 1.1rem; }
.form { display: grid; gap: 1rem; }
.fieldset { border: 1px solid var(--st-line); border-radius: 10px; padding: .9rem; margin: 0; display: grid; gap: .9rem; }
.fieldset legend { font-weight: 700; padding-inline: .35rem; }
.field { display: grid; gap: .3rem; }
.field label { font-weight: 600; font-size: .92rem; }
.field input, .field textarea { font: inherit; padding: .65rem .8rem; border: 1px solid var(--st-line); border-radius: 8px; width: 100%; background: #fff; }
.field input:focus, .field textarea:focus { outline: 2px solid var(--st-brass); border-color: var(--st-brass); }
.hint { margin: 0; color: var(--st-muted); font-size: .83rem; }
.field-error { margin: 0; color: var(--st-out); font-size: .85rem; }
.fieldset .check { align-items: flex-start; }
.fieldset .check input { margin-top: .3rem; }

.confirm { text-align: center; background: #fff; border: 1px solid var(--st-line); border-radius: var(--radius-lg); padding: 2rem 1rem; margin-bottom: 1.25rem; }
.confirm-icon { width: 64px; height: 64px; margin: 0 auto 1rem; border-radius: 50%; background: #e8f4ea; color: var(--st-ok); display: grid; place-items: center; font-size: 2rem; font-weight: 800; }
.confirm-number { font-size: 1.1rem; }
.confirm-total { font-size: 1.05rem; }

.toast { position: fixed; bottom: 1rem; inset-inline: 1rem; margin-inline: auto; max-width: 420px; background: var(--st-ink); color: #fff; padding: .8rem 1rem; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.25); transform: translateY(150%); transition: transform .25s ease; z-index: 60; text-align: center; }
.toast.show { transform: none; }
.toast-error { background: var(--st-out); }

.pack-box { background: #fff; border: 1px solid var(--st-line); border-radius: 12px; padding: .9rem 1rem; margin: 1rem 0; }
.pack-saving { margin: 0 0 .75rem; color: var(--st-ok); font-weight: 700; }
.pack-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .45rem; }
.pack-list li { display: flex; align-items: center; gap: .6rem; }
.pack-list img { width: 40px; height: 40px; object-fit: contain; border-radius: 6px; background: #fbfaf7; border: 1px solid var(--st-line); }
.pack-list a { color: var(--st-ink); }
.btn-whatsapp { background: #1f8f4e; color: #fff; font-size: 1.05rem; padding: .8rem 1.4rem; margin-top: .5rem; }
.btn-whatsapp:hover { background: #18733e; filter: none; }
.wa-auto { color: #1f8f4e; font-weight: 600; }
.wa-preview { max-width: 520px; margin: .75rem auto 0; text-align: start; }
.wa-preview pre { white-space: pre-wrap; background: #f4f1ea; border-radius: 8px; padding: .75rem; font-family: inherit; font-size: .88rem; }

/* ---- Footer ---- */
.st-footer { background: var(--st-ink); color: #d9d2c2; padding-top: 2rem; }
.st-footer a { color: var(--st-brass); }
.st-footer-inner { display: grid; gap: 1.5rem; padding-bottom: 1.5rem; }
.st-footer-brand { color: #fff; font-weight: 800; margin: 0 0 .35rem; }
.st-footer-title { color: #fff; font-weight: 700; margin: 0 0 .5rem; }
.st-footer .muted { color: #a39d8e; }
.st-steps { margin: 0; padding-inline-start: 1.1rem; display: grid; gap: .3rem; font-size: .92rem; }
.st-copy { border-top: 1px solid rgba(255,255,255,.1); padding-block: 1rem; }

/* ---- Larger screens ---- */
@media (min-width: 640px) {
  .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
  .cat-grid { grid-template-columns: repeat(3, 1fr); }
  .st-footer-inner { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 900px) {
  .st-header-inner { grid-template-columns: auto minmax(200px, 520px) auto; grid-template-areas: "brand search actions"; justify-content: space-between; }
  .st-menu-btn { display: none; }
  .st-nav { display: block; }
  .st-nav ul { display: flex; flex-wrap: wrap; gap: 0 1.25rem; }
  .hero { grid-template-columns: 3fr 2fr; padding: 2.5rem; align-items: center; }
  .product-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .cat-grid { grid-template-columns: repeat(4, 1fr); }
  .pdp { grid-template-columns: 1fr 1fr; gap: 2.5rem; }
  .cart-layout { grid-template-columns: 1fr 360px; }
  .summary { position: sticky; top: 140px; }
  .cart-line { grid-template-columns: 80px 1fr auto auto 32px; grid-template-areas: "img info qty total remove"; }
  .cart-img img { width: 80px; height: 80px; }
}
