/* Recently viewed only. Keep full prices and discount eligibility unchanged. */
.storefront .recent-grid { grid-auto-columns:calc((100% - 75px)/6); }
.storefront .recent-card > .buy-slot { margin-top:auto; }
.storefront .recent-price { display:block; min-height:28px; overflow-x:auto; overflow-y:hidden; scrollbar-width:thin; }
.storefront .recent-price .product-price { display:flex; flex-wrap:nowrap; align-items:baseline; gap:5px; max-width:none; width:max-content; min-width:100%; min-height:28px; }
.storefront .recent-price .discount-current { flex:none; max-width:none; overflow:visible; white-space:nowrap; }
.storefront .recent-price .discount-comparison { flex:0 0 auto; flex-wrap:nowrap; gap:5px; white-space:nowrap; }
@media(max-width:1100px) { .storefront .recent-grid { grid-auto-columns:calc((100% - 45px)/4); } }
@media(max-width:760px) { .storefront .recent-grid { grid-auto-columns:210px; } }

/* Same compact control as the primary catalog, limited to the two extra strips. */


/* Catalog cards only: the photo link and cart button are siblings, never nested controls. */
.storefront :is(#recent-products, #detail .related) .catalog-photo-actions { position:relative; width:100%; margin-bottom:20px; overflow:visible; }

.storefront :is(#recent-products, #detail .related) .catalog-photo-actions .product-image { width:100%; box-sizing:border-box; }

.storefront :is(#recent-products, #detail .related) .catalog-photo-actions>.buy-slot { position:absolute; right:0; bottom:-20px; width:44px; height:44px; margin:0; z-index:2; }

.storefront :is(#recent-products, #detail .related) .catalog-photo-actions .quick-quantity { display:block; margin:0; padding:0; border:0; width:44px; height:44px; min-height:44px; background:transparent; overflow:visible; }

.storefront :is(#recent-products, #detail .related) .catalog-photo-actions .quick-quantity>[data-plus],
.storefront :is(#recent-products, #detail .related) .catalog-photo-actions .quick-quantity>[data-minus] { display:none; }

.storefront :is(#recent-products, #detail .related) .catalog-photo-actions .buy-slot button[data-compact-cart] { display:grid; place-items:center; position:relative; width:44px; min-width:44px; height:44px; min-height:44px; margin:0; padding:0; border-radius:12px; background:transparent; color:white; box-shadow:none; isolation:isolate; }

.storefront :is(#recent-products, #detail .related) .catalog-photo-actions .buy-slot button[data-compact-cart]::before { content:""; position:absolute; inset:3px; z-index:-1; border-radius:11px; background:#f07800; box-shadow:0 2px 6px #542e151c; }

.storefront :is(#recent-products, #detail .related) .catalog-photo-actions .buy-slot button[data-compact-cart]:hover::before { background:#d96800; }

.storefront :is(#recent-products, #detail .related) .catalog-photo-actions .buy-slot button[data-compact-cart]:disabled { opacity:.55; }

.storefront :is(#recent-products, #detail .related) .catalog-photo-actions .buy-slot button[data-compact-cart]:focus-visible { outline:3px solid #147540; outline-offset:2px; }

.storefront :is(#recent-products, #detail .related) .catalog-photo-actions .buy-slot svg { width:22px; height:22px; fill:none; stroke:currentColor; stroke-width:1.9; stroke-linecap:round; stroke-linejoin:round; }

.storefront :is(#recent-products, #detail .related) .catalog-cart-quantity { position:absolute; right:0; top:-4px; box-sizing:border-box; min-width:18px; height:18px; padding:0 3px; border-radius:10px; color:#fff; background:#bd5700; font-size:10px; line-height:18px; font-weight:700; text-align:center; box-shadow:0 0 0 2px #fff; pointer-events:none; }


.storefront :is(#recent-products, #detail .related) .catalog-photo-actions .photo-pack-reference { left:7px; right:auto; max-width:calc(100% - 66px); white-space:normal; overflow-wrap:anywhere; box-sizing:border-box; }


/* Invert the compact cart colours when this exact pack is selected; its badge is the real quantity. */
.storefront :is(#recent-products, #detail .related) .catalog-photo-actions .buy-slot button[data-compact-cart][aria-pressed=true] { color:#d96800; }

.storefront :is(#recent-products, #detail .related) .catalog-photo-actions .buy-slot button[data-compact-cart][aria-pressed=true]::before { background:#fff4e8; box-shadow:inset 0 0 0 1px #f4c99d; }

.storefront :is(#recent-products, #detail .related) .catalog-photo-actions .buy-slot button[data-compact-cart][aria-pressed=true]:hover::before { background:#ffe9d2; }
.storefront #recent-products .catalog-photo-actions .recent-photo { display:flex; box-sizing:border-box; margin-bottom:0; text-decoration:none; }
.storefront #recent-products .catalog-photo-actions { margin-bottom:26px; }

/* Only these two blocks: mobile photo-edge icon, desktop wide labelled control. */
.storefront :is(#recent-products, #detail .related) .catalog-cart-label { display:none; }
@media(min-width:761px) {
  .storefront :is(#recent-products, #detail .related) .catalog-photo-actions { display:contents; }
  .storefront :is(#recent-products, #detail .related) .catalog-photo-actions>.buy-slot { position:static; order:20; width:100%; height:44px; margin-top:auto; padding-top:8px; box-sizing:content-box; }
  .storefront :is(#recent-products, #detail .related) .catalog-photo-actions .quick-quantity { width:100%; height:44px; }
  .storefront :is(#recent-products, #detail .related) .catalog-photo-actions .buy-slot button[data-compact-cart] { display:flex; justify-content:center; align-items:center; gap:8px; width:100%; min-width:0; font-size:13px; }
  .storefront :is(#recent-products, #detail .related) .catalog-photo-actions .buy-slot button[data-compact-cart]::before { inset:0; }
  .storefront :is(#recent-products, #detail .related) .catalog-cart-label { display:inline; }
  .storefront #recent-products .catalog-photo-actions .recent-photo { margin-bottom:10px; }
}

/* Recommendation price triples use the same single row; desktop columns unchanged. */
.storefront #detail .related .price { overflow-x:auto; overflow-y:hidden; scrollbar-width:thin; min-height:28px; }
.storefront #detail .related .price .product-price { display:flex; flex-wrap:nowrap; align-items:baseline; gap:5px; width:max-content; min-width:100%; max-width:none; }
.storefront #detail .related .price .discount-current { flex:none; max-width:none; overflow:visible; white-space:nowrap; }
.storefront #detail .related .price .discount-comparison { flex:0 0 auto; flex-wrap:nowrap; gap:5px; white-space:nowrap; }
@media(max-width:760px) {
  .storefront #detail .related .products { grid-template-columns:none; grid-auto-flow:column; grid-auto-columns:210px; overflow-x:auto; scroll-snap-type:x proximity; padding-bottom:12px; }
  .storefront #detail .related .product { scroll-snap-align:start; }
  .storefront #detail .related .product:nth-child(5) { display:flex; }
}
.storefront :is(#recent-products .recent-card, #detail .related .product) { container-type:inline-size; }
@container(max-width:209px) {
  .storefront :is(#recent-products .recent-price, #detail .related .price) .discount-current { font-size:clamp(15px,9cqi,18px); }
  .storefront :is(#recent-products .recent-price, #detail .related .price) .discount-regular { font-size:10px; }
  .storefront :is(#recent-products .recent-price, #detail .related .price) .discount-badge { font-size:10px; padding:3px; }
  .storefront :is(#recent-products .recent-price, #detail .related .price) :is(.product-price,.discount-comparison) { gap:3px; }
}
@media(min-width:761px) {
  .storefront :is(#recent-products, #detail .related) .catalog-photo-actions>.buy-slot,
  .storefront :is(#recent-products, #detail .related) .catalog-photo-actions .quick-quantity,
  .storefront :is(#recent-products, #detail .related) .catalog-photo-actions .buy-slot button[data-compact-cart] { height:48px; min-height:48px; }
  .storefront :is(#recent-products, #detail .related) .catalog-cart-label { max-width:calc(100% - 34px); white-space:normal; line-height:1.2; text-align:center; }
  .storefront :is(#recent-products, #detail .related) .catalog-photo-actions .buy-slot svg { flex:none; }
}

.storefront #detail .related .price { font-size:19px; }
.storefront :is(#recent-section, #detail .related) .secondary-delivery-estimate { font-size:12px; line-height:1.5; color:#627168; margin:0 0 14px; }
@media(max-width:760px) { .storefront :is(#recent-section, #detail .related) .secondary-delivery-estimate { display:none; } }
