/* Cart, checkout, customer account and staff portal. Store palette from design-system.css. */
/* 2026-11-27 interface batch (review item 7): these pages are light only. `only light` (here and in each page's meta) is
   Chrome's documented opt-out from its automatic dark theme on Android. NOT proven in the lab: Chromium's
   WebContentsForceDark flag darkens the page whatever the declaration (verification/ui-cart-search-20261127/
   forced-dark-probe/); only a real phone can confirm it. Samsung Internet's own darkening is outside our control. */
:root{color-scheme:only light}
.commerce-page{--c-green:#123d32;--c-green-2:#1e5142;--c-gold:#a88a50;--c-ink:#172522;--c-muted:#53665e;--c-line:#dce2dd;--c-soft:#edf2ee;--c-paper:#f7f5ef;--c-red:#9b2525;max-width:1100px;margin-inline:auto;padding-bottom:7rem}
.commerce-heading{padding:clamp(1rem,4vw,2.4rem) 0 .6rem}.commerce-heading h1{font-size:clamp(1.8rem,5vw,3rem);margin:.25rem 0}.commerce-heading p{max-width:65ch;color:var(--c-muted)}
.commerce-muted{color:var(--c-muted)}
.commerce-steps{list-style:none;display:flex;gap:.4rem;margin:0 0 1rem;padding:0;counter-reset:s}
.commerce-steps li{flex:1;display:flex;align-items:center;gap:.45rem;padding:.55rem .7rem;border:1px solid var(--c-line);border-radius:999px;background:#fff;color:var(--c-muted);font-size:.92rem;min-width:0}
.commerce-steps li b{display:inline-grid;place-items:center;width:1.6rem;height:1.6rem;border-radius:50%;background:var(--c-soft);color:var(--c-green);flex:none}
.commerce-steps li span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.commerce-steps li[aria-current]{border-color:var(--c-green);color:var(--c-green);font-weight:700;box-shadow:0 0 0 1px var(--c-gold) inset}
.commerce-steps li[aria-current] b{background:var(--c-green);color:#fff}
.commerce-notice{padding:.8rem 1rem;border-radius:12px;background:var(--c-soft);border:1px solid var(--c-line);margin:0 0 1rem;font-weight:600}
.commerce-notice[data-kind=error]{background:#fbefef;border-color:#e3c3c3;color:var(--c-red)}
.commerce-notice[data-kind=success]{background:#eaf4ee;border-color:#b9d6c4;color:var(--c-green)}
/* 2026-11-18 PAY-09: a message stays on the screen wherever the customer is on the page (it used to sit at the top,
   out of sight of the form and the payment panel). On the cart page a tap closes it. */
.commerce-notice{position:sticky;top:.6rem;z-index:45;box-shadow:0 6px 18px rgba(0,0,0,.08)}
#shopNotice{display:flex;gap:.6rem;justify-content:space-between;align-items:flex-start;cursor:pointer}
#shopNotice[hidden]{display:none}
#shopNotice::after{content:"×";flex:none;font-size:1.3rem;line-height:1.1;opacity:.6}
.commerce-fields input,.commerce-fields select,.commerce-fields textarea,.commerce-choice label,.commerce-consent,.commerce-consent input{scroll-margin-top:7rem}
html:has(#shopNotice){scroll-padding-top:7rem}
.commerce-layout{display:grid;grid-template-columns:minmax(0,1.7fr) minmax(260px,1fr);gap:1rem;align-items:start}
.commerce-page .ds-card{padding:clamp(1rem,3vw,1.5rem)}
.commerce-line{display:grid;grid-template-columns:88px minmax(0,1fr) auto;gap:.8rem;align-items:center;border-bottom:1px solid var(--c-line);padding:.9rem 0}
.commerce-line.has-issue{background:linear-gradient(90deg,transparent,#fbefef)}
.commerce-thumb{width:88px;height:66px;border-radius:10px;background:var(--c-soft);overflow:hidden;display:block}
.commerce-thumb img{width:100%;height:100%;object-fit:cover;display:block}
.commerce-line h3{margin:0;font-size:1rem;line-height:1.45}.commerce-line h3 a{color:var(--c-ink);text-decoration:none}
.commerce-line-meta{margin:.2rem 0 0;color:var(--c-muted);font-size:.9rem}
.commerce-line-actions{display:flex;flex-direction:column;align-items:flex-end;gap:.4rem}
.commerce-line-total{white-space:nowrap}
.commerce-stepper{display:inline-flex;align-items:center;border:1px solid #acbbb1;border-radius:999px;overflow:hidden;background:#fff}
.commerce-stepper button{width:44px;height:44px;border:0;background:transparent;font-size:1.3rem;color:var(--c-green);cursor:pointer}
.commerce-stepper button:disabled{color:#b7c2bc;cursor:not-allowed}
.commerce-stepper output{min-width:2.2rem;text-align:center;font-weight:700}
.commerce-remove,.commerce-link{background:none;border:0;color:var(--c-red);text-decoration:underline;cursor:pointer;min-height:44px;min-width:44px;display:inline-flex;align-items:center;justify-content:center;font:inherit;padding:0 .2rem}
.commerce-link{color:var(--c-green)}
.commerce-empty{padding:1.2rem 0;text-align:center}
.summary-line{display:flex;justify-content:space-between;gap:1rem;border-bottom:1px solid var(--c-line);padding:.7rem 0}
.summary-line strong{white-space:nowrap}.summary-line.total{font-size:1.15rem;font-weight:700;border-bottom:0}
.commerce-checkout{margin-top:1rem}
.commerce-account{display:flex;flex-wrap:wrap;align-items:center;gap:.4rem;background:var(--c-paper);border:1px dashed var(--c-gold);border-radius:12px;padding:.75rem 1rem}
.commerce-choice{border:0;padding:0;margin:1rem 0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.7rem}
.commerce-choice legend{font-weight:700;margin-bottom:.5rem}
.commerce-choice label{display:flex;gap:.6rem;align-items:flex-start;border:1px solid var(--c-line);border-radius:14px;padding:.85rem;background:#fff;cursor:pointer}
.commerce-choice label:has(input:checked){border-color:var(--c-green);box-shadow:0 0 0 1px var(--c-gold) inset;background:var(--c-paper)}
.commerce-choice input{margin-top:.3rem;accent-color:var(--c-green);width:1.1rem;height:1.1rem}
.commerce-choice small{display:block;color:var(--c-muted);font-weight:400;margin-top:.15rem}
.commerce-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem}
.commerce-fields .commerce-wide{grid-column:1/-1}
.commerce-fields label{display:grid;gap:.35rem;font-weight:600}
.commerce-fields input,.commerce-fields select,.commerce-fields textarea{width:100%;box-sizing:border-box;border:1px solid #acbbb1;border-radius:10px;background:#fff;color:var(--c-ink);padding:.75rem;min-height:46px;font:inherit}
.commerce-fields input:focus,.commerce-fields select:focus,.commerce-fields textarea:focus{outline:2px solid #286c56;outline-offset:1px}
.commerce-fields button{justify-self:start;min-height:46px}
.commerce-consent{display:flex;gap:.5rem;align-items:flex-start;margin:1rem 0}.commerce-consent input{margin-top:.35rem;accent-color:var(--c-green)}
.commerce-submit{min-height:50px;min-width:220px}
.commerce-orders{margin-top:1.5rem}
.commerce-order{padding:1rem;margin:.8rem 0;border:1px solid var(--c-line);border-radius:14px;background:#fff}
.commerce-order header{display:flex;justify-content:space-between;align-items:center;gap:.6rem;flex-wrap:wrap}
.commerce-order h3{margin:0;font-size:1.05rem}
.commerce-order-items{margin:.6rem 0;padding-inline-start:1.1rem}
.commerce-order-sums{display:flex;flex-wrap:wrap;gap:.4rem 1.2rem;margin:.4rem 0}
.commerce-chip{display:inline-block;padding:.25rem .7rem;border-radius:999px;font-size:.85rem;font-weight:700;background:var(--c-soft);color:var(--c-green);border:1px solid var(--c-line)}
.commerce-chip[data-status=approved]{background:#fff6e3;border-color:#e6cf9d;color:#7a5b16}
.commerce-chip[data-status=paid],.commerce-chip[data-status^=ready],.commerce-chip[data-status=completed]{background:#e4f2e9;border-color:#b9d6c4}
.commerce-chip[data-status=cancelled]{background:#f2f2f2;color:#666}
.commerce-chip[data-status$=review]{background:#fbefef;border-color:#e3c3c3;color:var(--c-red)}
.commerce-actions{display:flex;gap:.6rem;flex-wrap:wrap;align-items:center;margin:.8rem 0 0}
.commerce-actions .ds-button{min-height:46px}
.commerce-timeline{list-style:none;margin:.8rem 0 0;padding:0 1rem 0 0;border-inline-start:2px solid var(--c-line)}
.commerce-timeline li{position:relative;padding:.3rem 0 .6rem;font-size:.92rem}
.commerce-timeline li::before{content:"";position:absolute;inset-inline-start:-1.42rem;top:.62rem;width:.7rem;height:.7rem;border-radius:50%;background:var(--c-gold)}
.commerce-timeline time{display:block;color:var(--c-muted);font-size:.85rem}
.commerce-payment{margin-top:1rem}
/* 2026-11-18 PAY-09: the gateway form types at 14 px, which makes an iPhone zoom the page on every field. */
.commerce-payment .mysr-form #mysr input{font-size:16px!important}
.commerce-sim-banner{background:repeating-linear-gradient(-45deg,#fff6e3,#fff6e3 10px,#fdf0d2 10px,#fdf0d2 20px);border:1px solid #e6cf9d;border-radius:10px;padding:.7rem 1rem;font-weight:700;color:#7a5b16}
.commerce-error{color:var(--c-red);margin:.3rem 0 0}
.commerce-page button:disabled{opacity:.55;cursor:not-allowed}
.commerce-sticky{display:none}
.cart-count{display:inline-grid;place-items:center;min-width:1.25rem;height:1.25rem;padding:0 .3rem;margin-inline-start:.3rem;border-radius:999px;background:#a88a50;color:#fff;font-size:.75rem;font-weight:700;line-height:1;vertical-align:middle}
.ds-mobile-nav a{position:relative}.ds-mobile-nav .cart-count{position:absolute;top:2px;inset-inline-end:calc(50% - 1.6rem);margin:0}
.cart-toast{position:fixed;inset-inline:1rem;bottom:calc(5.2rem + env(safe-area-inset-bottom));z-index:60;max-width:520px;margin-inline:auto;display:flex;gap:.8rem;align-items:center;justify-content:space-between;background:#123d32;color:#fff;border:1px solid #a88a50;border-radius:14px;padding:.8rem 1rem;box-shadow:0 10px 30px rgba(0,0,0,.2);transform:translateY(160%);transition:transform .25s ease}
.cart-toast.show{transform:none}.cart-toast-link{color:#f3e2b8;font-weight:700;white-space:nowrap}
.cart-add{min-height:42px}
.pid-item-row .cart-add{margin-inline-start:auto}
.product-cart-row{display:flex;gap:.6rem;flex-wrap:wrap;align-items:center;margin:.8rem 0}
@media(max-width:720px){
  .commerce-layout,.commerce-fields,.commerce-choice{grid-template-columns:1fr}
  .commerce-page{padding-inline:1rem}
  .commerce-line{grid-template-columns:64px minmax(0,1fr);gap:.6rem}
  .commerce-thumb{width:64px;height:52px}
  .commerce-line-actions{grid-column:1/-1;flex-direction:row;justify-content:space-between;align-items:center}
  .commerce-steps li span{font-size:.8rem}.commerce-steps li{padding:.45rem .5rem}
  /* 2026-11-27 stabilisation: at phone width the two longer step labels were cut with «…» (directive 07B, C6); they
     now wrap onto a second line inside their pill instead */
  .commerce-steps li{border-radius:1.2rem}.commerce-steps li span{white-space:normal;overflow:visible;text-overflow:clip;line-height:1.25;overflow-wrap:normal}
  .commerce-sticky:not([hidden]){display:flex;position:fixed;inset-inline:0;bottom:calc(4.4rem + env(safe-area-inset-bottom));z-index:40;justify-content:space-between;align-items:center;gap:1rem;padding:.6rem 1rem;background:#fff;border-top:1px solid var(--c-line);box-shadow:0 -6px 18px rgba(0,0,0,.06)}
  .commerce-sticky small{display:block;color:var(--c-muted)}
  .commerce-submit{width:100%}
  /* 2026-11-18 PAY-09: the total bar and the bottom menu cover about 8 rem of the screen; a field or button that
     receives the focus stops above them instead of under them. */
  .commerce-fields input,.commerce-fields select,.commerce-fields textarea,.commerce-consent input,.commerce-submit,.commerce-actions .ds-button,#paymentStart{scroll-margin-bottom:9rem}
  html:has(#stickyBar){scroll-padding-bottom:9rem}
}
/* Staff portal */
.staff-grid{display:grid;gap:1rem}
.staff-order{border:1px solid var(--c-line,#dce2dd);border-radius:14px;padding:1rem;background:#fff}
.staff-order header{display:flex;justify-content:space-between;gap:.6rem;flex-wrap:wrap;align-items:center}
.staff-order dl{display:grid;grid-template-columns:max-content 1fr;gap:.25rem .8rem;margin:.6rem 0}
.staff-order dt{color:#53665e}
.staff-tabs{display:flex;gap:.4rem;flex-wrap:wrap;margin:.6rem 0 1rem}
.staff-tabs button[aria-pressed=true]{background:#123d32;color:#fff}
.staff-matrix{width:100%;border-collapse:collapse;font-size:.9rem}
.staff-matrix th,.staff-matrix td{border-bottom:1px solid #dce2dd;padding:.45rem;text-align:start;vertical-align:top}
.staff-matrix td.yes{color:#123d32;font-weight:700}.staff-matrix td.no{color:#b7c2bc}
.staff-scroll{overflow-x:auto}
.commerce-summary[hidden],.ds-card[hidden]{display:none!important}
#shopAccount bdi,#accountState bdi{overflow-wrap:anywhere;word-break:break-all}

/* 2026-11-27 interface batch: the cart's one line on how the order proceeds (it replaced the dashed «trial» note) */
.commerce-how{margin:0 0 1rem;padding:.75rem 1rem;border-radius:12px;border:1px solid #cfdcd3;background:#edf2ee;color:#123d32;font-size:.95rem;line-height:1.7}

/* 2026-11-19: delivery is an owner switch; while it is off the pages say pickup from the shop only. */
.commerce-choice label[hidden]{display:none}
.commerce-pickup-only,.product-pickup,.stock-pickup{margin:.6rem 0;padding:.6rem .9rem;border-radius:12px;border:1px solid #cfdcd3;background:#edf2ee;color:#123d32;font-weight:700;font-size:.95rem;line-height:1.7}
.commerce-pickup-only{grid-column:1/-1;margin:0}
.commerce-pickup-only[hidden],.product-pickup[hidden],.stock-pickup[hidden]{display:none}
/* 2026-11-21: the hidden «added to cart» message no longer peeks over the phone's bottom bar (translateY(160%) left its top half visible). */
.cart-toast:not(.show){visibility:hidden;transition:transform .25s ease,visibility 0s linear .25s}.cart-toast.show{visibility:visible}
/* 2026-11-23 (owner phone test): consent refusal is shown at the boxes themselves; the form leaves room for the fixed bars. */
.commerce-consent.is-bad{outline:3px solid #b3261e;outline-offset:3px;border-radius:10px;background:#fdecea}
.commerce-consent-msg{color:#b3261e;font-weight:700;margin:.5rem 0 0}
@media(max-width:760px){html:has(#stickyBar:not([hidden])) #shopForm{padding-bottom:calc(9rem + env(safe-area-inset-bottom,0px))}}
/* 2026-11-27 interface batch (phone, measured at 360 and 390 by dev/ui-cart-search/screens_cart.cjs): the cart page's
   own small fixes. Field borders 3.6:1 (the site-wide ivory field rule gave 1.45:1); the eyebrow 5.5:1 (4.3:1); the
   orders' muted line 5.8:1 on the section's beige (4.1:1); breadcrumb links and the quantity buttons at least 44 px. */
body.design-v1 .commerce-page .commerce-fields :is(input,select,textarea):not([type=checkbox]):not([type=radio]){border-color:#7a8a83}
body.design-v1 .commerce-page .commerce-heading .ds-eyebrow{color:#76603a!important}
.commerce-page .commerce-orders .commerce-muted{color:#3f5048}
.commerce-page .ds-breadcrumbs a{display:inline-flex;align-items:center;min-height:44px;min-width:44px}
.commerce-stepper button{flex:none;min-width:44px}
/* cart tester D2: in English at 360 the stepper (2 x 44 px + count) was squeezed to 113 px inside its 123 px of content and
   its overflow:hidden clipped up to 10 px of an end button; it keeps its own width now */
.commerce-stepper{flex:none}

/* ==== 29 Nov 2026 phone review, lane B (verification/mobile-ux/DEFECTS.md). Tap sizes are screen px under the store's
   root zoom: calc(var(--tap) / var(--site-scale)), with fallbacks for a page without site-scale.css. ==== */
/* D08: «added to cart» drops from the top of the screen, clear of the assistant button, the gift badge, the product's
   fixed button and the bottom menu (it covered «عرض السلة» at 360); «عرض السلة» is a real 44 px button. */
.cart-toast{top:calc(.75rem + env(safe-area-inset-top,0px));bottom:auto;z-index:80;transform:translateY(-160%);flex-wrap:wrap}
.cart-toast.show{transform:none}
.cart-toast>span{flex:1 1 12rem;min-width:0;line-height:1.6}
.cart-toast-link{display:inline-flex;align-items:center;justify-content:center;min-height:calc(var(--tap,44px) / var(--site-scale,1));min-width:calc(var(--tap,44px) / var(--site-scale,1));padding:0 1.1rem;border-radius:999px;background:#f3e2b8;color:#123d32;text-decoration:none}
.cart-toast-link:focus-visible{outline:3px solid #f3e2b8;outline-offset:3px}
/* D47: the count badge was white on gold 3.27:1; this darker gold gives 5.99:1 */
.cart-count{background:#7a5f2e}
/* D09: why the send button waits (a customer whose cart has a problem) */
.commerce-why{margin:.6rem 0;padding:.6rem .9rem;border-radius:10px;background:#fbefef;border:1px solid #e3c3c3;color:#9b2525;font-weight:600}
.commerce-why[hidden],#signInNext[hidden],#shopForm[hidden]{display:none}
#signInNext{margin:.6rem 0 0}
/* D10: the cart that could not be loaded */
.commerce-failed{display:grid;justify-items:center;gap:.4rem}
.commerce-failed-title{margin:0;font-weight:700;font-size:1.1rem;color:#9b2525}
.commerce-failed p{margin:0}
/* D31, D32: the fixed total bar is one compact line; it steps aside while the form is on screen and while the customer types */
@media(max-width:720px){
  .commerce-sticky:not([hidden]){padding:.35rem 1rem;gap:.75rem}
  .commerce-sticky>span{display:flex;align-items:baseline;gap:.45rem;min-width:0}
  .commerce-sticky small{display:inline}
  .commerce-sticky strong{white-space:nowrap}
  .commerce-sticky.is-near-form,.commerce-sticky.is-typing{display:none!important}
}
/* D33: «أجهزتي وطلباتي» leads a signed-out visitor to the sign-in first; the old-site linking note folds away */
.account-signin{margin:1rem 0}
.account-signin h2{margin-top:0}
.account-or{font-size:1.15rem;margin:1.5rem 0 .25rem}
.account-or[hidden]{display:none}
.account-old-site>summary{display:flex;align-items:center;min-height:calc(var(--tap,44px) / var(--site-scale,1));cursor:pointer;font-weight:600;color:#174a3b}
/* D29: the empty garage's own button to the add-car form */
.garage-empty,.garage-failed{display:grid;justify-items:center;gap:.6rem}
.garage-empty p,.garage-failed p{margin:0}
/* D31: the form's 9 rem bottom room was for the total bar, which now leaves while the form is on screen */
@media(max-width:760px){html:has(#stickyBar:not([hidden])) #shopForm{padding-bottom:calc(1rem + env(safe-area-inset-bottom,0px))}}
