/* WIZZ Native Design Foundation V16 — additive, scoped, no template replacement.
   Intended for public WIZZ Directory routes and the legacy account/vendor views.
   This file does not change cart, permissions, uploads or server behaviour. */
:root {
  --w16-orange: #c2410c;
  --w16-orange-deep: #9a3412;
  --w16-orange-soft: #fff3ea;
  --w16-canvas: #fafaf8;
  --w16-paper: #fff;
  --w16-ink: #171717;
  --w16-muted: #555555;
  --w16-line: #e9e5e1;
  --w16-success: #15803d;
  --w16-radius: 14px;
}
body[data-page] {
  --wd-accent: var(--w16-orange);
  --wd-bg: var(--w16-canvas);
  --wd-ink: var(--w16-ink);
  --wd-muted: var(--w16-muted);
  --wd-border: var(--w16-line);
  font-family: Tajawal, Cairo, Tahoma, Arial, sans-serif;
  color: var(--w16-ink);
  -webkit-tap-highlight-color: transparent;
}
body[data-page] :is(button,a,input,select,textarea,summary):focus-visible {
  outline: 3px solid #c2410c;
  outline-offset: 2px;
}
body[data-page] :is(button,a)[aria-disabled="true"],
body[data-page] button:disabled { opacity: .55; cursor: not-allowed; }
body[data-page] :is(.wd-main,.wd-business-list,.wd-home-list,.wd-item-grid,.wd-market-item-grid,.wd-account-panel) {min-width:0}
body[data-page] :is(.wd-card-link,.wd-feature-card-main,.wd-item-card,.wd-business-card) {min-width:0}
body[data-page] img {max-width:100%}
body[data-page] [hidden] {display:none!important}

