/* Shared Home/Shop cart. Keep both entry points visually and behaviorally aligned. */
#shop-cart{box-sizing:border-box;border:0;border-radius:22px;width:calc(100% - 36px);max-width:760px;padding:40px;max-height:90svh;margin:auto;overflow:hidden;background:#fff;color:#1d1d1f;box-shadow:0 25px 100px #14334330;font:14px/1.5 'DM Sans',Arial,sans-serif}
#shop-cart[open]{display:flex;flex-direction:column}
#shop-cart #cart-title{flex-shrink:0}
#shop-cart #cart-items{min-height:0;overflow-y:auto;overscroll-behavior:contain;flex:0 1 auto}
#shop-cart #cart-summary{flex-shrink:0;background:#fff;border-top:1px solid #dce4e8;margin-top:12px;padding-top:16px}
#shop-cart::backdrop{background:#12303b70;backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px)}
#shop-cart h2{font-size:36px;font-weight:700;line-height:1.2;letter-spacing:-1.2px;margin:0 48px 12px 0;color:#1d1d1f}
#shop-cart .eyebrow{display:none}
#shop-cart .dialog-close{position:absolute;top:12px;right:14px;width:40px;height:40px;min-height:0;padding:0;margin:0;border:0;border-radius:50%;background:#f0f5f7;font:25px/1 'DM Sans',Arial,sans-serif;color:#637d8c;z-index:2}
#shop-cart button{font-family:inherit;cursor:pointer;touch-action:manipulation}
#shop-cart button:disabled{opacity:.35;cursor:default}
#shop-cart button:focus-visible,#shop-cart #keep-shopping:focus-visible{outline:3px solid var(--brand-link);outline-offset:3px}
#shop-cart .cart-line{display:grid;grid-template-columns:90px minmax(0,1fr) auto;gap:22px;padding:26px 0;align-items:start;border:0;border-bottom:1px solid #dce4e8}
#shop-cart .bag-photo-frame{display:flex;align-items:center;justify-content:center;width:90px;height:112px;padding:8px;background:#f5f7f9;border-radius:12px;overflow:hidden}
#shop-cart .bag-photo-frame .bag-photo{display:block;width:100%;height:100%;padding:0;border-radius:0;background:transparent;object-fit:contain;object-position:center}
#shop-cart .bag-photo-frame .bag-photo-padded{transform:translateX(-24.1%)}
#shop-cart .bag-item-copy{min-width:0}
#shop-cart .cart-line strong{display:block;font-size:19px;line-height:1.25;letter-spacing:-.4px;margin:4px 0 7px;font-weight:650;overflow-wrap:anywhere}
#shop-cart .bag-item-option{font-size:13px;color:#6e6e73;overflow-wrap:anywhere}
#shop-cart .bag-item-price{font-size:18px;font-weight:650;color:#1d1d1f;text-align:right;padding-top:4px;white-space:nowrap}
#shop-cart .bag-item-price small{display:block;font-size:11px;font-weight:400;color:#6e6e73;margin-top:5px}
#shop-cart .quantity{display:flex;align-items:center;gap:10px;margin-top:12px;font-size:13px;flex-wrap:wrap}
#shop-cart .quantity button{width:36px;height:36px;min-width:36px;padding:0;border-radius:50%;background:#f5f5f7;border:0;color:#1d1d1f;font-size:16px}
#shop-cart .quantity .remove{width:auto;margin-left:4px;background:none;color:var(--brand-blue);text-decoration:none;min-width:54px;font-size:13px}
#shop-cart .cart-total{display:flex;justify-content:space-between;gap:20px;font-size:17px;padding-top:0}
#shop-cart #checkout-button,#shop-cart #keep-shopping{display:flex;align-items:center;justify-content:center;gap:12px;width:100%;min-height:50px;margin:20px 0 0;padding:12px 18px;background:var(--brand-blue);color:#fff;border:1px solid var(--brand-blue);border-radius:12px;font-size:15px;font-weight:650;text-decoration:none}
#shop-cart #checkout-button:hover,#shop-cart #keep-shopping:hover{background:var(--brand-blue-hover);border-color:var(--brand-blue-hover)}
#shop-cart .square-payment-brand{display:flex;align-items:center;justify-content:center;gap:8px;margin:20px 0 0;color:#526774;font-size:12px;line-height:1.5;text-align:center}
#shop-cart .square-payment-brand svg{width:20px;height:20px;flex-shrink:0;color:#243746}
#shop-cart #cart-empty>p{color:#6e6e73;font-size:14px}
@media(max-width:1024px){
 #shop-cart[open]{display:flex;flex-direction:column}
 #shop-cart{width:100%;max-width:600px;height:min(760px,var(--form-vh,100dvh));max-height:var(--form-vh,100dvh);margin:auto auto 0;border-radius:24px 24px 0 0;padding:24px 20px calc(20px + var(--app-safe-bottom,0px));overflow:hidden}
 #shop-cart h2{font-size:30px;margin:8px 48px 20px 0;flex-shrink:0}
 #shop-cart #cart-items{min-height:0;overflow-y:auto;overscroll-behavior:contain}
 #shop-cart #cart-summary{flex-shrink:0}
 #shop-cart .cart-line{grid-template-columns:64px minmax(0,1fr);gap:12px;padding:18px 0}
 #shop-cart .bag-photo-frame{width:64px;height:85px;padding:5px}
 #shop-cart .cart-line strong{font-size:16px}
 #shop-cart .bag-item-price{grid-column:2;text-align:left;font-size:15px;padding:0}
 #shop-cart .quantity{gap:5px}
 #shop-cart .quantity button{min-width:44px;width:44px;height:44px}
 #shop-cart .quantity .remove{width:auto;min-width:44px;margin-left:0;font-size:11px}
}
@media(max-width:1024px) and (max-height:600px){
 #shop-cart{height:var(--form-vh,100dvh);overflow:hidden;border-radius:0}
 #shop-cart #cart-items{overflow-y:auto;flex-shrink:1}
}
@media(max-width:1024px){
 #shop-cart[data-empty]{position:fixed;inset:0;width:calc(100% - 32px);height:fit-content;max-height:calc(var(--form-vh,100dvh) - 32px);margin:auto;overflow:auto;border-radius:24px;padding-bottom:24px}
}

