/* Biz Edge hosted shop. Framework-free and small on purpose: fast first paint on mobile data.
   Merchant colours arrive as --sf-primary / --sf-secondary (set inline by _ShopLayout, ShopColors).
   Text ON a colour uses --sf-on-*; a colour used AS text on white uses --sf-*-ink (darkened if too
   light to read), so any pick stays legible.
   Themes: body.theme-classic (default), body.theme-modern, body.theme-minimal. */

:root {
    --sf-primary: #1F6FEB;
    --sf-secondary: #0B1F33;
    --sf-on-primary: #fff;
    --sf-on-secondary: #fff;
    --sf-on-hero: #fff;
    --sf-on-secondary-soft: rgba(255,255,255,.85);
    --sf-on-secondary-line: rgba(255,255,255,.15);
    --sf-primary-ink: #1F6FEB;
    --sf-secondary-ink: #0B1F33;
    --sf-text: #1f2933;
    --sf-muted: #5f6b7a;
    --sf-border: #e3e7ec;
    --sf-bg: #ffffff;
    --sf-surface: #f6f7f9;
    --sf-radius: 6px;
    --sf-shadow: 0 1px 3px rgba(16, 24, 40, .08);
    --sf-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--sf-font); color: var(--sf-text); background: var(--sf-bg); line-height: 1.5; font-size: 16px; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--sf-primary-ink); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(1.5rem, 1.2rem + 1.5vw, 2.25rem); }
h2 { font-size: 1.35rem; }
button, input, select, textarea { font: inherit; color: inherit; }
address { font-style: normal; }