/* Public top bar and search: keep WIZZ branding, no fixed-height traps. */
body[data-page]:not([data-page^="/p/"]):not([data-page^="/item/"]) .wd-header {
  background:#fff;
  border-block-end:1px solid var(--w16-line);
}
body[data-page]:not([data-page^="/p/"]):not([data-page^="/item/"]) .wd-head-inner { min-width:0;gap:9px }
body[data-page] .wd-mark {color:var(--w16-orange);font-weight:800;letter-spacing:.01em}
body[data-page] .wd-smart-search {border:1px solid var(--w16-line);background:#fff;box-shadow:none;border-radius:13px}
body[data-page] .wd-smart-search :is(input[type="search"],button) {min-height:44px}
body[data-page] .wd-smart-search>button[type="submit"] {background:var(--w16-orange);color:#fff;border-radius:10px}
body[data-page] .wd-smart-search input[type="search"] {min-width:0;background:transparent;color:var(--w16-ink)}
body[data-page] .wd-smart-search input[type="search"]::placeholder {color:#748393;opacity:1}

/* Cohesive section headings without moving content or injecting fake sections. */
body[data-page] :is(.wd-market-title,.wd-smart-heading,.wd-market-business-title,.wd-discover-heading) {min-width:0;gap:10px}
body[data-page] :is(.wd-market-title,.wd-smart-heading,.wd-market-business-title) h2 {color:var(--w16-ink);line-height:1.5;overflow-wrap:break-word}
body[data-page] :is(.wd-market-title,.wd-smart-heading) a {color:var(--w16-orange-deep);font-weight:800;text-decoration:none}
body[data-page] :is(.wd-discover-heading,.wd-market-title,.wd-smart-heading) p {color:var(--w16-muted)}
body[data-page] .wd-empty {background:#fff;border:1px dashed #e9e5e1;border-radius:var(--w16-radius);color:var(--w16-muted);line-height:1.8}
body[data-page] .wd-empty a {color:var(--w16-orange-deep);font-weight:800;text-decoration:underline;text-underline-offset:3px}

/* Sector and discover shortcuts: photos stay visible, cards maintain a touch target. */
body[data-page] .wd-sector-grid {min-width:0}
body[data-page] .wd-sector {min-width:0;text-decoration:none}
body[data-page] .wd-sector :is(span,small) {overflow-wrap:break-word}
body[data-page] :is(.wd-chips,.wd-discover-filters) {scroll-padding-inline:12px;overscroll-behavior-inline:contain}
body[data-page] :is(.wd-chips>a,.wd-filter-chip) {min-height:44px;display:inline-flex;align-items:center;justify-content:center;white-space:nowrap}
body[data-page] .wd-filter-chip.is-active {background:var(--w16-orange-soft);border-color:#f5bf9d;color:var(--w16-orange-deep)}

/* Directory results: no fake delivery info, uniform fallback/photo geometry. */
body[data-page] :is(.wd-business-card,.wd-feature-card) {border:1px solid var(--w16-line);border-radius:var(--w16-radius);box-shadow:none;background:#fff;overflow:hidden}
body[data-page] .wd-business-card .wd-card-body {min-width:0}
body[data-page] :is(.wd-feature-info,.wd-card-body-plus) strong {color:var(--w16-ink);line-height:1.5;overflow-wrap:anywhere}
body[data-page] :is(.wd-feature-sector,.wd-feature-area,.wd-card-body-plus>span) {color:var(--w16-muted);line-height:1.5}
body[data-page] :is(.wd-feature-cover,.wd-cover) {background:#f2f4f6}
body[data-page] :is(.wd-feature-cover,.wd-cover) img {width:100%;height:100%;object-fit:cover}
body[data-page] .wd-heart {min-width:44px;min-height:44px;display:grid;place-items:center;line-height:1;color:var(--w16-orange-deep)}
body[data-page] .wd-heart[aria-pressed="true"] {color:#be3155}
body[data-page] .wd-feature-actions {gap:8px}
body[data-page] .wd-feature-actions>a {min-height:44px;display:inline-flex;justify-content:center;align-items:center;border-radius:10px}

/* Products: stable image ratio, proper product text and accessible price/action. */
body[data-page] .wd-item-grid {min-width:0}
body[data-page] .wd-item-card {min-width:0;background:#fff;border:1px solid var(--w16-line);border-radius:var(--w16-radius);box-shadow:none;overflow:hidden}
body[data-page] .wd-item-card :is(.wd-item-body,.wizz-product-info-link) {min-width:0}
body[data-page] .wd-item-card :is(.wd-item-image,.wizz-product-media) {background:#f7f8fa;min-width:0;overflow:hidden}
body[data-page] .wd-item-card .wd-item-image img {object-fit:contain}
body[data-page] .wd-item-card :is(strong,h3,.wd-item-title) {color:var(--w16-ink);overflow-wrap:break-word;line-height:1.55}
body[data-page] .wd-item-card :is(.wd-item-price,.wizz-item-price) {color:var(--w16-orange-deep);font-weight:800}
body[data-page] .wd-item-card :is(button,[role="button"]) {min-height:44px}
body[data-page] .wd-more {min-height:44px;display:flex;align-items:center;justify-content:center;border-radius:11px}

/* Account's saved/follow/order rows: native list rhythm; no fake counters. */
body[data-page="/account"] .wd-main {min-width:0}
body[data-page="/account"] .wd-main>h1 {font-size:21px;line-height:1.4;margin-block:18px 12px;color:var(--w16-ink)}
body[data-page="/account"] .wd-tabs {display:flex;overflow-x:auto;gap:7px;max-width:100%;scrollbar-width:none;overscroll-behavior-inline:contain;scroll-snap-type:x proximity;padding-block:4px 9px}
body[data-page="/account"] .wd-tabs::-webkit-scrollbar {display:none}
body[data-page="/account"] .wd-tabs>button {scroll-snap-align:start;flex:0 0 auto;min-height:44px;padding-inline:14px;border-radius:999px;white-space:nowrap;font-size:13px}
body[data-page="/account"] .wd-tabs>button.is-active {background:var(--w16-orange-soft);border-color:#f4c5a9;color:var(--w16-orange-deep)}
body[data-page="/account"] .wd-account-panel:not([hidden]) {min-width:0;background:#fff;border:1px solid var(--w16-line);border-radius:var(--w16-radius);box-shadow:none;padding:16px}
body[data-page="/account"] .wd-account-panel>h2 {font-size:17px;margin:0 0 14px}
body[data-page="/account"] :is(#wd-account-favorites,#wd-account-follows,#wd-account-orders,#wd-account-inbox)>p {margin:0;padding:0;border-bottom:1px solid var(--w16-line)}
body[data-page="/account"] :is(#wd-account-favorites,#wd-account-follows,#wd-account-orders,#wd-account-inbox)>p:last-child {border-bottom:0}
body[data-page="/account"] :is(#wd-account-favorites,#wd-account-follows,#wd-account-orders,#wd-account-inbox)>p>a {display:inline-flex;align-items:center;min-height:52px;width:auto;max-width:100%;color:var(--w16-ink);font-weight:700;overflow-wrap:anywhere}

/* Forms/checkouts: strengthen control affordances without changing input semantics. */
body[data-page] :is(.wd-form,.wds-checkout) {min-width:0}
body[data-page] :is(.wd-form,.wds-checkout) label {min-width:0;line-height:1.65}
body[data-page] :is(.wd-form,.wds-checkout) :is(input:not([type="checkbox"]):not([type="radio"]),select,textarea) {width:100%;max-width:100%;min-width:0;min-height:44px;border-radius:11px;border-color:#e9e5e1;background:#fff;color:var(--w16-ink)}
body[data-page] :is(.wd-form,.wds-checkout) textarea {min-height:90px;resize:vertical}
body[data-page] :is(.wd-form,.wds-checkout) :is(button[type="submit"],.wd-primary) {min-height:48px;border-radius:11px;background:var(--w16-orange);color:#fff}
body[data-page] .wd-status[role="status"] {line-height:1.6;overflow-wrap:anywhere}
body[data-page^="/cart/"] :is(.wds-cart-items,.wds-checkout),
body[data-page^="/checkout/"] :is(.wds-cart-items,.wds-checkout) {min-width:0;border-radius:var(--w16-radius);border-color:var(--w16-line);box-shadow:none}

/* Product detail retains original gallery and cart handlers, removes harsh accents. */
body[data-page^="/item/"] .wz-item-detail {background:#fff;color:var(--w16-ink)}
body[data-page^="/item/"] .wz-item-content>h1 {font-family:Tajawal,Cairo,Tahoma,sans-serif;color:var(--w16-ink);font-weight:800;line-height:1.5}
body[data-page^="/item/"] .wz-item-price-sign {background:var(--w16-orange-soft);color:var(--w16-ink);border:1px solid #f8d5c1;border-radius:12px;clip-path:none;max-width:100%}
body[data-page^="/item/"] .wz-item-price-primary {color:var(--w16-orange-deep)}
body[data-page^="/item/"] .wz-item-merchant {border-inline-start-color:var(--w16-orange);background:#fff9f5}
body[data-page^="/item/"] .wz-item-visit {color:var(--w16-orange-deep);border-color:#edb997}
body[data-page^="/item/"] .wz-item-gallery-slide img {object-fit:contain}

/* Storefront V12/V13 CSS is intentionally not replaced. Only benign tokens/contrast. */
body[data-page^="/p/"] {--wz-brand:#c74706;--wz-paper:#f7f8fa;--wz-ink:#152532;--wz-line:#e5e9ed}
body[data-page^="/p/"] :is(.wz-d-section-heading h2,.wz-d-map h3) {color:var(--w16-ink)}
body[data-page^="/p/"] :is(.wz-d-description,.wz-d-details dd) {line-height:1.7}
body[data-page^="/p/"] :is(.wz-d-direction,.wz-d-contact a) {min-height:44px}

/* Legacy admin/vendor only: gentle controls; V3/V4 standalone panels untouched. */
body[data-page="/directory-admin"] .wd-account-panel:not([hidden]),
body[data-page="/directory-vendor"] .wd-account-panel:not([hidden]) {background:#fff;border:1px solid var(--w16-line);border-radius:var(--w16-radius);padding:16px;box-shadow:none}
body[data-page="/directory-admin"] .wd-tabs,
body[data-page="/directory-vendor"] .wd-tabs {max-width:100%;overflow-x:auto;scrollbar-width:none;gap:7px}
body[data-page="/directory-admin"] .wd-tabs>button,
body[data-page="/directory-vendor"] .wd-tabs>button {min-height:44px;flex:0 0 auto}

/* Native bottom navigation stays intact, with safer hit targets. */
body[data-page] .wd-bottom {background:#fff;border-block-start:1px solid var(--w16-line);box-shadow:0 -3px 14px rgba(16,32,45,.035)}
body[data-page] .wd-bottom>a {min-height:52px;min-width:0;display:flex;align-items:center;justify-content:center;line-height:1.35;text-align:center}
body[data-page] .wd-bottom>a[aria-current="page"] {color:var(--w16-orange-deep);font-weight:800}
@media(max-width:430px) {
  body[data-page]:not([data-page^="/item/"]):not([data-page^="/p/"]) .wd-main {min-width:0}
  body[data-page] :is(.wd-market-title,.wd-smart-heading) h2 {font-size:17px}
  body[data-page] .wd-feature-actions>a {padding-inline:8px}
  body[data-page="/account"] .wd-account-panel:not([hidden]) {padding:14px 12px}
  body[data-page] .wd-bottom>a {font-size:11px}
}
@media(min-width:820px) {
  body[data-page="/account"] .wd-account-panel:not([hidden]) {padding:24px}
  body[data-page^="/cart/"] .wds-cart-layout,
  body[data-page^="/checkout/"] .wds-cart-layout {gap:20px}
}
@media(prefers-reduced-motion:reduce) {
  body[data-page] :is(.wd-tabs,.wd-discover-filters,.wd-chips) {scroll-behavior:auto}
}