/* Tridly storefront — minimal UI (2026-10) */
:root {
    /* same family as دفتر الماء / Tridly dashboard; --accent = the merchant's own color */
    --accent: #105E96;
    --on-accent: #FFFFFF;
    --bg: #FFFFFF;
    --surface: #F5F7FA;
    --surface-2: #EEF2F6;
    --text: #0B2540;
    --muted: #5B6B7F;
    --line: #E3E8EF;
    --ok: #12B76A;
    --danger: #F04438;
    --shadow: 0 1px 2px rgba(16,24,40,0.04), 0 1px 3px rgba(16,24,40,0.04);
    --shadow-hover: 0 8px 24px -6px rgba(16,24,40,0.12);
    --radius: 14px;
    --radius-sm: 10px;
    --wrap: 1120px;
    --font: 'IBM Plex Sans Arabic', 'Inter', system-ui, -apple-system, sans-serif;
}
[data-theme="dark"] {
    --bg: #0B0B0C; --surface: #161618; --surface-2: #202023; --text: #F2F2F3;
    --muted: #9A9AA0; --line: #26262A; --on-accent: #FFFFFF;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.6;
    color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased;
}
body.lock { overflow: hidden; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
.i { flex-shrink: 0; }
.num { font-family: 'Inter', var(--font); font-feature-settings: "tnum"; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.ok { color: var(--ok); }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
[hidden] { display: none !important; }
[dir="rtl"] .flip .i { transform: scaleX(-1); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- top bar ---------- */
.topbar {
    position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid transparent; transition: border-color .2s;
}
.topbar.scrolled { border-bottom-color: var(--line); }
.topbar-in { height: 60px; display: flex; align-items: center; gap: 8px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.brand-logo {
    width: 34px; height: 34px; border-radius: 10px; background: var(--surface); flex-shrink: 0;
    display: grid; place-items: center; font-weight: 700; overflow: hidden;
}
.brand-logo img { width: 100%; height: 100%; object-fit: cover; }
.brand-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { display: flex; gap: 2px; }
.icon-btn {
    position: relative; width: 40px; height: 40px; border-radius: 12px; border: 0; background: transparent;
    display: grid; place-items: center; cursor: pointer;
}
.icon-btn:hover { background: var(--surface); }
.count {
    position: absolute; top: 3px; inset-inline-end: 1px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
    background: var(--accent); color: var(--on-accent); font: 600 11px/18px 'Inter', sans-serif; text-align: center;
}

/* ---------- buttons & inputs ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 20px;
    border-radius: 12px; border: 1px solid transparent; font-weight: 600; cursor: pointer; transition: opacity .15s, background .15s;
    white-space: nowrap;
}
.btn.primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 8px 20px -6px color-mix(in srgb, var(--accent) 45%, transparent); }
.btn:active { transform: scale(.98); }
.btn.primary:hover { opacity: .9; }
.btn.ghost { background: var(--surface); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.outline { border-color: var(--line); background: var(--bg); }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.link-btn { border: 0; background: none; padding: 6px 8px; cursor: pointer; font-size: 13px; font-weight: 500; color: var(--muted); }
.link-btn.danger { color: var(--danger); }
.input {
    width: 100%; height: 48px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line);
    background: var(--bg); outline: none; transition: border-color .15s; font-size: 15px;
}
textarea.input { height: auto; min-height: 90px; padding: 12px 14px; resize: vertical; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 12%, transparent); }
.input.invalid { border-color: var(--danger); }
.select { position: relative; }
.select select { appearance: none; padding-inline-end: 36px; }
.select .i { position: absolute; inset-inline-end: 14px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--muted); }
.row-gap { display: flex; align-items: center; gap: 4px; }

/* ---------- store intro ---------- */
.intro { padding: 20px 0 8px; }
.intro h1 { margin: 0; font-size: 26px; line-height: 1.3; font-weight: 700; letter-spacing: -.01em; }
.intro p { margin: 6px 0 0; color: var(--muted); max-width: 620px; }
.meta-line { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; font-size: 13px; color: var(--muted); }
.meta-line span { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.dot.off { background: var(--danger); }

.banners { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 16px 0 4px; scrollbar-width: none; }
.banners::-webkit-scrollbar { display: none; }
.banners > * { flex: 0 0 92%; max-width: 760px; aspect-ratio: 21 / 9; border-radius: var(--radius); overflow: hidden; background: var(--surface); scroll-snap-align: start; }
.banners img { width: 100%; height: 100%; object-fit: cover; }

.search { position: relative; margin: 16px 0 6px; }
.search .input { height: 46px; background: var(--surface); border-color: transparent; padding-inline-start: 42px; }
.search .input:focus { background: var(--bg); border-color: var(--text); }
.search .i { position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }

.tabs { display: flex; gap: 6px; overflow-x: auto; padding: 8px 0 4px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
    flex-shrink: 0; height: 36px; padding: 0 14px; border-radius: 18px; border: 1px solid var(--line); background: var(--bg);
    font-size: 14px; font-weight: 500; color: var(--muted); cursor: pointer;
}
.tab.active { background: var(--text); border-color: var(--text); color: var(--bg); }

.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 22px 0 12px; }
.section-head h2 { margin: 0; font-size: 18px; font-weight: 600; }

/* ---------- product grid ---------- */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 12px; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 16px; } }
@media (min-width: 960px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.card { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.card-media { position: relative; aspect-ratio: 1 / 1; border-radius: var(--radius); background: var(--surface); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); transition: box-shadow .2s; }
.card:hover .card-media { box-shadow: var(--shadow-hover); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.card:hover .card-media img { transform: scale(1.03); }
.card-media .ph { position: absolute; inset: 0; display: grid; place-items: center; color: #BDBDC2; }
.badge {
    position: absolute; top: 8px; inset-inline-start: 8px; padding: 2px 8px; border-radius: 6px;
    background: var(--bg); font-size: 12px; font-weight: 600;
}
.badge.out { color: var(--muted); }
.card.soldout .card-media img { opacity: .5; }
.fav {
    position: absolute; top: 6px; inset-inline-end: 6px; width: 34px; height: 34px; border-radius: 50%; border: 0;
    background: color-mix(in srgb, var(--bg) 85%, transparent); display: grid; place-items: center; cursor: pointer; color: var(--text);
}
.fav.on { color: var(--danger); }
.fav.on .i { fill: currentColor; }
.card-name { font-size: 14px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: -2px; }
.price { font-weight: 600; white-space: nowrap; }
.price small { font-size: 12px; color: var(--muted); font-weight: 500; }
.price del { color: var(--muted); font-weight: 400; font-size: 13px; margin-inline-start: 6px; }
.quick-add {
    width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg);
    display: grid; place-items: center; cursor: pointer; flex-shrink: 0;
}
.quick-add:hover { border-color: var(--text); }
.quick-add:disabled { opacity: .35; cursor: not-allowed; }
.more { display: flex; justify-content: center; margin: 28px 0 0; }

.empty { text-align: center; padding: 56px 16px; color: var(--muted); }
.empty .i { margin: 0 auto 10px; color: #C7C7CC; }

/* ---------- info ---------- */
.info { margin-top: 40px; border-top: 1px solid var(--line); }
.info details { border-bottom: 1px solid var(--line); }
.info summary { list-style: none; display: flex; justify-content: space-between; align-items: center; padding: 16px 0; cursor: pointer; font-weight: 600; }
.info summary::-webkit-details-marker { display: none; }
.info details[open] summary .i { transform: rotate(180deg); }
.info .content { padding: 0 0 18px; color: var(--muted); white-space: pre-line; }

/* ---------- footer ---------- */
.foot { margin-top: 48px; border-top: 1px solid var(--line); padding: 24px 0 120px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 14px; }
.foot-links a:hover { text-decoration: underline; }
.foot-bottom { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 18px; }
.lang { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.lang select { border: 0; background: none; color: var(--muted); cursor: pointer; }

/* ---------- floating cart bar ---------- */
.cartbar {
    position: fixed; z-index: 45; bottom: calc(14px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%);
    width: min(520px, calc(100% - 24px)); height: 54px; border: 0; border-radius: 16px; padding: 0 16px;
    background: var(--accent); color: var(--on-accent); display: flex; align-items: center; justify-content: space-between; gap: 12px;
    font-weight: 600; cursor: pointer; box-shadow: 0 10px 30px rgba(0,0,0,.18); animation: rise .25s ease;
}
.cartbar-count { min-width: 26px; height: 26px; border-radius: 8px; background: rgba(255,255,255,.18); display: grid; place-items: center; font-size: 13px; }
@keyframes rise { from { transform: translate(-50%, 20px); opacity: 0; } }

/* ---------- drawer ---------- */
.scrim { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.35); animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; } }
.drawer {
    position: fixed; z-index: 100; background: var(--bg); display: flex; flex-direction: column;
    left: 0; right: 0; bottom: 0; max-height: 92dvh; border-radius: 20px 20px 0 0;
    transform: translateY(100%); visibility: hidden; transition: transform .3s cubic-bezier(.2,.8,.2,1), visibility 0s .3s;
}
.drawer.open { transform: none; visibility: visible; transition: transform .3s cubic-bezier(.2,.8,.2,1); }
@media (min-width: 860px) {
    .drawer { top: 0; bottom: 0; left: auto; right: 0; width: 420px; max-height: none; border-radius: 0; transform: translateX(100%); }
    [dir="rtl"] .drawer { right: auto; left: 0; transform: translateX(-100%); }
    .drawer.open, [dir="rtl"] .drawer.open { transform: none; }
}
.drawer-head { display: flex; justify-content: space-between; align-items: flex-start; padding: 18px 20px 10px; }
.drawer-head h2 { margin: 0; font-size: 19px; font-weight: 600; }
.drawer-head p { margin: 0; }
.drawer-body { overflow-y: auto; padding: 0 20px 16px; flex: 1; overscroll-behavior: contain; }
.drawer-foot { padding: 12px 20px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.notice { margin: 0; padding: 12px; border-radius: 12px; background: var(--surface); text-align: center; color: var(--danger); font-weight: 500; }

.lines { display: flex; flex-direction: column; }
.line { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.line-img { width: 60px; height: 60px; border-radius: 10px; background: var(--surface); overflow: hidden; flex-shrink: 0; display: grid; place-items: center; color: #BDBDC2; }
.line-img img { width: 100%; height: 100%; object-fit: cover; }
.line-main { flex: 1; min-width: 0; }
.line-name { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.line-sub { font-size: 13px; color: var(--muted); }
.line-end { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; height: 34px; }
.stepper button { width: 32px; height: 100%; border: 0; background: none; cursor: pointer; display: grid; place-items: center; }
.stepper span { min-width: 22px; text-align: center; font-size: 14px; font-weight: 600; }
.stepper.lg { height: 48px; border-radius: 12px; }
.stepper.lg button { width: 44px; }

.checkout { display: flex; flex-direction: column; gap: 10px; padding-top: 16px; }
.label { margin: 4px 0 2px; font-size: 14px; font-weight: 600; }
.seg { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 12px; background: var(--surface); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; text-align: center; padding: 9px 6px; border-radius: 9px; font-size: 14px; font-weight: 500; color: var(--muted); cursor: pointer; }
.seg input:checked + span { background: var(--bg); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
[data-delivery-only] { display: flex; flex-direction: column; gap: 10px; }
.coupon summary { cursor: pointer; font-size: 14px; color: var(--muted); padding: 4px 0; list-style: none; }
.coupon summary::-webkit-details-marker { display: none; }
.coupon summary:hover { color: var(--text); }
.coupon-row { display: flex; gap: 8px; margin-top: 8px; }
.hint { margin: 6px 0 0; font-size: 13px; min-height: 1px; }
.hint.err { color: var(--danger); } .hint.ok { color: var(--ok); }
.sum { margin: 8px 0 0; padding: 14px 0 0; border-top: 1px solid var(--line); }
.sum div { display: flex; justify-content: space-between; padding: 3px 0; color: var(--muted); font-size: 14px; }
.sum dt, .sum dd { margin: 0; }
.sum .total { color: var(--text); font-size: 17px; font-weight: 600; padding-top: 8px; }

.success { text-align: center; padding: 36px 4px 12px; }
.success .tick { width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 14px; background: var(--surface); display: grid; place-items: center; color: var(--ok); }
.success h3 { margin: 0 0 6px; font-size: 20px; }
.success p { margin: 0 0 18px; color: var(--muted); }
.success .order-ref { display: inline-block; padding: 8px 14px; border-radius: 10px; background: var(--surface); font-weight: 600; margin-bottom: 18px; }
.success .actions { display: flex; flex-direction: column; gap: 8px; }

.toast {
    position: fixed; z-index: 120; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translate(-50%, 10px);
    background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: 14px; font-weight: 500;
    opacity: 0; pointer-events: none; transition: all .2s; white-space: nowrap; max-width: calc(100% - 32px); overflow: hidden; text-overflow: ellipsis;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- product page ---------- */
.pdp { display: grid; gap: 24px; padding-top: 8px; }
@media (min-width: 860px) { .pdp { grid-template-columns: 1.1fr 1fr; gap: 48px; padding-top: 24px; align-items: start; } .pdp-info { position: sticky; top: 84px; } }
.gallery { position: relative; }
.slides { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; border-radius: var(--radius); background: var(--surface); scrollbar-width: none; }
.slides::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 100%; aspect-ratio: 1 / 1; scroll-snap-align: start; cursor: zoom-in; display: grid; place-items: center; color: #BDBDC2; }
.slide img { width: 100%; height: 100%; object-fit: cover; }
.dots { position: absolute; bottom: 12px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; }
.dots span { width: 6px; height: 6px; border-radius: 3px; background: rgba(0,0,0,.25); transition: all .2s; }
.dots span.on { width: 18px; background: var(--text); }
.thumbs { display: none; gap: 8px; margin-top: 10px; }
@media (min-width: 860px) { .thumbs { display: flex; } .dots { display: none; } }
.thumbs button { width: 64px; height: 64px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); padding: 0; background: var(--surface); cursor: pointer; opacity: .6; }
.thumbs button.on { opacity: 1; border-color: var(--text); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.pdp-cat { font-size: 13px; color: var(--muted); }
.pdp h1 { margin: 2px 0 8px; font-size: 24px; line-height: 1.35; font-weight: 600; }
.rating-mini { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); }
.rating-mini .i { color: #E3A008; fill: #E3A008; }
.pdp-price { font-size: 24px; font-weight: 600; margin: 10px 0 4px; }
.stock-note { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.stock-note.low { color: var(--danger); }
.countdown { font-size: 13px; color: var(--danger); margin-top: 4px; }
.opt-title { font-size: 14px; font-weight: 600; margin: 20px 0 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    min-width: 48px; height: 40px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg);
    font-size: 14px; cursor: pointer;
}
.chip.on { border-color: var(--text); box-shadow: inset 0 0 0 1px var(--text); }
.chip:disabled { color: var(--muted); text-decoration: line-through; cursor: not-allowed; opacity: .6; }
.offers { display: grid; gap: 8px; }
.offer { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.offer input { accent-color: var(--accent); }
.offer:has(input:checked) { border-color: var(--text); box-shadow: inset 0 0 0 1px var(--text); }
.offer b { font-weight: 600; }
.buy { display: flex; gap: 10px; margin-top: 20px; }
.buy .btn.primary { flex: 1; }
.buy-sec { margin-top: 10px; }
.pdp-actions { display: flex; gap: 6px; margin-top: 14px; }
.desc { margin-top: 28px; border-top: 1px solid var(--line); padding-top: 18px; }
.desc h2, .reviews h2 { margin: 0 0 10px; font-size: 16px; font-weight: 600; }
.desc div { color: var(--muted); white-space: pre-line; }
.sticky-buy {
    position: fixed; z-index: 44; left: 0; right: 0; bottom: 0; padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: var(--bg); border-top: 1px solid var(--line); display: flex; align-items: center; gap: 12px;
    transform: translateY(110%); transition: transform .25s;
}
.sticky-buy.show { transform: none; }
.sticky-buy .btn { flex: 1; }
@media (min-width: 860px) { .sticky-buy { display: none; } }
.lightbox { position: fixed; inset: 0; z-index: 130; background: rgba(0,0,0,.92); display: grid; place-items: center; }
.lightbox img { max-width: 100vw; max-height: 100dvh; object-fit: contain; }
.lightbox .icon-btn { position: absolute; top: 14px; inset-inline-end: 14px; color: #fff; }

.reviews { margin-top: 28px; border-top: 1px solid var(--line); padding-top: 18px; }
.review-sum { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.review-sum .big { font-size: 28px; font-weight: 600; }
.stars { display: inline-flex; gap: 2px; color: #E3A008; }
.stars .i { fill: currentColor; }
.stars .i.off { fill: none; color: #D4D4D8; }
.review { padding: 12px 0; border-bottom: 1px solid var(--line); }
.review-head { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
.review p { margin: 4px 0 0; }
.review-form { display: grid; gap: 10px; margin-top: 12px; }
.star-input { display: flex; gap: 4px; direction: ltr; justify-content: flex-end; }
[dir="ltr"] .star-input { justify-content: flex-start; }
.star-input button { border: 0; background: none; padding: 2px; cursor: pointer; color: #D4D4D8; }
.star-input button.on { color: #E3A008; }
.star-input button.on .i { fill: currentColor; }

/* ---------- track page ---------- */
.track-box { max-width: 560px; margin: 0 auto; padding-top: 24px; }
.track-box h1 { margin: 0; font-size: 24px; font-weight: 600; }
.track-form { display: flex; gap: 8px; margin: 16px 0 8px; }
.track-form .input { flex: 1; }
.order-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-top: 12px; }
.order-top { display: flex; justify-content: space-between; gap: 12px; }
.order-top b { font-weight: 600; }
.status { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 6px; background: var(--surface); }
.status.delivered { color: var(--ok); }
.status.cancelled, .status.returned { color: var(--danger); }
.steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin: 16px 0 4px; }
.steps div { font-size: 11px; color: var(--muted); text-align: center; }
.steps i { display: block; height: 4px; border-radius: 2px; background: var(--line); margin-bottom: 6px; }
.steps .done { color: var(--text); }
.steps .done i { background: var(--accent); }
.order-items { margin: 12px 0 0; padding: 12px 0 0; border-top: 1px solid var(--line); font-size: 14px; }
.order-items div { display: flex; justify-content: space-between; gap: 8px; padding: 2px 0; }
.timeline { margin-top: 12px; padding-inline-start: 14px; border-inline-start: 2px solid var(--line); display: grid; gap: 10px; font-size: 13px; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
.fav-inline.on { color: var(--danger); }
.fav-inline.on .i { fill: currentColor; }

/* =================== desktop: professional shop layout (2026-10-31) =================== */
.intro { display: flex; gap: 14px; align-items: flex-start; }
.intro-text { min-width: 0; flex: 1; }
.intro-logo {
    width: 56px; height: 56px; border-radius: 16px; flex-shrink: 0; overflow: hidden; display: grid; place-items: center;
    background: var(--surface); border: 1px solid var(--line); font-size: 22px; font-weight: 700; color: var(--accent);
}
.intro-logo img { width: 100%; height: 100%; object-fit: cover; }
.tab.active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.search .input:focus { border-color: var(--accent); }
.card-name { font-weight: 500; }
.price { font-weight: 700; }

@media (min-width: 1024px) {
    :root { --wrap: 1240px; }
    body { background: var(--surface); }
    .topbar { background: color-mix(in srgb, var(--bg) 94%, transparent); border-bottom-color: var(--line); }
    .topbar-in { height: 68px; }
    .brand-logo { width: 40px; height: 40px; }
    .brand-name { font-size: 17px; }

    /* hero card */
    .intro {
        margin-top: 24px; padding: 28px; gap: 20px; align-items: center;
        background: var(--bg); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow);
        position: relative; overflow: hidden;
    }
    .intro::before { content: ""; position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: 5px; background: var(--accent); }
    .intro-logo { width: 84px; height: 84px; border-radius: 20px; font-size: 32px; }
    .intro h1 { font-size: 30px; }
    .intro p { font-size: 15px; max-width: 760px; }
    .meta-line { font-size: 14px; }
    .meta-line span { background: var(--surface); padding: 4px 12px; border-radius: 999px; }

    /* one banner = full width, several = two per row */
    .banners { margin: 20px 0 0; gap: 16px; }
    .banners > * { flex: 0 0 100%; max-width: none; aspect-ratio: 4 / 1; border-radius: 20px; }
    .banners > *:not(:only-child) { flex-basis: calc(50% - 8px); aspect-ratio: 16 / 7; }

    /* sidebar + grid */
    .shop { margin-top: 24px; }
    .shop.has-side { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 28px; align-items: start; }
    .shop-side { position: sticky; top: 88px; }
    .shop.has-side .shop-side { background: var(--bg); border: 1px solid var(--line); border-radius: 20px; padding: 16px; box-shadow: var(--shadow); }
    .shop.has-side .search { margin: 0 0 10px; }
    .shop.has-side .tabs { flex-direction: column; overflow: visible; padding: 4px 0 0; gap: 2px; }
    .shop.has-side .tab {
        height: 42px; border: 0; border-radius: 12px; text-align: start; padding: 0 14px; background: transparent; color: var(--text);
    }
    .shop.has-side .tab:hover { background: var(--surface); }
    .shop.has-side .tab.active { background: color-mix(in srgb, var(--accent) 12%, var(--bg)); color: var(--accent); font-weight: 600; }
    .shop:not(.has-side) .shop-side { max-width: 520px; }
    .section-head { margin: 4px 0 14px; }
    .section-head h2 { font-size: 20px; }
    .grid { gap: 20px; }
    .shop.has-side .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .shop:not(.has-side) .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }

    /* product cards become real cards */
    .card { background: var(--bg); border: 1px solid var(--line); border-radius: 18px; padding: 10px 10px 14px; box-shadow: var(--shadow); transition: box-shadow .2s, transform .2s; }
    .card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
    .card .card-media { border: 0; box-shadow: none; border-radius: 12px; }
    .card:hover .card-media { box-shadow: none; }
    .card-name { font-size: 15px; padding: 0 4px; }
    .card-foot { padding: 0 4px; }
    .price { font-size: 17px; }

    .info { background: var(--bg); border: 1px solid var(--line); border-radius: 20px; padding: 8px 20px; margin-top: 32px; }

    /* cart bar: compact pill in the corner instead of covering the products */
    .cartbar { left: auto; right: 28px; transform: none; width: 340px; bottom: 28px; animation: rise-side .25s ease; }
    [dir="rtl"] .cartbar { right: auto; left: 28px; }
}
@media (min-width: 1280px) {
    .shop.has-side .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@keyframes rise-side { from { transform: translateY(20px); opacity: 0; } }
/* the image must cover the placeholder icon (it used to show on top of every photo) */
.card-media img { position: relative; z-index: 1; }
.card-media .badge, .card-media .fav { z-index: 2; }
/* a single banner takes the full width on phones too */
.banners > *:only-child { flex-basis: 100%; }

/* =================== big-store pieces (2026-10-31 c) =================== */
.announce { background: var(--accent); color: var(--on-accent); font-size: 13px; font-weight: 500; text-align: center; }
.announce .wrap { padding-block: 7px; display: flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-search { display: none; }
.badge.new { background: var(--accent); color: var(--on-accent); }

.banner-dots { display: flex; justify-content: center; gap: 6px; margin-top: 10px; }
.banner-dots button { width: 8px; height: 8px; border-radius: 4px; border: 0; padding: 0; background: var(--line); cursor: pointer; transition: width .2s, background .2s; }
.banner-dots button.on { width: 22px; background: var(--accent); }

.row-section { margin-top: 8px; }
.hrow { display: grid; grid-auto-flow: column; grid-auto-columns: 44%; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; scrollbar-width: none; }
.hrow::-webkit-scrollbar { display: none; }
.hrow > .card { scroll-snap-align: start; }

.section-head { align-items: center; gap: 10px; }
.section-head h2 { display: flex; align-items: baseline; gap: 8px; }
.sort { display: inline-flex; align-items: center; gap: 6px; }
.sort select { height: 36px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); padding: 0 10px; font-size: 13px; cursor: pointer; }

.wa-float {
    position: fixed; z-index: 44; bottom: calc(80px + env(safe-area-inset-bottom)); inset-inline-end: 16px;
    width: 52px; height: 52px; border-radius: 50%; background: #25D366; color: #fff; display: grid; place-items: center;
    box-shadow: 0 10px 24px rgba(37,211,102,.35);
}

/* footer */
.foot-trust { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.foot-trust > div { display: flex; gap: 10px; align-items: center; }
.foot-trust .i { color: var(--accent); width: 40px; height: 40px; padding: 10px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 10%, var(--bg)); }
.foot-trust span { display: flex; flex-direction: column; line-height: 1.35; }
.foot-trust b { font-size: 14px; }
.foot-trust small { color: var(--muted); font-size: 12px; }
.foot-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; padding: 22px 0; }
.foot-cols > div { display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.foot-cols b { font-size: 14px; margin-bottom: 2px; }
.foot-cols a { color: var(--muted); }
.foot-cols a:hover { color: var(--accent); }
.foot-about { grid-column: 1 / -1; }
.foot-name { font-size: 17px !important; }
.foot-social { display: flex; gap: 14px; flex-wrap: wrap; }
.foot-bottom { flex-wrap: wrap; gap: 10px 18px; }
.foot-cta { font-size: 13px; color: var(--muted); }
.foot-cta b { color: var(--accent); }

@media (min-width: 640px) {
    .hrow { grid-auto-columns: 30%; }
    .foot-trust { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .foot-cols { grid-template-columns: 2fr 1fr 1fr 1fr; }
    .foot-about { grid-column: auto; }
}
@media (min-width: 1024px) {
    .top-search {
        display: flex; align-items: center; gap: 8px; flex: 0 1 460px; height: 44px; padding: 0 14px; margin-inline: auto;
        background: var(--surface); border: 1px solid var(--line); border-radius: 12px; color: var(--muted);
    }
    .top-search:focus-within { border-color: var(--accent); background: var(--bg); }
    .top-search input { border: 0; outline: 0; background: transparent; width: 100%; font-size: 14px; color: var(--text); }
    .brand { flex: 0 0 auto; }
    .shop.has-side .search { display: none; }
    .hrow { grid-auto-columns: calc((100% - 36px) / 4); gap: 12px; }
    .row-section { margin-top: 28px; }
    .foot { background: var(--bg); margin-top: 48px; border-top: 1px solid var(--line); }
    .wa-float { bottom: 28px; inset-inline-end: 28px; }
    [dir="rtl"] .cartbar { left: 100px; }
    .cartbar { right: 100px; }
}

/* =================== cart extras (2026-10-31 d) =================== */
.freebar { margin: 4px 0 10px; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 8%, var(--bg)); border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--bg)); }
.freebar-text { font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.freebar-track { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.freebar-track span { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 3px; transition: width .4s ease; }
.freebar.done { background: color-mix(in srgb, var(--ok) 10%, var(--bg)); border-color: color-mix(in srgb, var(--ok) 25%, var(--bg)); }
.freebar.done .freebar-track span { background: var(--ok); }

.recs { margin: 14px 0 6px; }
.recs .label { margin: 0 0 8px; }
.recs-row { display: grid; grid-auto-flow: column; grid-auto-columns: 132px; gap: 10px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.recs-row::-webkit-scrollbar { display: none; }
.rec { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.rec-img { aspect-ratio: 1; border-radius: 12px; background: var(--surface); overflow: hidden; border: 1px solid var(--line); }
.rec-img img { width: 100%; height: 100%; object-fit: cover; }
.rec-name { font-size: 12.5px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rec-foot { display: flex; align-items: center; justify-content: space-between; gap: 4px; font-size: 13px; font-weight: 700; }
.rec-foot small { font-weight: 500; color: var(--muted); }
.rec-add { width: 28px; height: 28px; border-radius: 50%; border: 0; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font-size: 18px; line-height: 1; cursor: pointer; flex-shrink: 0; }
.draft-note { margin: -4px 0 4px; font-size: 11.5px; }
.related-row { grid-auto-columns: 44%; }
@media (min-width: 640px) { .related-row { grid-auto-columns: 30%; } }
@media (min-width: 1024px) { .related-row { grid-auto-columns: calc((100% - 36px) / 4); } }

/* =========================================================
   v2 polish (2026-11) — same design language as the merchant dashboard
   ========================================================= */
:root { --ease: cubic-bezier(.2,.8,.2,1); --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-xl: 24px; --bnav-h: 0px; }
/* calmer neutrals */
:root { --surface: #F6F7F9; --surface-2: #EEF1F4; --line: #E6E9EE; --text: #0E1B2B; --muted: #5E6B7A; }
/* real dark palette (blue-grey, not pure black) for stores using the dark theme */
[data-theme="dark"] {
    --bg: #0B1220; --surface: #111A2B; --surface-2: #162133; --text: #E7ECF2;
    --muted: #9AA7B6; --line: #1F2B3E; --shadow: none; --shadow-hover: 0 12px 32px -12px rgba(0,0,0,.6);
}

/* gentle page entrance */
main { animation: sf-in .28s var(--ease); }
@keyframes sf-in { from { opacity: 0; transform: translateY(4px); } }

/* image shimmer until the photo has loaded */
.card-media, .slide, .rec-img {
    background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%);
    background-size: 200% 100%; animation: sf-sk 1.2s linear infinite;
}
.card-media.ld, .slide.ld, .rec-img.ld { animation: none; background: var(--surface); }
.card-media img, .slide img { transition: opacity .3s var(--ease); }
.card-media:not(.ld) img, .slide:not(.ld) img { opacity: 0; }
@keyframes sf-sk { to { background-position: -200% 0; } }

/* cards: lift on hover (desktop pointer only) */
@media (hover: hover) {
    .card { transition: transform .2s var(--ease), box-shadow .2s var(--ease); }
    .card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
}

/* toast with an action ("View cart") */
.toast { display: flex !important; align-items: center; gap: 14px; border-radius: var(--r-md); padding: 10px 14px 10px 16px; box-shadow: 0 24px 60px -20px rgba(14,27,43,.45); }
[dir="rtl"] .toast { padding: 10px 16px 10px 14px; }
.toast button { background: transparent; border: 0; color: inherit; font-weight: 700; cursor: pointer; padding: 4px 8px; border-radius: 8px; text-decoration: underline; text-underline-offset: 3px; }
.toast:empty { display: none !important; }

/* friendlier empty states */
.empty { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.empty .i { width: 52px; height: 52px; padding: 13px; border-radius: 50%; background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--accent); margin: 0 auto 8px; }

/* order tracking: dot timeline */
.steps { display: flex !important; gap: 0 !important; margin: 18px 0 8px !important; }
.steps > div { flex: 1; position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); text-align: center; }
.steps > div::before { content: ""; position: absolute; top: 11px; inset-inline-start: -50%; width: 100%; height: 2px; background: var(--line); }
.steps > div:first-child::before { display: none; }
.steps i { position: relative; z-index: 1; width: 24px !important; height: 24px !important; margin: 0 !important; border-radius: 50% !important; background: var(--bg) !important; border: 2px solid var(--line); display: grid !important; place-items: center; color: #fff; }
.steps .done, .steps .now { color: var(--text); }
.steps .done i { background: var(--ok) !important; border-color: var(--ok); }
.steps .done::before, .steps .now::before { background: var(--ok); }
.steps .now { font-weight: 600; color: var(--accent); }
.steps .now i { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }

/* phone: app-style bottom navigation */
.bnav { display: none; }
@media (max-width: 859px) {
    :root { --bnav-h: 60px; }
    body { padding-bottom: calc(var(--bnav-h) + env(safe-area-inset-bottom)); }
    .bnav {
        display: flex; position: fixed; z-index: 46; inset-inline: 0; bottom: 0;
        padding: 4px 4px env(safe-area-inset-bottom); background: color-mix(in srgb, var(--bg) 94%, transparent);
        backdrop-filter: saturate(1.4) blur(12px); border-top: 1px solid var(--line);
    }
    .bnav a, .bnav button {
        flex: 1; position: relative; min-height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
        background: none; border: 0; padding: 0; color: var(--muted); font-size: 11px; font-weight: 500; cursor: pointer;
    }
    .bnav .on { color: var(--accent); }
    .bnav .count { top: 2px; inset-inline-end: calc(50% - 22px); }
    .top-actions { display: none; }                 /* cart & favorites live in the bottom bar */
    .cartbar { display: none !important; }          /* cart count shows on the bottom bar instead */
    .sticky-buy { bottom: calc(var(--bnav-h) + env(safe-area-inset-bottom)); padding-bottom: 10px; }
    .wa-float { bottom: calc(var(--bnav-h) + 16px + env(safe-area-inset-bottom)) !important; }
    .toast { bottom: calc(var(--bnav-h) + 16px + env(safe-area-inset-bottom)) !important; }
    .scrim { z-index: 95; }
}

/* touch targets + reduced motion */
@media (pointer: coarse) { .btn, .icon-btn, .input { min-height: 44px; } .icon-btn { min-width: 44px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
.toast.show { pointer-events: auto; }

/* =====================================================================
   Service accounts (الحرفيون) — <slug>.tridly.shop with store_type=service.
   The work already done is the hero; one action repeats everywhere: اطلب خدمة.
   Shop pages never load these rules (no .svc-* class is emitted there).
   ===================================================================== */
.btn.small { height: 38px; padding: 0 14px; font-size: 14px; border-radius: 10px; }
.dot-state { width: 7px; height: 7px; border-radius: 50%; background: #7CF2B0; display: inline-block; }
.dot-state.off { background: color-mix(in srgb, var(--on-accent) 55%, transparent); }

.svc-nav { display: none; gap: 2px; margin-inline: 8px; }
.svc-nav a { padding: 8px 12px; border-radius: 10px; color: var(--muted); font-weight: 500; }
.svc-nav a:hover { background: var(--surface); color: var(--text); }
@media (min-width: 860px) { .svc-nav { display: flex; } }

/* ---------- hero: the craftsman, then his work ---------- */
.svc-hero { display: grid; gap: 24px; padding: 28px 0 8px; }
.svc-hero h1 { margin: 0; font-size: clamp(27px, 6vw, 40px); line-height: 1.15; font-weight: 700; letter-spacing: -.015em; }
.svc-tagline { margin: 10px 0 0; font-size: 17px; font-weight: 600; color: var(--accent); }
.svc-about { margin: 12px 0 0; color: var(--muted); max-width: 46ch; }
.svc-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.svc-areas { display: flex; align-items: center; gap: 6px; margin: 16px 0 0; font-size: 14px; color: var(--muted); }

/* one photo of finished work, large and confident: the craft speaks first */
.svc-hero-art { position: relative; display: block; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-hover); }
.svc-hero-art img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .4s ease; }
.svc-hero-art:hover img { transform: scale(1.03); }
.svc-hero-count {
    position: absolute; inset-inline-end: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 13px; border-radius: 999px; background: rgba(0,0,0,.62); color: #fff; font-size: 13px; font-weight: 600;
    backdrop-filter: blur(6px);
}
@media (min-width: 860px) {
    .svc-hero { grid-template-columns: 1.05fr .95fr; align-items: center; padding: 44px 0 20px; }
    .svc-hero.solo { grid-template-columns: minmax(0, 46rem); }   /* a brand-new account has no photo yet */
}

.svc-block { margin-top: 38px; scroll-margin-top: 72px; }
.card-plain { background: var(--surface); border-radius: var(--radius); padding: 18px; }
.card-plain h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 16px; }

/* ---------- services with an estimated price ---------- */
.svc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.svc-item {
    display: flex; align-items: center; gap: 14px; padding: 14px;
    background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
}
.svc-item-img { width: 62px; height: 62px; border-radius: 12px; object-fit: cover; flex-shrink: 0; }
.svc-item-img.ph { display: grid; place-items: center; background: var(--surface); color: var(--muted); }
.svc-item-body { flex: 1; min-width: 0; }
.svc-item-body b { display: block; font-size: 15.5px; }
.svc-item-body p { margin: 3px 0 0; font-size: 14px; color: var(--muted); }
.svc-dur { display: inline-flex; align-items: center; gap: 5px; margin-top: 6px; font-size: 13px; color: var(--muted); }
.svc-item-end { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex-shrink: 0; }
.svc-price { font-weight: 700; color: var(--accent); white-space: nowrap; font-size: 15px; }
@media (max-width: 560px) {
    .svc-item { flex-wrap: wrap; }
    .svc-item-end { flex-direction: row; align-items: center; width: 100%; justify-content: space-between; }
}

/* ---------- the gallery ---------- */
.svc-gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.svc-gallery figure { margin: 0; position: relative; border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.svc-gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; cursor: zoom-in; transition: transform .35s ease; }
.svc-gallery figure:hover img { transform: scale(1.04); }
.svc-gallery figcaption {
    position: absolute; inset-inline: 0; bottom: 0; padding: 22px 12px 10px; color: #fff; font-size: 13px;
    background: linear-gradient(to top, rgba(0,0,0,.72), transparent);
}
.svc-gallery figcaption b { display: block; }
.svc-gallery figcaption span { opacity: .85; }
@media (min-width: 700px) { .svc-gallery { grid-template-columns: repeat(3, 1fr); gap: 12px; } }
@media (min-width: 1000px) { .svc-gallery { grid-template-columns: repeat(4, 1fr); } }

.svc-lightbox {
    position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.9); display: none;
    align-items: center; justify-content: center; padding: 16px; cursor: zoom-out;
}
.svc-lightbox.on { display: flex; }
.svc-lightbox img { max-width: 100%; max-height: 92vh; border-radius: 10px; object-fit: contain; }

/* ---------- hours + area ---------- */
.svc-when { display: grid; gap: 12px; }
@media (min-width: 700px) { .svc-when { grid-template-columns: 1fr 1fr; } }
.svc-hours { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.svc-hours th { text-align: start; font-weight: 500; padding: 7px 0; }
.svc-hours td { text-align: end; padding: 7px 0; }
.svc-hours tr + tr { border-top: 1px solid var(--line); }
.svc-hours tr.today th, .svc-hours tr.today td { font-weight: 700; color: var(--accent); }
.svc-areas-list { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 7px; font-size: 14.5px; }
.svc-areas-list li { display: flex; align-items: center; gap: 8px; }
.svc-areas-list .i { color: var(--ok); }

/* ---------- the request form ---------- */
.svc-form { display: grid; gap: 14px; background: var(--surface); border-radius: var(--radius); padding: 18px; }
.svc-form .f { display: grid; gap: 6px; font-size: 14px; }
.svc-form .f > span { font-weight: 600; display: flex; align-items: center; gap: 6px; }
.svc-form input[type="text"], .svc-form input[type="tel"], .svc-form input[type="date"],
.svc-form select, .svc-form textarea {
    width: 100%; height: 48px; padding: 0 14px; border: 1px solid var(--line);
    border-radius: 12px; background: var(--bg); transition: border-color .15s, box-shadow .15s;
}
.svc-form textarea { height: auto; padding: 12px 14px; resize: vertical; line-height: 1.6; }
.svc-form :is(input, select, textarea):focus {
    outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}
.file-drop { display: block; cursor: pointer; }
.file-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-face {
    display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 12px;
    border: 1px dashed var(--line); border-radius: 12px; background: var(--bg); color: var(--muted);
    transition: border-color .15s, color .15s;
}
.file-drop:hover .file-face, .file-drop input:focus-visible + .file-face { border-color: var(--accent); color: var(--accent); }
.file-face b { font-weight: 600; }
.svc-form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
/* off-screen positioning would widen the page in RTL: clip it instead */
.svc-form .hp { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@media (min-width: 700px) {
    .svc-form { grid-template-columns: 1fr 1fr; padding: 22px; gap: 16px; }
    .svc-form .wide, .svc-form .svc-form-foot { grid-column: 1 / -1; }
}

.svc-error { background: color-mix(in srgb, var(--danger) 10%, transparent); color: var(--danger); padding: 12px 14px; border-radius: 12px; margin-bottom: 12px; font-size: 14.5px; }
.svc-sent { text-align: center; background: var(--surface); border-radius: var(--radius); padding: 28px 18px; margin-top: 22px; }
.svc-sent h2 { margin: 12px 0 6px; font-size: 20px; }
.svc-sent p { margin: 0; color: var(--muted); }
.svc-sent-tick { display: grid; place-items: center; width: 54px; height: 54px; margin: 0 auto; border-radius: 50%; background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.svc-ref { margin-top: 10px !important; }
.svc-ref b { color: var(--text); letter-spacing: .08em; }
.svc-sent .btn { margin-top: 14px; background: var(--surface-2); }


/* ---------- craftsman site: trust badges, hero on phones, before / after (2026-11-11) ---------- */
.svc-badges { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.svc-badges li {
    display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px;
    background: var(--surface); border: 1px solid var(--line); font-size: 14px; font-weight: 600; line-height: 1.2;
}
.svc-badges li svg { color: var(--accent); flex-shrink: 0; }
.svc-cta .svc-wa { border-color: #25D366; color: #128C7E; }
@media (max-width: 859px) {
    /* phones: the best photo first, then the name and the buttons */
    .svc-hero-art { order: -1; margin-inline: calc(var(--gutter, 16px) * -1); border-radius: 0; box-shadow: none; }
    .svc-hero-art img { aspect-ratio: 16 / 10; }
    .svc-hero { padding-top: 0; }
    .svc-cta .btn { flex: 1 1 calc(50% - 5px); justify-content: center; }
    .svc-cta .btn.primary { flex-basis: 100%; }
}

.svc-ba-grid { display: grid; gap: 14px; }
@media (min-width: 700px) { .svc-ba-grid { grid-template-columns: repeat(2, 1fr); gap: 18px; } }
.svc-ba-grid figure { margin: 0; }
.svc-ba-grid figcaption { margin-top: 8px; font-size: 14.5px; }
.svc-ba { position: relative; border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 3; background: var(--surface); user-select: none; touch-action: pan-y; }
.svc-ba img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.svc-ba-before { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.svc-ba-line { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 3px; margin-left: -1.5px; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.15); pointer-events: none; }
.svc-ba-line span {
    position: absolute; top: 50%; left: 50%; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%;
    background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.25);
}
.svc-ba-line span::before, .svc-ba-line span::after {
    content: ""; position: absolute; top: 50%; width: 0; height: 0; margin-top: -6px; border: 6px solid transparent;
}
.svc-ba-line span::before { left: 5px; border-right-color: #444; }
.svc-ba-line span::after { right: 5px; border-left-color: #444; }
.svc-ba-tag {
    position: absolute; top: 10px; padding: 4px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700;
    background: rgba(0,0,0,.55); color: #fff; pointer-events: none;
}
.svc-ba-tag.b { left: 10px; }
.svc-ba-tag.a { right: 10px; }
.svc-ba input[type=range] { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; -webkit-appearance: none; appearance: none; }

/* =========================================================
   Store design v3 (2026-11-11): hero banners, category circles,
   header category menu, 5 templates, 4 fonts
   ========================================================= */

/* ---------- fonts (stores.font_name) ---------- */
:root { --font-head: var(--font); }
[data-font="cairo"]   { --font: 'Cairo', system-ui, -apple-system, sans-serif; }
[data-font="tajawal"] { --font: 'Tajawal', 'Inter', system-ui, -apple-system, sans-serif; }
[data-font="elegant"] { --font: 'Inter', 'Noto Naskh Arabic', system-ui, sans-serif; --font-head: 'Playfair Display', 'Noto Naskh Arabic', Georgia, serif; }
[data-font="elegant"][dir="rtl"] { --font: 'Noto Naskh Arabic', 'Inter', system-ui, sans-serif; }
h1, h2, .brand-name, .hero-text h2 { font-family: var(--font-head); }

/* ---------- hero: full-width slides with an optional title and button ---------- */
.banners.hero { margin: 14px 0 4px; gap: 0; border-radius: var(--radius); }
.banners.hero > .slide-hero { flex: 0 0 100%; max-width: none; position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); }
.banners.hero > .slide-hero.has-text { aspect-ratio: 4 / 3; }
.slide-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.slide-hero.has-text::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(to top, rgba(0,0,0,.62) 0%, rgba(0,0,0,.25) 45%, rgba(0,0,0,0) 75%);
}
.slide-link { position: absolute; inset: 0; z-index: 2; }
.hero-text { position: absolute; z-index: 2; inset-inline: 18px; bottom: 18px; color: #fff; max-width: 560px; }
.hero-text h2 { margin: 0; font-size: clamp(22px, 6vw, 44px); line-height: 1.15; font-weight: 700; letter-spacing: -.01em; }
.hero-text p { margin: 6px 0 0; font-size: clamp(14px, 3.6vw, 18px); opacity: .92; }
.hero-text .btn { margin-top: 14px; }
@media (min-width: 860px) {
    .banners.hero { margin-top: 20px; }
    .banners.hero > .slide-hero, .banners.hero > .slide-hero.has-text, .banners.hero > *:not(:only-child) { flex-basis: 100%; aspect-ratio: 21 / 8; border-radius: 20px; }
    .hero-text { inset-inline: 48px; bottom: 44px; }
    .slide-hero.has-text::after { background: linear-gradient(to var(--hero-dir, left), rgba(0,0,0,.6) 0%, rgba(0,0,0,.25) 45%, rgba(0,0,0,0) 70%); }
    [dir="rtl"] .slide-hero.has-text::after { --hero-dir: left; }
    [dir="ltr"] .slide-hero.has-text::after { --hero-dir: right; }
}

/* ---------- category circles (story style on phones) ---------- */
.cat-circles { display: flex; gap: 14px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: none; scroll-snap-type: x proximity; }
.cat-circles::-webkit-scrollbar { display: none; }
.cat-circle { flex: 0 0 auto; width: 76px; display: flex; flex-direction: column; align-items: center; gap: 7px; text-align: center; scroll-snap-align: start; }
.cc-img {
    width: 72px; height: 72px; border-radius: 50%; overflow: hidden; display: grid; place-items: center;
    background: var(--surface); color: var(--muted); padding: 3px;
    box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px color-mix(in srgb, var(--accent) 55%, transparent);
}
.cc-img img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.cc-name { font-size: 13px; font-weight: 600; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cat-circle:hover .cc-img { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); }
@media (min-width: 860px) {
    .cat-circles { flex-wrap: wrap; overflow: visible; gap: 22px; justify-content: flex-start; }
    .cat-circle { width: 104px; }
    .cc-img { width: 96px; height: 96px; }
}

/* ---------- header category menu (desktop) ---------- */
.catnav { display: none; }
@media (min-width: 860px) {
    .catnav { display: block; border-top: 1px solid var(--line); }
    .catnav .wrap { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; height: 44px; align-items: center; }
    .catnav a { white-space: nowrap; padding: 7px 12px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--muted); }
    .catnav a:hover, .catnav a.on { color: var(--text); background: var(--surface); }
}
#shop { scroll-margin-top: 120px; }
.section-head h2 .i { color: var(--accent); align-self: center; }

/* ---------- templates (stores.theme_name) ---------- */

/* fashion: monochrome, sharp corners, tall photos, quiet cards */
[data-tpl="fashion"] { --radius: 4px; --radius-sm: 2px; --surface: #F4F4F2; --surface-2: #EBEBE8; --text: #111111; --muted: #6B6B6B; --line: #E7E7E4; }
[data-tpl="fashion"] .card-media { aspect-ratio: 3 / 4; border: 0; border-radius: var(--radius); box-shadow: none; }
[data-tpl="fashion"] .btn { border-radius: 2px; letter-spacing: .02em; }
[data-tpl="fashion"] .section-head h2 { text-transform: uppercase; letter-spacing: .08em; font-size: 15px; font-weight: 600; }
[data-tpl="fashion"][dir="rtl"] .section-head h2 { letter-spacing: 0; font-size: 18px; }
[data-tpl="fashion"] .cc-img { border-radius: 4px; box-shadow: none; padding: 0; width: 84px; height: 112px; }
[data-tpl="fashion"] .cc-img img { border-radius: 4px; }
[data-tpl="fashion"] .cat-circle { width: 84px; }
@media (min-width: 860px) {
    [data-tpl="fashion"] .card { border: 0; padding: 0; box-shadow: none; background: transparent; }
    [data-tpl="fashion"] .card .card-media { border-radius: var(--radius); }
    [data-tpl="fashion"] .cc-img { width: 132px; height: 176px; }
    [data-tpl="fashion"] .cat-circle { width: 132px; }
}

/* beauty: soft blush tones, very round, portrait photos */
[data-tpl="beauty"] { --bg: #FFFBFA; --surface: #FBEFEB; --surface-2: #F6E3DD; --line: #F1E1DC; --text: #2B1B1E; --muted: #85696E; --radius: 22px; --radius-sm: 16px; }
[data-tpl="beauty"] .card-media { aspect-ratio: 4 / 5; border-color: transparent; }
[data-tpl="beauty"] .btn { border-radius: 999px; }
[data-tpl="beauty"] .badge { border-radius: 999px; }
@media (min-width: 860px) { [data-tpl="beauty"] .card { border-color: transparent; background: #fff; border-radius: 26px; } }

/* tech: dark, crisp borders, square photos on white for products */
[data-tpl="tech"] { --radius: 12px; --radius-sm: 8px; }
[data-tpl="tech"] .card-media { background: #fff; border-color: var(--line); }
[data-tpl="tech"] .card-media img { object-fit: contain; padding: 8%; }
[data-tpl="tech"] .section-head h2 { font-weight: 700; }
[data-tpl="tech"] .cc-img { border-radius: 16px; background: #fff; box-shadow: 0 0 0 1px var(--line); }
[data-tpl="tech"] .cc-img img { border-radius: 12px; object-fit: contain; }

/* grocery: bright, compact, 3 products per row on phones, packshots on white */
[data-tpl="grocery"] { --surface: #F2F7EF; --surface-2: #E6F0E1; --line: #E3ECDE; --radius: 16px; }
[data-tpl="grocery"] .card-media { background: #fff; }
[data-tpl="grocery"] .card-media img { object-fit: contain; padding: 6%; }
[data-tpl="grocery"] .cc-img { background: #fff; }
[data-tpl="grocery"] .cc-img img { object-fit: contain; }
@media (max-width: 599px) {
    [data-tpl="grocery"] .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
    [data-tpl="grocery"] .card-name { font-size: 13px; }
    [data-tpl="grocery"] .hrow { grid-auto-columns: 31%; }
}
