/* Step 32: premium drawer, server-rendered cart data. */
#CartDrawer{width:min(460px,100%);max-width:100%;height:100dvh;max-height:100dvh;margin:0 0 0 auto;background:var(--hg-panel);color:var(--hg-ink);border:0;padding:0}
#CartDrawer:not([open]){display:none}
#CartDrawer[open]{display:flex;flex-direction:column}
#CartDrawer::backdrop{background:#0007}
#CartDrawer .drawer-head{flex:0 0 auto;display:flex;align-items:center;justify-content:space-between;padding:12px 16px;border-bottom:1px solid var(--hg-line)}
#CartDrawer .drawer-head h2{font-size:24px;margin:0}
#CartDrawer .drawer-head button{min-width:44px;min-height:44px}
#CartDrawer #CartContent{flex:1;min-height:0;display:flex;flex-direction:column}
#CartDrawer .hg-cart-v2,#CartDrawer .cart-main-form{display:flex;flex-direction:column;flex:1;min-height:0}
#CartDrawer .cart-scroll{flex:1;min-height:0;overflow:auto;padding:12px 16px}
.hg-cart-v2 .hg-cart-progress{padding:12px;background:var(--hg-media);border-radius:var(--hg-radius);margin-bottom:10px}
.hg-cart-progress strong{font-size:14px}
.hg-cart-progress progress{display:block;width:100%;height:8px;accent-color:var(--hg-action);margin:8px 0}
.hg-cart-progress p,.hg-cart-progress small{font-size:12px;margin:4px 0;color:var(--hg-muted)}
.hg-cart-progress a{font-size:13px;display:inline-flex;align-items:center;min-height:36px;text-decoration:underline}
.hg-cart-v2 .cart-line{display:grid;grid-template-columns:76px minmax(0,1fr);gap:12px;padding:12px 0;border-bottom:1px solid var(--hg-line)}
.hg-cart-photo{aspect-ratio:4/5;background:var(--hg-media);border-radius:var(--hg-media-radius);overflow:hidden}
.hg-cart-photo img{width:100%;height:100%;object-fit:contain}
.hg-cart-line-info{min-width:0}
.hg-cart-v2 .cart-line-title{font-size:15px;font-weight:600;overflow-wrap:anywhere}
.hg-cart-v2 .fine{margin:3px 0;color:var(--hg-muted)}
.hg-cart-v2 .cart-line-price{display:flex;gap:8px;align-items:baseline;font-size:15px}
.hg-cart-v2 .cart-line-price s{font-size:13px;color:var(--hg-muted)}
.hg-cart-v2 .cart-line-actions{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:8px}
.hg-cart-qty{display:flex;border:1px solid var(--hg-line);border-radius:var(--hg-radius);align-items:center}
.hg-cart-qty button{width:44px;height:44px;background:var(--hg-panel);color:var(--hg-ink);border:0;font-size:18px}
.hg-cart-qty input{width:42px;height:44px;text-align:center;border:0;background:var(--hg-panel);color:var(--hg-ink);appearance:textfield;font-size:16px}
.hg-cart-qty input::-webkit-inner-spin-button,.hg-cart-qty input::-webkit-outer-spin-button{appearance:none}
.hg-cart-v2 .cart-line-actions>a{font-size:12px;text-decoration:underline;display:inline-flex;align-items:center;min-height:44px}
#CartDrawer .hg-cart-v2 .cart-summary{flex:0 0 auto;max-height:48dvh;overflow:auto;padding:12px 16px max(16px,env(safe-area-inset-bottom));border-top:1px solid var(--hg-line);background:var(--hg-panel)}
.hg-cart-v2 .cart-summary{display:grid;gap:8px}
.hg-cart-discount,.hg-cart-v2 .cart-subtotal{display:flex;justify-content:space-between;gap:12px}
.hg-cart-discount{font-size:13px}
.hg-cart-v2 .cart-subtotal{font-size:18px}
.hg-cart-v2 .hg-cart-checkout{width:100%;min-height:48px;background:var(--hg-action);color:white}
.hg-cart-update{min-height:36px;background:none;color:var(--hg-ink);border:0;text-decoration:underline;font-size:12px}
.hg-cart-v2 .form-error:empty{display:none}
.hg-cart-empty{padding:24px 16px;text-align:center}
@media(max-width:749px){#CartDrawer{width:100%}.hg-cart-v2 .cart-line{grid-template-columns:70px minmax(0,1fr)}}
