/* Public layer order: catalog 32, floating tools 38, compact header 50,
   bottom navigation 55, cart scrim 60, cart 61. Native dialogs use the top layer. */
:root{--layer-cart-scrim:60;--layer-cart:61;--cart-ink:#202124;--cart-muted:#696d72;--cart-line:#e9e9e9;--cart-red:#d51f2b}
body.cart-open{position:fixed;left:0;right:0;width:100%;overflow:hidden}
body.cart-open #compact-header,body.cart-open .bottom-navigation{visibility:hidden;pointer-events:none}
#scrim{z-index:var(--layer-cart-scrim);background:rgba(15,17,20,.58)}
#cart{z-index:var(--layer-cart);inset:0 0 0 auto;width:min(490px,100%);height:100vh;height:100dvh;padding:0;display:grid;grid-template-rows:auto minmax(0,1fr) auto;overflow:hidden;background:#fff;color:var(--cart-ink);box-shadow:-18px 0 60px rgba(0,0,0,.18);font-family:Inter,system-ui,-apple-system,"Segoe UI",sans-serif;transition:transform .24s ease;visibility:hidden;pointer-events:none}
#cart.open{visibility:visible;pointer-events:auto}
#cart .cart-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding:32px 32px 22px;border-bottom:1px solid var(--cart-line);background:#fff}
#cart .cart-head h2{margin:0;color:var(--cart-ink);font:700 29px/1.12 Inter,system-ui,sans-serif;letter-spacing:-.045em}
#cart .cart-head p{margin:8px 0 0;color:var(--cart-muted);font-size:13px;line-height:1.4}
#cart .cart-close{flex:none;display:grid;place-items:center;width:40px;height:40px;margin:-4px -4px 0 0;padding:0;border:1px solid var(--cart-line);border-radius:50%;background:#f8f8f8;color:var(--cart-ink);font-size:27px;font-weight:400;line-height:1}
#cart .cart-close:hover{background:#f0f0f0}
#cart .cart-items{min-height:0;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;padding:6px 32px 24px;scrollbar-gutter:stable}
#cart .cart-item{display:grid;grid-template-columns:76px minmax(0,1fr) auto;grid-template-rows:auto auto;align-items:start;gap:4px 14px;padding:22px 0;border-bottom:1px solid var(--cart-line)}
#cart .cart-item img{grid-column:1;grid-row:1/3;width:76px;height:76px;object-fit:contain;border:1px solid #f0f0f0;border-radius:12px;background:#fafafa}
#cart .cart-item-info{grid-column:2;grid-row:1;min-width:0}
#cart .cart-item-name{display:block;overflow-wrap:anywhere;color:var(--cart-ink);font-size:14px;font-weight:700;line-height:1.4}
#cart .cart-item-detail{display:block;margin-top:5px;color:var(--cart-muted);font-size:12px;line-height:1.45;overflow-wrap:anywhere}
#cart .cart-item-quantity{display:inline-flex;align-items:center;margin-top:9px;padding:4px 8px;border-radius:6px;background:#f3f3f3;color:#4b4e53;font-size:11px;font-weight:700}
#cart .cart-item-price{grid-column:3;grid-row:1;white-space:nowrap;color:var(--cart-ink);font-size:14px;line-height:1.4}
#cart .cart-remove{grid-column:2/4;grid-row:2;justify-self:start;padding:4px 0;border:0;background:none;color:#aa1721;font-size:12px;font-weight:600;line-height:1.4;text-decoration:underline;text-underline-offset:3px}
#cart .cart-remove:hover{color:#7d0c14}
#cart .cart-footer{padding:20px 32px calc(24px + env(safe-area-inset-bottom));border-top:1px solid var(--cart-line);background:#fff;box-shadow:0 -8px 24px rgba(20,20,20,.035)}
#cart .summary{margin:0 0 18px}
#cart .summary p{margin:0;display:flex;justify-content:space-between;align-items:baseline;gap:12px;color:var(--cart-ink);font-size:15px;font-weight:600;line-height:1.35}
#cart .summary p b{font-size:22px;font-weight:750;letter-spacing:-.035em;white-space:nowrap}
#cart .summary small{display:block;margin-top:8px;color:var(--cart-muted);font-size:12px;line-height:1.4}
#cart #checkout{min-height:54px;border-radius:10px;background:var(--cart-red);color:#fff;font-size:14px;font-weight:700}
#cart #checkout span{margin-left:6px}
#cart #checkout:hover:not(:disabled){background:#b71925}
#cart #checkout:disabled{background:#e5e5e5;color:#8c8c8c;cursor:not-allowed}
#cart .cart-empty{min-height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:40px 16px;text-align:center}
#cart .cart-empty-icon{display:grid;place-items:center;width:74px;height:74px;border-radius:22px;background:#f6f6f6;color:#484b4f}
#cart .cart-empty-icon svg{width:33px;height:33px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
#cart .cart-empty h3{margin:23px 0 8px;font-size:20px;line-height:1.2;letter-spacing:-.03em}
#cart .cart-empty p{max-width:245px;margin:0;color:var(--cart-muted);font-size:13px;line-height:1.5}
#cart .cart-empty button{margin-top:22px;padding:11px 16px;border:1px solid #d9d9d9;border-radius:9px;background:#fff;color:var(--cart-ink);font-size:13px;font-weight:650}
#cart .cart-empty button:hover{background:#f7f7f7}
@media(max-width:760px){
  #cart{inset:0;width:100%;max-width:none;box-shadow:none}
  #cart .cart-head{padding:calc(20px + env(safe-area-inset-top)) 20px 18px}
  #cart .cart-head h2{font-size:26px}
  #cart .cart-items{padding:4px 20px 20px;scrollbar-gutter:auto}
  #cart .cart-item{grid-template-columns:68px minmax(0,1fr) auto;gap:4px 12px;padding:19px 0}
  #cart .cart-item img{width:68px;height:68px}
  #cart .cart-footer{padding:16px 20px calc(16px + env(safe-area-inset-bottom))}
}
@media(max-width:360px){#cart .cart-item{grid-template-columns:60px minmax(0,1fr) auto;gap:4px 10px}#cart .cart-item img{width:60px;height:60px}#cart .cart-item-price{font-size:12px}#cart .cart-head,#cart .cart-items,#cart .cart-footer{padding-left:16px;padding-right:16px}}
@media(prefers-reduced-motion:reduce){#cart{transition:none}}