.sf-container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.sf-section { padding-top: 24px; padding-bottom: 24px; }
.sf-narrow { max-width: 720px; }
.sf-center { text-align: center; padding-top: 15vh; }
.sf-muted { color: var(--sf-muted); }
.sf-small { font-size: .85rem; }
.sf-visually-hidden, .sf-hp { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sf-skip { position: absolute; left: -9999px; }
.sf-skip:focus { left: 16px; top: 8px; z-index: 100; background: #fff; padding: 8px 12px; }
:focus-visible { outline: 3px solid var(--sf-primary-ink); outline-offset: 2px; }

/* ── Buttons ─────────────────────────────────────────── */
.sf-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: var(--sf-radius);
    background: var(--sf-primary); color: var(--sf-on-primary); padding: 10px 18px; font-weight: 600; text-decoration: none; cursor: pointer; min-height: 44px; }
.sf-btn:hover { filter: brightness(.92); }
.sf-btn:disabled { opacity: .5; cursor: not-allowed; }
.sf-btn-sm { padding: 6px 12px; min-height: 36px; font-size: .9rem; }
.sf-btn-lg { padding: 12px 24px; font-size: 1.05rem; }
.sf-btn-block { width: 100%; }
.sf-btn-ghost { background: transparent; color: var(--sf-primary-ink); border: 1px solid currentColor; }
.sf-link { background: none; border: 0; color: var(--sf-primary-ink); text-decoration: underline; cursor: pointer; padding: 4px 0; }

/* ── Header ──────────────────────────────────────────── */
.sf-announcement { background: var(--sf-secondary); color: var(--sf-on-secondary); text-align: center; font-size: .9rem; padding: 6px 16px; }
.sf-header { background: #fff; border-bottom: 1px solid var(--sf-border); position: sticky; top: 0; z-index: 20; }
.sf-header-row { display: flex; align-items: center; gap: 12px; min-height: 64px; }
.sf-brand { display: flex; align-items: center; color: var(--sf-secondary-ink); text-decoration: none; font-weight: 800; font-size: 1.25rem; flex-shrink: 0; }
.sf-brand img { max-height: 44px; width: auto; }
.sf-search { position: relative; flex: 1; display: flex; max-width: 520px; margin-left: auto; }
.sf-search input { flex: 1; min-width: 0; border: 1px solid var(--sf-border); border-right: 0; border-radius: var(--sf-radius) 0 0 var(--sf-radius); padding: 8px 12px; min-height: 42px; }
.sf-search button { border: 1px solid var(--sf-border); border-radius: 0 var(--sf-radius) var(--sf-radius) 0; background: var(--sf-surface); padding: 0 12px; cursor: pointer; }
.sf-suggest { position: absolute; top: 100%; left: 0; right: 0; background: #fff; border: 1px solid var(--sf-border); box-shadow: var(--sf-shadow); list-style: none; margin: 4px 0 0; padding: 4px 0; z-index: 30; border-radius: var(--sf-radius); }
.sf-suggest a { display: flex; justify-content: space-between; gap: 8px; padding: 8px 12px; color: var(--sf-text); text-decoration: none; }
.sf-suggest a:hover, .sf-suggest a:focus { background: var(--sf-surface); }
.sf-cart-link { position: relative; color: var(--sf-secondary-ink); padding: 8px; }
.sf-cart-count { position: absolute; top: 0; right: -2px; background: var(--sf-primary); color: var(--sf-on-primary); font-size: .7rem; font-weight: 700; border-radius: 999px; min-width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; padding: 0 4px; }
.sf-menu-toggle { display: none; background: none; border: 0; padding: 8px; color: var(--sf-secondary-ink); cursor: pointer; }
.sf-nav ul { display: flex; gap: 20px; list-style: none; margin: 0 auto; padding-top: 8px; padding-bottom: 8px; overflow-x: auto; scrollbar-width: none; }
.sf-nav a { color: var(--sf-text); text-decoration: none; white-space: nowrap; font-weight: 500; }
.sf-nav a:hover { color: var(--sf-primary-ink); }

/* ── Hero ────────────────────────────────────────────── */
.sf-hero { background: var(--sf-secondary); color: var(--sf-on-secondary); position: relative; overflow: hidden; }
.sf-hero-text { position: relative; padding-top: 56px; padding-bottom: 56px; max-width: 1200px; }
.sf-hero h1 { font-size: clamp(1.8rem, 1.2rem + 3vw, 3rem); }
.sf-hero p { font-size: 1.15rem; max-width: 560px; opacity: .9; }
.sf-hero-image { min-height: 320px; color: #fff; }
.sf-hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sf-hero-image .sf-hero-text { text-shadow: 0 1px 8px rgba(0,0,0,.45); }
.sf-hero-image::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.55), rgba(0,0,0,.1)); }
.sf-hero-image .sf-hero-text { z-index: 1; }

/* ── Sections, categories, grid, cards ───────────────── */
.sf-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.sf-cats { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; padding: 0; margin: 0; }
.sf-cats a { display: block; padding: 10px 16px; border: 1px solid var(--sf-border); border-radius: 999px; text-decoration: none; color: var(--sf-text); background: #fff; }
.sf-cats a:hover { border-color: var(--sf-primary-ink); color: var(--sf-primary-ink); }
.sf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; }
.sf-card { background: #fff; border: 1px solid var(--sf-border); border-radius: var(--sf-radius); overflow: hidden; display: flex; flex-direction: column; }
.sf-card-link { color: inherit; text-decoration: none; flex: 1; }
.sf-card-img { position: relative; aspect-ratio: 1 / 1; background: var(--sf-surface); }
.sf-card-img img { width: 100%; height: 100%; object-fit: cover; }
.sf-badge { position: absolute; top: 8px; left: 8px; background: rgba(31,41,51,.85); color: #fff; font-size: .75rem; padding: 2px 8px; border-radius: 999px; }
.sf-card-title { font-size: .95rem; font-weight: 600; margin: 10px 12px 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sf-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px 12px; }
.sf-price { font-weight: 700; color: var(--sf-secondary-ink); }
.sf-price-lg { font-size: 1.6rem; margin: 8px 0; }

/* ── Listing, pager, breadcrumbs ─────────────────────── */
.sf-breadcrumbs { font-size: .9rem; color: var(--sf-muted); margin-bottom: 12px; }
.sf-breadcrumbs a { color: var(--sf-muted); }
.sf-listing-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.sf-sort { display: flex; align-items: center; gap: 8px; }
.sf-sort select { border: 1px solid var(--sf-border); border-radius: var(--sf-radius); padding: 8px; min-height: 40px; background: #fff; }
.sf-pager { display: flex; justify-content: center; align-items: center; gap: 20px; margin: 28px 0 8px; }
.sf-empty { text-align: center; padding: 48px 16px; }

/* ── Product ─────────────────────────────────────────── */
.sf-product { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: start; }
.sf-product-img { background: var(--sf-surface); border-radius: var(--sf-radius); overflow: hidden; aspect-ratio: 1 / 1; }
.sf-product-img img { width: 100%; height: 100%; object-fit: contain; }
.sf-lead { font-size: 1.05rem; }
.sf-stock-in { color: #157f3b; font-weight: 600; }
.sf-stock-out { color: #b42318; font-weight: 600; }
.sf-buy { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 16px 0 24px; }
.sf-buy input { width: 80px; border: 1px solid var(--sf-border); border-radius: var(--sf-radius); padding: 8px; min-height: 44px; }
.sf-description p, .sf-prose p { margin: 0 0 1em; white-space: pre-line; }

/* ── Cart & checkout ─────────────────────────────────── */
.sf-cart, .sf-checkout { display: grid; grid-template-columns: 1fr 340px; gap: 24px; align-items: start; }
.sf-cart-lines { list-style: none; padding: 0; margin: 0; }
.sf-cart-line { display: grid; grid-template-columns: 80px 1fr auto auto auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--sf-border); }
.sf-cart-line img { border-radius: var(--sf-radius); background: var(--sf-surface); object-fit: cover; width: 80px; height: 80px; }
.sf-cart-qty { display: flex; gap: 6px; align-items: center; }
.sf-cart-qty input { width: 70px; border: 1px solid var(--sf-border); border-radius: var(--sf-radius); padding: 6px; min-height: 36px; }
.sf-cart-line-total { font-weight: 700; min-width: 90px; text-align: right; }
.sf-cart-summary { background: var(--sf-surface); border-radius: var(--sf-radius); padding: 20px; position: sticky; top: 90px; }
.sf-row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; }
.sf-total { border-top: 1px solid var(--sf-border); margin-top: 6px; padding-top: 12px; font-size: 1.15rem; }
.sf-summary-lines { list-style: none; padding: 0; margin: 0 0 8px; }
.sf-summary-lines li { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; font-size: .95rem; }
fieldset { border: 0; padding: 0; margin: 0 0 24px; }
legend { font-weight: 700; font-size: 1.15rem; margin-bottom: 12px; }
.sf-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; flex: 1; }
.sf-field-row { display: flex; gap: 14px; }
.sf-field input, .sf-field select, .sf-field textarea { border: 1px solid var(--sf-border); border-radius: var(--sf-radius); padding: 10px 12px; min-height: 44px; background: #fff; width: 100%; }
.sf-field label { font-weight: 600; font-size: .95rem; }
.sf-phone { display: flex; gap: 8px; align-items: stretch; }
.sf-field .sf-phone .sf-phone-code { flex: 0 0 auto; width: 11rem; max-width: 45%; }
.sf-field .sf-phone input { flex: 1; min-width: 0; }
.sf-phone-prefix { display: flex; align-items: center; padding: 0 12px; border: 1px solid var(--sf-border); border-radius: var(--sf-radius); background: var(--sf-surface); white-space: nowrap; }
.sf-error, .field-validation-error { color: #b42318; font-size: .875rem; }
.input-validation-error { border-color: #b42318 !important; }
.sf-options { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.sf-option { display: flex; align-items: center; gap: 12px; border: 1px solid var(--sf-border); border-radius: var(--sf-radius); padding: 12px; cursor: pointer; background: #fff; }
.sf-option:has(input:checked) { border-color: var(--sf-primary-ink); box-shadow: 0 0 0 1px var(--sf-primary-ink); }
.sf-option-text { flex: 1; display: flex; flex-direction: column; }
.sf-option-fee { font-weight: 700; }
.sf-status { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; background: var(--sf-surface); border-radius: var(--sf-radius); padding: 16px; margin-bottom: 16px; }
.sf-status div { display: flex; flex-direction: column; }

/* ── Alerts ──────────────────────────────────────────── */
.sf-alert { border-radius: var(--sf-radius); padding: 12px 16px; margin: 12px 0; }
.sf-alert:empty, .validation-summary-valid { display: none; }
.sf-alert-error { background: #fef3f2; color: #912018; border: 1px solid #fecdca; }
.sf-alert-ok { background: #ecfdf3; color: #05603a; border: 1px solid #abefc6; }
.sf-alert ul { margin: 0; padding-left: 18px; }

/* ── Footer, WhatsApp, toast ─────────────────────────── */
.sf-footer { background: var(--sf-secondary); color: var(--sf-on-secondary-soft); margin-top: 48px; padding-top: 40px; }
.sf-footer a { color: var(--sf-on-secondary); }
.sf-footer ul { list-style: none; padding: 0; margin: 0; }
.sf-footer li { margin-bottom: 6px; }
.sf-footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 24px; }
.sf-footer-title { color: var(--sf-on-secondary); font-weight: 700; margin-bottom: 10px; }
.sf-footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; border-top: 1px solid var(--sf-on-secondary-line); margin-top: 32px; padding-top: 16px; padding-bottom: 24px; font-size: .875rem; }
.sf-whatsapp { position: fixed; right: 16px; bottom: 16px; width: 56px; height: 56px; border-radius: 50%; background: #25D366; color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 12px rgba(0,0,0,.2); z-index: 40; }
.sf-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--sf-secondary); color: var(--sf-on-secondary); padding: 10px 18px; border-radius: 999px; z-index: 50; box-shadow: var(--sf-shadow); }

/* ── Themes ──────────────────────────────────────────── */
body.theme-modern { --sf-radius: 14px; --sf-surface: #f2f4f8; }
body.theme-modern .sf-header { background: var(--sf-secondary); border-bottom: 0; }
body.theme-modern .sf-brand, body.theme-modern .sf-cart-link, body.theme-modern .sf-menu-toggle, body.theme-modern .sf-nav a { color: var(--sf-on-secondary); }
body.theme-modern .sf-nav { background: rgba(0,0,0,.15); }
body.theme-modern .sf-hero { background: linear-gradient(135deg, var(--sf-primary), var(--sf-secondary)); color: var(--sf-on-hero); }
body.theme-modern .sf-hero-image { color: #fff; }
body.theme-modern .sf-card { border: 0; box-shadow: 0 4px 16px rgba(16,24,40,.08); }
body.theme-modern .sf-btn { border-radius: 999px; }

body.theme-minimal { --sf-radius: 0; --sf-surface: #fafafa; }
body.theme-minimal .sf-hero { background: #fff; color: var(--sf-text); border-bottom: 1px solid var(--sf-border); }
body.theme-minimal .sf-hero-image { color: #fff; }
body.theme-minimal .sf-card { border: 0; }
body.theme-minimal .sf-card-title { font-weight: 400; }
body.theme-minimal .sf-btn:not(.sf-btn-ghost) { background: var(--sf-secondary); color: var(--sf-on-secondary); }
body.theme-minimal .sf-footer { background: #fff; color: var(--sf-muted); border-top: 1px solid var(--sf-border); }
body.theme-minimal .sf-footer a, body.theme-minimal .sf-footer-title { color: var(--sf-text); }
body.theme-minimal .sf-footer-bottom { border-top-color: var(--sf-border); }

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 900px) {
    .sf-product, .sf-cart, .sf-checkout { grid-template-columns: 1fr; }
    .sf-cart-summary { position: static; }
    .sf-footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
    .sf-header-row { flex-wrap: wrap; gap: 8px; padding-top: 8px; padding-bottom: 8px; }
    .sf-search { order: 3; flex-basis: 100%; max-width: none; margin-left: 0; }
    .sf-cart-link { margin-left: auto; }
    .sf-menu-toggle { display: block; }
    .sf-nav { display: none; }
    .sf-nav.sf-open { display: block; }
    .sf-nav ul { flex-direction: column; gap: 0; }
    .sf-nav li a { display: block; padding: 10px 0; border-bottom: 1px solid var(--sf-border); }
    .sf-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .sf-field-row { flex-direction: column; gap: 0; }
    .sf-cart-line { grid-template-columns: 64px 1fr auto; }
    .sf-cart-line img { width: 64px; height: 64px; }
    .sf-cart-qty, .sf-cart-line-total { grid-column: 2 / -1; }
    .sf-footer-grid { grid-template-columns: 1fr; }
}
