/* Shared storefront controls: one stable row, touch-friendly targets.
   Loaded after the existing page styles; shopping logic stays unchanged. */
body .qc-widget {container-type:inline-size;}
body .qc-grid:not(.qc-category-text) {
 grid-template-columns:repeat(auto-fit,minmax(min(100%,250px),1fr));
}
body #cate-page .qc-category-grid:not(.qc-category-text),
body .ms-collection-page .ms-collection-grid {
 grid-template-columns:repeat(auto-fit,minmax(min(100%,250px),1fr));
}
body .qc-card .qc-widget {margin-bottom:2px;padding-top:14px;}
body .qc-card .qc-prices,
body #cate-page .qc-category-grid .qc-prices,
body .ms-collection-page .qc-prices {
 flex-direction:row;flex-wrap:wrap;align-items:baseline;gap:4px 10px;
 min-height:24px;margin-bottom:10px;line-height:1.5;
}
body .qc-card .qc-reference {font-size:12px;color:#707070;white-space:nowrap;}
body .qc-card .qc-price {font-size:16px;line-height:1.5;font-weight:600;}
body .qc-widget .qc-controls {
 display:flex;flex-wrap:nowrap;align-items:center;gap:6px;max-width:440px;
}
body .qc-widget .qc-quantity {
 display:flex;flex:1 1 0;flex-basis:0;width:auto;min-width:0;max-width:none;
 justify-content:center;box-sizing:border-box;height:44px;border-radius:8px;
}
/* Keep the associated label accessible, without spending narrow-card width. */
body .qc-widget .qc-quantity label,
body .qc-widget .ms-favorite .ms-favorite-label {
 position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;
 clip:rect(0,0,0,0);clip-path:inset(50%);white-space:nowrap;border:0;
}
body .qc-widget .qc-quantity button {
 flex:0 0 40px;width:40px;height:42px;padding:0;font-size:22px;
}
body .qc-widget .qc-quantity input.qc-input {
 flex:1 1 44px;width:44px;min-width:40px;max-width:none;height:42px;
 font-size:17px;padding:0 2px;
}
body .qc-widget .qc-actions {
 display:flex;flex:0 0 auto;flex-wrap:nowrap;gap:6px;width:auto;max-width:none;
 align-items:center;justify-content:flex-start;
}
body .qc-widget .qc-share,
body .qc-widget .qc-favorite,
body .qc-widget .qc-favorite.ms-favorite {
 display:inline-flex!important;align-items:center;justify-content:center;
 flex:0 0 44px;width:44px!important;min-width:44px;max-width:44px;
 height:44px!important;min-height:44px;margin:0;padding:9px;border-radius:8px;
}
body .qc-widget .qc-favorite.ms-favorite {gap:0;}
body .qc-widget .qc-share:hover {background:#eef5fa;border-color:#285b88;}
body .qc-widget .ms-favorite:hover {filter:brightness(.96);}
body .qc-widget .qc-total {margin-top:7px;font-size:12px;line-height:1.5;color:#63717b;}
body .qc-widget .qc-total:empty {display:none;}
body .qc-widget .qc-notice {overflow-wrap:anywhere;}
/* Only show the quantity caption when there is comfortable room for it. */
@container (min-width:290px) {
 body .qc-widget .qc-quantity label {
  position:static;width:auto;height:auto;padding:0 9px;margin:0;overflow:visible;
  clip:auto;clip-path:none;font-size:13px;
 }
}
@media(max-width:600px) {
 body .qc-grid:not(.qc-category-text),
 body #cate-page .qc-category-grid:not(.qc-category-text),
 body .ms-collection-page .ms-collection-grid {grid-template-columns:minmax(0,1fr)!important;}
 body .qc-card {padding:14px;}
 body .qc-card h3 {font-size:16px!important;}
}

/* Larger hearts fill the same 44px button; toggle never changes row width. */
body .qc-widget .qc-favorite.ms-favorite:not(.ms-favorite-remove) {padding:4px;}
body .qc-widget .ms-favorite:not(.ms-favorite-remove) .ms-favorite-heart {
 flex:0 0 34px;width:34px;height:34px;
}
body .qc-widget .ms-favorite:not(.ms-favorite-remove) .ms-favorite-heart svg {
 width:34px;height:34px;
}
/* Saved check stays inside the button and clear of the main heart shape. */
body .qc-widget .ms-favorite-saved:not(.ms-favorite-remove) .ms-favorite-heart {
 transform:none;
}
body .qc-widget .ms-favorite-saved:not(.ms-favorite-remove) .ms-favorite-heart::before {
 content:"";position:absolute;right:-1px;bottom:0;width:14px;height:14px;
 border-radius:50%;background:#fff;pointer-events:none;
}
body .qc-widget .ms-favorite-saved:not(.ms-favorite-remove) .ms-favorite-heart::after {
 content:"";position:absolute;right:3px;bottom:4px;width:6px;height:10px;
 box-sizing:border-box;border:solid #405347;border-width:0 2px 2px 0;
 transform:rotate(45deg);pointer-events:none;
}

/* Browsing cards omit redundant subtotals; product detail keeps its total. */
body .qc-card .qc-widget:not(.qc-main) .qc-total {display:none;}
