/* WebMobile (W3): product, checkout, cart, account, orders, track, login/register — mobile only (< 768px). */

/* Mobile-only markup stays hidden on desktop and tablet. */
.bt-pbar-wa,
.bt-co-sumtoggle,
.bt-ckh-safe{display:none}

@media (max-width: 767.98px) {
  /* ---------- د. المنتج ---------- */
  .bt-pview{padding-top:0!important;padding-bottom:24px!important}
  .bt-pcrumb{padding:10px 0;font-size:12.5px!important;gap:6px!important}
  .bt-pview .bt-psec{margin:0 -16px!important;padding:0!important;gap:0!important;border-radius:0!important}
  .bt-pview .bt-gal{flex:1 1 100%!important;gap:0!important;flex-direction:column-reverse!important;background:#FFFFFF}
  .bt-pview .bt-gal-main{flex:none!important;width:100%;height:300px;aspect-ratio:auto!important;border-radius:0!important}
  .bt-pview .bt-thumbs{flex-direction:row!important;gap:8px!important;padding:10px 16px;max-height:none!important;overflow-x:auto!important;overflow-y:hidden!important}
  .bt-pview .bt-thumbs > button{width:56px!important;height:56px!important;border-radius:10px!important}
  .bt-pview .bt-pv{flex:1 1 100%!important;padding:14px 16px;gap:10px!important}
  .bt-pview .bt-ptitle{font-size:19px!important}
  .bt-pview .bt-price-lg{font-size:24px}
  .bt-pview .bt-pv > div[style*="border-top"]{padding:8px 0!important}

  /* Fixed bottom bar: qty + «أضف للسلة» + WhatsApp (replaces the bottom nav). */
  .bt-pview .bt-pbar{position:fixed;left:0;right:0;bottom:0;z-index:55;flex-wrap:nowrap!important;gap:8px!important;background:#FFFFFF;border-top:1px solid #E0D9CE;padding:10px 12px calc(10px + env(safe-area-inset-bottom));box-sizing:border-box}
  .bt-pview .bt-pbar-qty{height:48px!important;border-width:1px!important;flex-shrink:0}
  .bt-pview .bt-pbar-qty button{width:44px!important}
  .bt-pview .bt-pbar-qty span{min-width:22px!important;font-size:15px!important}
  .bt-pview .bt-pbar .bt-add{flex:1 1 auto!important;height:48px!important;font-size:15.5px!important;min-width:0}
  .bt-pbar-wa{display:flex;width:48px;height:48px;border-radius:12px;background:#25D366;align-items:center;justify-content:center;flex-shrink:0}
  body:has(.bt-pbar) #bt-wa-fab{display:none!important}
  body:has(.bt-pbar){padding-bottom:72px}

  /* ---------- هـ. إتمام الطلب ---------- */
  .bt-ckh-in{padding:0 12px!important;gap:0!important;justify-content:space-between!important}
  .bt-ckh-in > a, .bt-ckh-in > :first-child{min-height:60px;display:flex;align-items:center}
  .bt-ckh-in .bt-steps{order:3;flex:1 1 100%;margin:0 -12px!important;padding:12px 16px!important;border-top:1px solid #E0D9CE;font-size:13px!important;gap:8px!important}
  .bt-ckh-in .bt-steps .bar{flex:1;width:auto!important}
  .bt-ckh-in .bt-steps .n{width:24px!important;height:24px!important;font-size:12px!important}
  .bt-co-page .bt-ckh-safe{display:flex;align-items:center;gap:6px;font-size:12.5px;color:#1E6B45;order:2}

  .bt-co-page > main.bt-wrap{padding-top:0!important;padding-bottom:96px!important}
  .bt-co-grid{flex-direction:column;align-items:stretch!important;gap:12px!important}
  .bt-co-steps{flex:none!important;width:100%;padding-top:14px}
  .bt-co-aside{order:-1;flex:none!important;max-width:none!important;position:static!important;margin:0 -16px;width:auto!important;border-radius:0!important;padding:0!important;gap:0!important;background:#F7F4EF!important;border-bottom:1px solid #E0D9CE}
  .bt-co-sumtoggle{display:flex;width:100%;height:52px;background:#F7F4EF;border:0;font-family:inherit;color:#1C1C1C;align-items:center;justify-content:space-between;padding:0 16px;font-size:14px;cursor:pointer}
  .bt-co-sum{display:none!important;background:#FFFFFF;padding:14px 16px}
  .bt-co-sum.open{display:flex!important}
  .bt-co-aside > span:last-child{padding:10px 16px}

  /* Fixed bottom button: the address step's submit, then «تأكيد الطلب». */
  body[data-bt-step="address"] .bt-co-next,
  body:not([data-bt-step="address"]) .bt-co-aside > .bt-co-place{position:fixed;left:0;right:0;bottom:0;z-index:55;background:#FFFFFF;border-top:1px solid #E0D9CE;padding:12px 16px calc(12px + env(safe-area-inset-bottom));box-sizing:border-box}
  body[data-bt-step="address"] .bt-co-next .bt-b{width:100%;height:48px}
  body[data-bt-step="address"] .bt-co-aside > .bt-co-place{display:none}
  body:not([data-bt-step="address"]) .bt-co-aside > .bt-co-place{height:auto!important;border-radius:0!important;border-top:1px solid #E0D9CE!important}
  .bt-co-page #bt-wa-fab{display:none!important}

  .bt-co-steps [role="tablist"]{grid-template-columns:1fr 1fr!important}
  .bt-co-steps [role="radiogroup"]{grid-template-columns:1fr!important}
  /* Address form grid: minmax(240px,1fr) overflowed narrow cards (240 > 224 at 320px). */
  .bt-co-steps form [style*="minmax(240px"]{grid-template-columns:minmax(0,1fr)!important}
  .bt-co-steps .bt-fld{min-width:0}

  /* ---------- Cart (AppCheckout.dc.html screen 6) ---------- */
  /* Only the main header + steps bar: hide the checkout logo header row. */
  .bt-cart-page .bt-ckh-in > :not(.bt-steps){display:none!important}
  .bt-cart-page .bt-ckh-in .bt-steps{border-top:0!important}

  .bt-cart-page > main.bt-wrap{padding:16px 16px 24px!important}
  .bt-cart-h1{font-size:19px!important;margin:0 0 12px!important}
  .bt-cart-h1 > span{font-size:14px!important}

  /* Overflow fix: flex items must be allowed to shrink below their min-content. */
  .bt-cart-grid{flex-direction:column!important;flex-wrap:nowrap!important;align-items:stretch!important;gap:10px!important;min-width:0}
  .bt-cart-items{flex:none!important;width:100%;gap:10px!important}
  .bt-cart-cont{display:none!important}

  /* Item card: 76px image | name, option, price + qty | delete */
  .bt-cart-page .bt-ci{display:grid!important;grid-template-columns:76px minmax(0,1fr) auto auto;grid-template-areas:"img info info del" "img price qty qty";column-gap:12px!important;row-gap:4px!important;align-items:center!important;padding:10px!important;border:1px solid #E0D9CE;border-radius:16px!important}
  .bt-cart-page .bt-ci-img{grid-area:img;align-self:start;width:76px!important;height:76px!important;border-radius:12px!important}
  .bt-cart-page .bt-ci-info{grid-area:info;align-self:start;min-width:0;gap:4px!important}
  .bt-cart-page .bt-ci-name{font-size:13.5px!important;font-weight:400!important;line-height:1.45!important;overflow-wrap:anywhere}
  .bt-cart-page .bt-ci-opt{font-size:12px!important;color:#8A8178!important;overflow-wrap:anywhere}
  .bt-cart-page .bt-ci-stock,
  .bt-cart-page .bt-ci-unit{display:none!important}
  .bt-cart-page .bt-ci-price{grid-area:price;min-width:0!important;text-align:right!important;gap:0!important}
  .bt-cart-page .bt-ci-price > span:first-of-type{font-size:15px!important;font-weight:700!important;color:#1C1C1C;line-height:1.3}
  .bt-cart-page .bt-ci-qty{grid-area:qty;justify-self:end;height:34px!important;border:1px solid #E0D9CE!important;border-radius:10px!important;box-sizing:border-box}
  .bt-cart-page .bt-ci-qty > button{width:34px!important;height:34px!important;margin:-1px 0;font-size:18px!important;color:#1C1C1C;padding:0;display:flex;align-items:center;justify-content:center}
  .bt-cart-page .bt-ci-qty > span{min-width:18px!important;width:18px;font-size:14px!important;font-weight:700!important}
  .bt-cart-page .bt-ci-del{grid-area:del;align-self:start;justify-self:end;width:44px!important;height:44px!important;border-radius:12px!important;background:transparent!important;color:#1C1C1C;margin:-8px 0 0 -8px;padding:0}
  .bt-cart-page .bt-ci-del svg{width:20px;height:20px;stroke:#1C1C1C}

  /* Summary card: المجموع + التوصيل */
  .bt-cart-sum{flex:none!important;width:100%!important;min-width:0;max-width:none!important;position:static!important;padding:14px!important;gap:8px!important;border:1px solid #E0D9CE;font-size:14px}
  .bt-cart-sum-title,
  .bt-cart-sum-note{display:none!important}
  .bt-coupon-form input{width:0}
  .bt-cart-sum .bt-coupon-form input,
  .bt-cart-sum .bt-coupon-form button{height:40px!important}
  .bt-cart-sum-rows{gap:8px!important;padding-top:8px!important;font-size:14px!important}
  .bt-cart-sum-rows > div > span:first-child{color:#6E6458}
  .bt-cart-sum-rows > div > span:last-child{font-weight:400!important}

  /* Fixed bottom bar (total + «إتمام الطلب») above the 68px bottom nav. */
  .bt-cart-bar{display:flex!important;flex-direction:column;gap:10px;position:fixed;left:0;right:0;bottom:calc(68px + env(safe-area-inset-bottom));z-index:65;background:#FFFFFF;border-top:1px solid #E0D9CE;padding:12px 16px;box-sizing:border-box}
  body.bt-mnav-hidden .bt-cart-bar{bottom:0;padding-bottom:calc(12px + env(safe-area-inset-bottom))}
  .bt-cart-bar-total{padding-top:0!important;border-top:0!important;align-items:center!important;gap:10px}
  .bt-cart-bar-total > span:first-child{font-size:14px!important;font-weight:400!important;color:#6E6458}
  .bt-cart-bar-total > span:last-child{font-size:20px!important;font-weight:700!important}
  .bt-cart-bar-btn{height:48px!important;font-size:15.5px!important;width:100%}
  .bt-cart-page:has(.bt-cart-bar){padding-bottom:124px}
  body:has(.bt-cart-bar) #bt-wa-fab{display:none!important}

  /* ---------- Account / orders ---------- */
  .bt-page > main[style*="max-width: 1360px"],
  .bt-page > main[style*="max-width: 1100px"]{padding:16px 16px 32px!important;gap:14px!important}
  .bt-acc-aside{flex:1 1 100%!important;max-width:none!important;padding:14px!important;flex-direction:row!important;flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;gap:8px!important}
  .bt-acc-aside > div:first-child{display:none!important}
  .bt-acc-aside .bt-acc-link{flex-shrink:0;white-space:nowrap;margin-top:0!important}
  .bt-acc-aside + div{flex:1 1 100%!important}
  .bt-page table{display:block;overflow-x:auto}

  /* ---------- Login / register / track ---------- */
  .bt-auth{flex-direction:column}
  .bt-auth .bt-auth-brand{flex:none!important;min-height:180px!important;padding:20px 16px!important}
  .bt-auth > section{flex:none!important;padding:24px 16px 32px!important}
  .bt-auth [style*="grid-template-columns: repeat(2"]{grid-template-columns:1fr!important}
}