/* Large carts keep product details and editing controls in shorter rows. */
#shop-cart #cart-items.cart-items-compact .cart-line{grid-template-columns:minmax(0,1fr) auto;gap:10px 16px;padding:14px 0}
#shop-cart #cart-items.cart-items-compact .cart-line strong{font-size:16px;line-height:1.3;margin:0 0 4px;letter-spacing:-.2px}
#shop-cart #cart-items.cart-items-compact .bag-item-option{font-size:12px}
#shop-cart #cart-items.cart-items-compact .bag-item-price{grid-column:2;grid-row:1;font-size:15px;text-align:right;padding:0}
#shop-cart #cart-items.cart-items-compact .quantity{margin-top:8px}

.cart-preview{position:fixed;inset:max(20px,env(safe-area-inset-top)) max(20px,env(safe-area-inset-right)) auto auto;width:min(380px,calc(100vw - 32px));max-height:calc(100dvh - 32px);overflow:auto;box-sizing:border-box;margin:0;padding:0;border:1px solid #d9e6ed;border-radius:18px;background:#fff;color:#18394c;box-shadow:0 16px 56px #12394e29,0 2px 8px #12394e0d;z-index:100;transform-origin:top right;font-family:inherit;text-align:left}
.cart-preview[hidden]{display:none}
.cart-preview::backdrop{background:transparent;pointer-events:none}
.cart-preview-header{display:flex;align-items:center;gap:9px;padding:14px 16px 8px}
.cart-preview-header>strong{font-size:14px;line-height:1.4;font-weight:650}
.cart-preview-check{display:grid;place-items:center;width:25px;height:25px;border-radius:50%;background:#e8f6f0;color:#277f60;flex-shrink:0}
.cart-preview-check svg{width:18px;height:18px}
#cart-preview-close{display:grid;place-items:center;width:36px;height:36px;flex-shrink:0;margin:-5px -5px -5px auto;padding:8px;border:0;border-radius:50%;background:transparent;color:#637a87}
#cart-preview-close:hover{background:#f0f5f8}
#cart-preview-close svg{width:20px;height:20px}
.cart-preview-product{display:grid;grid-template-columns:72px minmax(0,1fr);align-items:center;gap:14px;padding:10px 18px 18px}
.cart-preview-product>img{width:72px;height:86px;object-fit:contain;background:#f2f7fa;border-radius:10px;padding:7px;box-sizing:border-box}
.cart-preview-product>div{display:grid;gap:4px;min-width:0}
#cart-preview-title{font-size:15px;line-height:1.35;font-weight:650}
#cart-preview-option,#cart-preview-quantity{font-size:12px;line-height:1.4;color:#637a87}
#cart-preview-price{font-size:14px;line-height:1.4;margin-top:3px;font-weight:600}
.cart-preview-footer{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 16px;border-top:1px solid #e8eff3;background:#f8fbfd}
#cart-preview-count{font-size:12px;color:#637a87}
#cart-preview-view{display:flex;align-items:center;gap:8px;min-height:36px;padding:6px 9px;border:0;border-radius:7px;background:transparent;color:#007ea8;font-size:13px;font-weight:650;white-space:nowrap}
#cart-preview-view:hover{background:#e7f4fa}
.cart-preview button:focus-visible{outline:2px solid var(--brand-blue);outline-offset:2px}
.cart-preview-sr{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
@media(max-width:1024px){.cart-preview{inset:max(12px,env(safe-area-inset-top)) 12px auto auto;width:calc(100vw - 24px);max-width:380px;border-radius:15px}}
