/* Online store, order tracking and the delivery person's page (with public-page.css) */
body.store-page,body.track-page{padding:0 0 calc(40px + env(safe-area-inset-bottom))}
.store{max-width:1080px;margin:0 auto;padding:0 16px}
.store-head{position:sticky;top:0;z-index:5;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 0;background:color-mix(in srgb,var(--bg) 88%,transparent);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);border-bottom:1px solid var(--line)}
.store-brand{display:flex;align-items:center;gap:10px;min-width:0}
.store-brand img,.store-brand .mark{width:38px;height:38px;border-radius:8px;object-fit:cover;flex:none}
.store-brand strong{display:block;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.store-brand span{display:block;font-size:12px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:52vw}
.store-actions{display:flex;gap:8px;align-items:center}
.cart-btn,.chip-btn{text-decoration:none;display:inline-flex;align-items:center;gap:6px;height:40px;padding:0 14px;border-radius:999px;border:1px solid var(--line);background:var(--card);color:var(--text);font:inherit;font-size:13px;font-weight:600;cursor:pointer}
.cart-btn{background:var(--accent);border-color:var(--accent);color:#fff}
.cart-btn span{min-width:18px;text-align:center}
.store-hero{padding:26px 0 8px}.store-hero h1{font-size:clamp(24px,5vw,34px);letter-spacing:-.6px}
.store-note{font-size:13px;background:var(--card);border:1px solid var(--line);border-radius:8px;padding:10px 12px;margin-top:10px}
.store-tools{position:sticky;top:64px;z-index:4;display:flex;flex-direction:column;gap:10px;padding:10px 0;background:var(--bg)}
.field{font:inherit;font-size:14px;padding:11px 14px;border:1px solid var(--line);border-radius:8px;background:var(--card);color:var(--text);width:100%}
.cats{display:flex;gap:8px;overflow-x:auto;scrollbar-width:none}.cats::-webkit-scrollbar{display:none}
.cat{flex:none;height:34px;padding:0 14px;border-radius:999px;border:1px solid var(--line);background:var(--card);color:var(--text);font:inherit;font-size:13px;cursor:pointer}
.cat.on{background:var(--text);color:var(--card);border-color:var(--text)}
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(170px,1fr));gap:12px;padding:6px 0 20px}
.card{display:flex;flex-direction:column;text-align:left;border:1px solid var(--line);border-radius:12px;background:var(--card);color:var(--text);padding:0;overflow:hidden;cursor:pointer;font:inherit;transition:transform .15s,box-shadow .15s}
.card:hover{transform:translateY(-2px);box-shadow:0 8px 24px #0000000f}
.card .pic{aspect-ratio:1;background:var(--bg);display:grid;place-items:center;overflow:hidden}
.card .pic img{width:100%;height:100%;object-fit:cover}
.nopic{font-size:28px;font-weight:800;color:var(--accent);opacity:.5}
.card .info{display:flex;flex-direction:column;gap:2px;padding:10px 12px 12px}
.card small{font-size:12px;color:var(--muted)}.card strong{font-size:14px;line-height:1.3;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.price{font-weight:700;font-size:14px}.price s{color:var(--muted);font-weight:400;font-size:13px;margin-left:4px}.price.big{font-size:24px;margin:4px 0}
.stock{font-size:12px;color:var(--green);font-weight:600}.stock.low{color:var(--amber)}.stock.out{color:var(--red)}
.empty{color:var(--muted);font-size:14px;padding:30px 0;text-align:center;grid-column:1/-1}
.store-foot{display:flex;justify-content:space-between;gap:10px;flex-wrap:wrap;font-size:12px;color:var(--muted);padding:16px 0;border-top:1px solid var(--line)}.store-foot a{color:var(--accent)}
/* dialogs: full-height sheet on phones, centred card on wider screens */
.sheet-dialog{border:0;padding:0;margin:auto auto 0;width:100%;max-width:560px;max-height:92vh;border-radius:12px 18px 0 0;background:var(--card);color:var(--text);overflow:auto;overscroll-behavior:contain}
.sheet-dialog::backdrop{background:#0008}
@media (min-width:700px){.sheet-dialog{margin:auto;border-radius:12px}}
.close-row{position:sticky;top:0;z-index:2;display:flex;align-items:center;justify-content:space-between;padding:12px 14px 6px 18px;background:var(--card)}
.close-row h2{font-size:16px}.x{margin-left:auto;width:36px;height:36px;border-radius:50%;border:0;background:var(--bg);color:var(--text);font-size:20px;line-height:1;cursor:pointer}
.p-body{padding:6px 18px 22px;display:flex;flex-direction:column;gap:8px}
.p-body h2{font-size:20px;letter-spacing:-.3px}.muted{color:var(--muted)}
.gallery{display:flex;overflow-x:auto;scroll-snap-type:x mandatory;gap:0;background:var(--bg)}
.gallery img{width:100%;min-width:100%;aspect-ratio:1;object-fit:contain;scroll-snap-align:start}
.desc{font-size:14px;white-space:pre-line;color:var(--text)}
.specs{width:100%;border-collapse:collapse;font-size:13px}.specs th,.specs td{text-align:left;padding:7px 0;border-bottom:1px solid var(--line);vertical-align:top}.specs th{color:var(--muted);font-weight:500;width:40%}
.qty-row{display:flex;gap:10px;align-items:center;margin-top:8px}
.qty{display:inline-flex;align-items:center;border:1px solid var(--line);border-radius:8px;height:46px}
.qty button{width:42px;height:100%;border:0;background:none;color:var(--text);font-size:20px;cursor:pointer}.qty output{min-width:28px;text-align:center;font-weight:700}
.qty.small{height:34px}.qty.small button{width:32px;font-size:16px}
.line{display:flex;gap:10px;align-items:center;padding:10px 0;border-bottom:1px solid var(--line)}
.line img,.line .nopic{width:48px;height:48px;border-radius:8px;object-fit:cover;background:var(--bg);display:grid;place-items:center;font-size:16px;flex:none}
.line .t{flex:1;min-width:0}.line .t strong{display:block;font-size:14px}.line .t span{font-size:13px;color:var(--muted)}
.seg{display:flex;gap:8px}.seg label{flex:1;flex-direction:row!important;align-items:center;gap:8px;border:1px solid var(--line);border-radius:8px;padding:11px 12px;font-weight:600;cursor:pointer}
.seg label:has(input:checked){border-color:var(--accent);background:#e9683610}
.seg input{accent-color:var(--accent)}
.two{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.totals .row{font-size:14px}
/* order tracking */
.track{max-width:620px;margin:0 auto;padding:0 16px}
.status-big{display:flex;align-items:center;gap:12px;margin:18px 0 6px}
.status-big .dot{width:12px;height:12px;border-radius:50%;background:var(--accent);box-shadow:0 0 0 6px #e9683622;animation:pulse 1.6s infinite}
@keyframes pulse{50%{box-shadow:0 0 0 11px #e9683600}}
.status-big.done .dot{background:var(--green);box-shadow:none;animation:none}.status-big.bad .dot{background:var(--red);box-shadow:none;animation:none}
.status-big h1{font-size:24px}
.map{position:relative;height:300px;border-radius:12px;overflow:hidden;background:#dfe3e6;border:1px solid var(--line);margin:12px 0;touch-action:none;cursor:grab}
.map .tiles{position:absolute;inset:0}.map .tiles img{position:absolute;width:256px;height:256px;user-select:none;-webkit-user-drag:none;max-width:none}
.map .pin{position:absolute;transform:translate(-50%,-100%);z-index:2;display:flex;flex-direction:column;align-items:center;pointer-events:none;transition:left .9s linear,top .9s linear}
.map .pin b{display:grid;place-items:center;width:34px;height:34px;border-radius:50% 50% 50% 0;transform:rotate(-45deg);background:var(--accent);color:#fff;box-shadow:0 3px 10px #0004}
.map .pin b i{transform:rotate(45deg);font-style:normal;font-size:16px}
.map .pin.home b{background:#252b30}.map .pin.shop b{background:var(--green)}
.map .attr{position:absolute;right:0;bottom:0;z-index:3;font-size:12px;background:#fffc;color:#333;padding:1px 5px}.map .attr a{color:#333}
.map .zoom{position:absolute;right:8px;top:8px;z-index:3;display:flex;flex-direction:column;gap:4px}
.map .zoom button{width:32px;height:32px;border-radius:8px;border:1px solid #0002;background:#fff;color:#222;font-size:16px;cursor:pointer}
.eta{display:flex;gap:10px;flex-wrap:wrap}.eta div{flex:1 1 120px;border:1px solid var(--line);border-radius:8px;padding:10px 12px;background:var(--card)}
.eta span{display:block;font-size:12px;color:var(--muted)}.eta strong{font-size:16px}
.code-box{text-align:center;border:1px dashed var(--accent);border-radius:12px;padding:12px;margin:12px 0}
.code-box strong{display:block;font-size:28px;letter-spacing:0;font-family:ui-monospace,Menlo,monospace}.code-box span{font-size:13px;color:var(--muted)}
.steps li small{display:block;font-size:12px;color:var(--muted);font-weight:400}
.big-btn{min-height:56px;font-size:16px}
.card .pic{position:relative}
.tag{position:absolute;left:8px;top:8px;font-size:12px;font-weight:700;letter-spacing:.3px;padding:3px 8px;border-radius:99px;background:#252b30d9;color:#fff}
.tag.new{background:var(--accent)}
.variants{display:flex;flex-wrap:wrap;gap:8px;margin:4px 0 2px}
.variant{display:flex;flex-direction:column;align-items:flex-start;gap:1px;padding:8px 12px;border-radius:8px;border:1px solid var(--line);background:var(--card);color:var(--text);font:inherit;font-size:13px;font-weight:600;cursor:pointer}
.variant small{font-size:12px;font-weight:500;color:var(--muted)}
.variant.on{border-color:var(--accent);background:#e9683610}.variant.out{opacity:.5}
.alerts-box{display:flex;align-items:center;gap:14px;justify-content:space-between;flex-wrap:wrap}
.alerts-box .btn{flex:0 0 auto}
.coupon-row{display:flex;gap:8px}.coupon-row input{flex:1;min-width:0;text-transform:none}.form .coupon-row .btn{flex:0 0 auto;width:auto;min-height:44px;padding:0 20px}
.coupon-ok{color:var(--green);font-size:13px;font-weight:600}

.rider-order h2 small{font-weight:500}.rider-order .rider-done{margin-top:10px;border-top:1px solid var(--line);padding-top:10px}
.again-btn{min-height:32px!important;padding:0 12px!important;font-size:13px!important;margin-top:4px;flex:none!important}
.store-brand img{width:38px;height:38px;border-radius:8px}

/* Customer reviews on the shop page */
.reviews{margin:22px 0 6px;display:grid;gap:10px}
.reviews h2{font-size:16px;margin:0;display:flex;align-items:baseline;gap:8px;flex-wrap:wrap}
.reviews h2 small{font-size:13px;color:var(--muted);font-weight:500}
.rev-stars{color:#f5a623;letter-spacing:0}
.rev{margin:0;padding:12px 14px;border:1px solid var(--line);border-radius:12px;background:var(--card, transparent)}
.rev p{margin:0 0 6px;line-height:1.45;overflow-wrap:anywhere}
.rev footer{font-size:13px;color:var(--muted)}
.rev footer{padding:0;border:0;display:block;font-size:13px}
.cart-btn{background:#c4501c;border-color:#c4501c}
.cart-btn,.chip-btn{white-space:nowrap;flex-shrink:0}
.store-brand{min-width:0}
@media (max-width:420px){.cart-btn,.chip-btn{padding:0 11px}}

/* Checkout fits the screen: tighter fields, extras folded away, two columns on a computer */
#checkout{gap:8px}
#checkout label{gap:4px;font-size:13px}
#checkout .field,#checkout input:not([type=radio]):not([type=checkbox]),#checkout textarea,#checkout select{padding:8px 11px;font-size:14px}
#checkout textarea{min-height:0}
#checkout .two{display:grid;grid-template-columns:1fr 1fr;gap:8px}
#checkout .loc-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:6px}
#checkout .loc-row .btn{padding:6px 10px;font-size:13px;min-height:0}
#checkout .loc-row .note{margin:0;font-size:12px}
#checkout .co-more{border:1px solid var(--line);border-radius:8px;padding:7px 11px}
#checkout .co-more summary{cursor:pointer;font-size:13px;font-weight:600;color:var(--muted)}
#checkout .co-more[open]{display:flex;flex-direction:column;gap:8px}
#checkout .note{font-size:12px;margin:0}
#cart .p-body{padding-top:6px}
@media (min-width:820px){
  #cart.sheet-dialog{max-width:920px}
  #cart .p-body{display:grid;grid-template-columns:minmax(0,.9fr) minmax(0,1.2fr);gap:20px;align-items:start}
  #cart #cart-lines,#cart #cart-empty{grid-column:1}
  #cart #checkout{grid-column:2;grid-row:1 / span 2}
}
#checkout .loc-row{flex-wrap:nowrap}
#checkout .loc-row .btn{width:auto;flex:none}
#checkout .totals .row{padding:4px 0}
#checkout #place{padding:10px}
#checkout .two>*{min-width:0}
#checkout .two input{width:100%;box-sizing:border-box}
@media (max-width:819px){
  #checkout{gap:7px}
  #checkout .totals .row{padding:2px 0}
  #checkout #place{position:sticky;bottom:0;z-index:2;box-shadow:0 -8px 14px var(--bg,#fff)}
}
/* Product pop-up: fit one screen */
#product .gallery img{aspect-ratio:auto;height:min(38vh,320px)}
#product .p-body{gap:6px;padding-bottom:0}
#product .p-body h2{font-size:16px}
#product .desc{font-size:14px}
#product .specs th,#product .specs td{padding:5px 0}
#product .qty-row{position:sticky;bottom:0;z-index:2;background:var(--card);margin:4px -18px 0;padding:10px 18px 14px;border-top:1px solid var(--line)}
#product .qty-row .btn{flex:1}
@media (min-width:820px){
  #product.sheet-dialog{max-width:880px;grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-rows:auto 1fr;max-height:86vh}
  #product[open]{display:grid}
  #product .close-row{grid-column:1 / -1}
  #product .gallery{grid-column:1;align-self:start;margin:0 0 18px 18px;border-radius:12px}
  #product .gallery img{height:min(62vh,420px)}
  #product .p-body{grid-column:2;overflow:auto;padding-top:0}
}
@media (min-width:820px){
  #product.sheet-dialog:has(#p-gallery:empty),#product.sheet-dialog:has(#p-gallery.hidden){max-width:560px;grid-template-columns:minmax(0,1fr)}
  #product:has(#p-gallery:empty) .p-body,#product:has(#p-gallery.hidden) .p-body{grid-column:1}
}
/* v3: quiet placeholders and labels (DESIGN.md) */
.nopic{font-size:12px;font-weight:500;color:var(--muted);opacity:1}
.line .nopic{font-size:12px}

/* A closed dialog never shows, whatever layout it has when open */
.sheet-dialog:not([open]){display:none}
/* The cart count sits in the header: keep it white on the orange button, not the header's grey */
header .cart-btn span,.cart-btn span{color:inherit;font-size:13px;font-weight:600}
/* Two products per row on phones (a lone product no longer fills the whole screen) */
@media (max-width:480px){.grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}}
/* Reviews never make the page wider than the phone (long words, names) */
.reviews{grid-template-columns:minmax(0,1fr)}.rev{min-width:0;overflow-wrap:anywhere}
/* Pay by UPI on the order page */
.upi-qr{display:flex;justify-content:center;margin:12px 0}.upi-qr svg{width:180px;height:180px;background:#fff;padding:8px;border-radius:8px}
.upi-form{margin-top:12px}.upi-form .btn{width:100%}
/* marketplace (/market) */
.market-brand{text-decoration:none;color:inherit}
.market-brand .mark{display:grid;place-items:center;background:var(--accent);color:#fff;font-weight:800;font-size:14px}
.market-filters{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:8px;align-items:center}
.market-filters .field{padding:9px 12px;font-size:13px}
.market-check{display:flex;align-items:center;gap:8px;font-size:13px;white-space:nowrap;cursor:pointer}.market-check input{accent-color:var(--accent);width:16px;height:16px}
.market-count{font-size:13px;color:var(--muted);margin:4px 0 0;min-height:18px}
.market-card{text-decoration:none}
.market-shop{margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.market-more{display:flex;justify-content:center;padding:0 0 20px}
.market-shops{padding:10px 0 20px}.market-shops h2{font-size:18px;letter-spacing:-.3px;margin-bottom:8px}
.market-shop-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:8px}
.market-shop-row{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:12px 14px;border:1px solid var(--line);border-radius:10px;background:var(--card);color:var(--text);text-decoration:none;min-width:0}
.market-shop-row span{min-width:0}.market-shop-row strong{display:block;font-size:14px}
.market-shop-row small{font-size:12px;color:var(--muted);flex:none}.market-shop-row span small{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.market-tools{position:static}
@media (pointer:coarse){.store-foot a{display:inline-flex;align-items:center;min-height:36px}}
