/* Mobile quantity gets the usable width; buy stays smaller and labelled. */
@media(max-width:767px){
 html body[class] #content#content .product-thumb.rich-card-v2 .rich-v2-buy:has(>.rich-quantity:not([hidden])){grid-template-columns:minmax(0,1fr)!important;gap:6px!important;}
 html body[class] #content#content .product-thumb.rich-card-v2 .rich-v2-buy>.rich-quantity:not([hidden]){grid-column:1!important;grid-row:1!important;width:100%!important;min-width:0!important;max-width:none!important;grid-template-columns:26px minmax(44px,1fr) 26px!important;height:46px!important;min-height:46px!important;}
 html body[class] #content#content .product-thumb.rich-card-v2 .rich-v2-buy>.rich-quantity>button{height:44px!important;min-height:44px!important;line-height:1!important;}
 html body[class] #content#content .product-thumb.rich-card-v2 .rich-card-quantity{height:44px!important;min-height:44px!important;font-size:16px!important;padding:0 3px!important;}
 html body[class] #content#content .product-thumb.rich-card-v2 .rich-v2-buy:has(>.rich-quantity:not([hidden]))>.rich-card-cart{grid-column:1!important;grid-row:2!important;width:calc(100% - 16px)!important;max-width:108px!important;justify-self:end!important;min-height:42px!important;white-space:normal!important;}
 html body[class] #content#content .product-thumb .rich-quantity[hidden]{display:none!important;}
 html body.rich-pdp-active #product-product .rich-pdp-purchase .rich-quantity{width:min(100%,260px)!important;max-width:100%!important;grid-template-columns:42px minmax(56px,1fr) 42px!important;height:48px!important;}
 html body.rich-pdp-active #product-product .rich-pdp-purchase .rich-quantity>button,html body.rich-pdp-active #product-product .rich-pdp-purchase #input-quantity{height:46px!important;}
 html body.rich-pdp-active #product-product .rich-pdp-purchase #button-cart{flex:0 1 180px!important;width:180px!important;max-width:100%!important;}
 html body.rich-pdp-active #product-product #product:has(#button-cart.rich-stock-notify) .rich-quantity{display:none!important;}
}
/* Explicitly round the inner basket, not just the parent dialog. */
html body[class] #checkout-cart#checkout-cart .rich-basket{border-radius:12px!important;overflow:hidden!important;}
html.rich-basket-embedded body #checkout-cart#checkout-cart .rich-basket{border-radius:12px!important;overflow:hidden!important;}
html body[class] #checkout-cart#checkout-cart .rich-basket-heading{min-width:0!important;flex-wrap:wrap!important;row-gap:6px!important;}
html body[class] #checkout-cart#checkout-cart .rich-basket-heading>[role=heading]{min-width:0!important;}
html body[class] #checkout-cart#checkout-cart .rich-basket-item{grid-template-columns:56px minmax(0,1fr) 32px!important;gap:10px!important;}
html body[class] #checkout-cart#checkout-cart .rich-basket-detail{min-width:0!important;}
html body[class] #checkout-cart#checkout-cart .rich-basket-remove{width:32px!important;height:36px!important;max-width:100%!important;justify-self:end!important;border-radius:8px!important;}
html body[class] #checkout-cart#checkout-cart .rich-basket-item-bottom{display:flex!important;flex-wrap:wrap!important;gap:8px 12px!important;min-width:0!important;}
html body[class] #checkout-cart#checkout-cart .rich-basket-quantity{flex:0 0 auto!important;min-width:0!important;max-width:100%!important;}
html body[class] #checkout-cart#checkout-cart .rich-basket-quantity .rich-quantity{display:grid!important;grid-template-columns:32px 60px 32px!important;width:126px!important;max-width:100%!important;height:46px!important;min-height:46px!important;margin:0!important;}
html body[class] #checkout-cart#checkout-cart .rich-basket-quantity .rich-quantity>button{width:32px!important;min-width:0!important;height:44px!important;min-height:44px!important;padding:0!important;}
html body[class] #checkout-cart#checkout-cart .rich-basket-quantity .rich-quantity>input{width:60px!important;min-width:0!important;height:44px!important;min-height:44px!important;font-size:16px!important;}
html body[class] #checkout-cart#checkout-cart #rich-basket-items[data-rich-live-quantity="1"] .rich-basket-update{display:none!important;}
html body[class] #checkout-cart#checkout-cart .rich-basket-price{max-width:100%!important;}
html body[class] #checkout-cart#checkout-cart .rich-basket-bottom{display:flex!important;flex-direction:column!important;gap:10px!important;min-width:0!important;}
html body[class] #checkout-cart#checkout-cart .rich-basket-bottom>*{margin-top:0!important;margin-bottom:0!important;min-width:0!important;}
html body[class] #checkout-cart#checkout-cart .rich-basket-grand-total{display:flex!important;flex-wrap:wrap!important;gap:4px 12px!important;}
html body[class] #checkout-cart#checkout-cart .rich-basket-grand-total>strong{margin-left:auto!important;}
html body[class] #checkout-cart#checkout-cart .rich-basket-promo-row{display:grid!important;grid-template-columns:minmax(0,1fr) max-content!important;gap:8px!important;min-width:0!important;}
html body[class] #checkout-cart#checkout-cart .rich-basket-promo-row input,html body[class] #checkout-cart#checkout-cart .rich-basket-promo-row button{width:100%!important;min-width:0!important;max-width:100%!important;box-sizing:border-box!important;}
html body[class] #checkout-cart#checkout-cart .rich-basket-order{box-sizing:border-box!important;width:100%!important;max-width:100%!important;white-space:normal!important;min-height:46px!important;}
/* Honor the visual viewport while the mobile software keyboard is visible. */
html body[class] #rich-basket-drawer{height:var(--rich-basket-viewport-height,100dvh)!important;max-height:var(--rich-basket-viewport-height,100dvh)!important;top:var(--rich-basket-viewport-top,0px)!important;bottom:auto!important;border-radius:12px!important;overflow:hidden!important;}
html body[class] #rich-basket-frame{border-radius:inherit!important;}
@media(max-width:767px){
 html body[class] #rich-basket-drawer{top:calc(var(--rich-basket-viewport-top,0px) + 8px)!important;right:8px!important;width:calc(100vw - 16px)!important;max-width:calc(100vw - 16px)!important;height:calc(var(--rich-basket-viewport-height,100dvh) - 16px)!important;max-height:calc(var(--rich-basket-viewport-height,100dvh) - 16px)!important;}
 html.rich-basket-embedded,html.rich-basket-embedded body{background:#f6f0fa!important;}
 html.rich-basket-embedded body #checkout-cart#checkout-cart.rich-basket-page{margin:0!important;padding:0!important;}
}
@media(max-width:359px){
 html body[class] #checkout-cart#checkout-cart .rich-basket-promo-row{grid-template-columns:minmax(0,1fr)!important;}
 html body[class] #checkout-cart#checkout-cart .rich-basket-promo-row button{width:auto!important;min-width:110px!important;justify-self:end!important;}
}

/* Keep the parent close button over a reserved heading, never over item controls. */
html.rich-basket-embedded{scroll-padding-top:76px!important;}
html.rich-basket-embedded body #checkout-cart#checkout-cart .rich-basket{overflow:visible!important;}
html.rich-basket-embedded body #checkout-cart#checkout-cart .rich-basket-heading{position:sticky!important;top:0!important;z-index:3!important;background:#fff!important;border-radius:12px 12px 0 0!important;padding-right:58px!important;}
html.rich-basket-embedded body #checkout-cart#checkout-cart .rich-basket-bottom{border-radius:0 0 12px 12px!important;}
html.rich-basket-embedded #rich-basket-items input{scroll-margin-top:80px!important;}
@media(max-width:767px){
 html body[class] #content#content .product-thumb.rich-card-v2 .rich-v2-buy:has(>.rich-stock-notify){grid-template-columns:minmax(0,1fr)!important;}
 html body[class] #content#content .product-thumb.rich-card-v2 .rich-v2-buy:has(>.rich-stock-notify)>.rich-quantity{display:none!important;}
 html body[class] #content#content .product-thumb.rich-card-v2 .rich-v2-buy>.rich-stock-notify{grid-column:1/-1!important;grid-row:1!important;width:100%!important;max-width:none!important;justify-self:stretch!important;}
}
