/* Catalog product browsing. Replaces the former storefront card/grid/list layers. */
.catalog-results-head { display:flex; align-items:center; justify-content:space-between; gap:12px; margin:0 0 14px; }
.result-count { margin:0; color:var(--catalog-muted); font-size:13px; }
.catalog-view-switch { display:flex; flex:none; padding:3px; gap:3px; border:1px solid var(--catalog-border); border-radius:12px; background:var(--catalog-soft); }
.catalog-view-switch button { display:inline-flex; align-items:center; justify-content:center; gap:6px; min-height:38px; padding:6px 12px; border:0; border-radius:8px; background:transparent; color:var(--catalog-muted); font-size:13px; }
.catalog-view-switch button.active { color:var(--catalog-primary); background:var(--catalog-surface); box-shadow:0 1px 4px rgba(0,0,0,.09); }
.product-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:16px; align-items:stretch; }
.product-card { min-width:0; display:flex; flex-direction:column; overflow:hidden; border:1px solid var(--catalog-border); border-radius:16px; background:var(--catalog-surface); transition:border-color 160ms ease,box-shadow 160ms ease; }
.product-card:focus-within { border-color:var(--catalog-primary); }
.product-image { position:relative; aspect-ratio:4/3; overflow:hidden; flex:none; background:var(--catalog-soft); }
:is(.product-photo,.product-sprite) { position:absolute; inset:0; width:100%; height:100%; display:block; }
.product-photo { object-fit:cover; }
.product-sprite { background-image:url('../images/products-sprite.png'); background-size:400% 400%; background-position:var(--sprite-x) var(--sprite-y); background-repeat:no-repeat; }
.product-info { display:flex; flex-direction:column; flex:1; align-items:stretch; gap:8px; min-width:0; padding:14px; }
.product-title-row { display:flex; align-items:center; gap:6px; min-width:0; }
.product-info h3 { flex:1; min-width:0; margin:0; color:var(--catalog-text); font:600 16px/1.35 var(--sans); overflow-wrap:anywhere; }
.product-description { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; margin:0; color:var(--catalog-muted); font-size:13px; line-height:1.45; }
.product-badge { align-self:flex-start; justify-self:start; padding:4px 7px; border-radius:6px; background:var(--catalog-accent-soft); color:var(--catalog-primary); font-size:10px; font-weight:600; line-height:1.2; }
.product-price-line { display:flex; flex-wrap:wrap; align-items:baseline; gap:4px 6px; }
.product-price-line small { color:var(--catalog-muted); font-size:12px; }
.product-price-line strong { color:var(--catalog-primary); font-size:19px; font-weight:600; white-space:nowrap; font-variant-numeric:tabular-nums; }
.catalog-option-preview { display:flex; flex-wrap:wrap; gap:6px; margin:2px 0; }
.catalog-option-tile { position:relative; display:flex; flex-direction:column; flex:1 1 70px; min-width:0; border:1px solid var(--catalog-border); border-radius:9px; background:var(--catalog-soft); color:var(--catalog-text); }
.catalog-option-copy { display:flex; flex:1; flex-direction:column; align-items:flex-start; justify-content:center; gap:3px; min-height:48px; padding:8px; }
.catalog-option-copy span { font-size:13px; line-height:1.35; overflow-wrap:anywhere; }
.catalog-option-copy b { color:var(--catalog-primary); font-size:15px; line-height:1.3; font-weight:650; white-space:nowrap; font-variant-numeric:tabular-nums; }
.catalog-option-tile:has(.catalog-option-action:not([hidden])) .catalog-option-copy { padding-bottom:34px; }
.catalog-option-action { position:absolute; inset:0; display:flex; align-items:flex-end; justify-content:flex-start; width:100%; height:100%; padding:7px 8px; border:0; border-radius:inherit; background:transparent; color:var(--catalog-primary); text-align:left; font:650 12px/1.35 var(--sans); touch-action:manipulation; }
.catalog-option-selected { display:flex; align-items:center; gap:4px; padding:0 8px 6px; color:var(--catalog-primary); font-size:12px; font-weight:650; }
.catalog-option-tile:has(.catalog-option-action:is(:hover,:focus-visible):not(:disabled)) { border-color:var(--catalog-primary); background:var(--catalog-accent-soft); }
.catalog-option-tile.is-in-cart { min-width:min(120px,100%); border-color:var(--catalog-primary); background:var(--catalog-accent-soft); }
.catalog-option-tile:has(.catalog-option-action:disabled) { background:var(--catalog-soft); }
.catalog-option-action:disabled { cursor:not-allowed; }
.catalog-option-quantity { padding-bottom:4px; display:grid; grid-template-columns:44px minmax(0,1fr) 44px; align-items:center; border-top:1px solid var(--catalog-border); border-radius:0 0 8px 8px; overflow:hidden; background:var(--catalog-surface); }
.catalog-option-quantity button { display:grid; place-items:center; width:44px; min-height:44px; padding:0; border:0; background:transparent; color:var(--catalog-primary); font:600 22px/1 var(--sans); touch-action:manipulation; }
.catalog-option-quantity button:hover:not(:disabled) { background:var(--catalog-accent-soft); }
.catalog-option-quantity button:disabled { color:var(--catalog-muted); cursor:not-allowed; }
.catalog-option-quantity output { display:contents; color:var(--catalog-text); font-size:15px; font-weight:650; font-variant-numeric:tabular-nums; }
.catalog-option-quantity output strong { grid-column:2; grid-row:1; min-width:0; text-align:center; overflow-wrap:anywhere; font:inherit; }
.catalog-option-quantity button:first-child { grid-column:1; grid-row:1; }
.catalog-option-quantity button:last-child { grid-column:3; grid-row:1; }
.catalog-option-quantity output small { grid-column:1 / -1; grid-row:2; padding:0 4px; color:var(--catalog-text); font-size:12px; font-weight:500; line-height:1.25; text-align:center; overflow-wrap:anywhere; }
.product-purchase { margin-top:auto; padding-top:4px; }
.add-button { display:flex; align-items:center; justify-content:center; gap:8px; width:100%; min-height:44px; padding:10px 14px; border:1px solid var(--catalog-primary); border-radius:10px; background:var(--catalog-primary); color:#fff; font:600 13px/1.3 var(--sans); touch-action:manipulation; transition:background-color 160ms ease; }
.add-button:hover:not(:disabled) { border-color:var(--catalog-primary-strong); background:var(--catalog-primary-strong); }
.add-button:disabled { color:var(--catalog-muted); background:var(--catalog-soft); border-color:var(--catalog-border); cursor:not-allowed; }
.product-favorite { flex:0 0 44px; display:grid; place-items:center; width:44px; height:44px; margin:-8px -6px -8px 0; padding:0; border:0; border-radius:9px; background:transparent; color:var(--catalog-primary); font-size:18px; }
.product-favorite .favorite-icon-active { display:none; }
.product-favorite[aria-pressed="true"] .favorite-icon-default { display:none; }
.product-favorite[aria-pressed="true"] .favorite-icon-active { display:block; }
.product-favorite[aria-pressed="true"] { background:var(--catalog-accent-soft); }
.product-cart-control { display:grid; grid-template-columns:44px minmax(0,1fr) 44px; align-items:center; gap:4px; width:100%; min-height:44px; border:1px solid var(--catalog-border); border-radius:10px; background:var(--catalog-accent-soft); overflow:hidden; }
.product-cart-control > button { display:grid; place-items:center; width:44px; height:44px; border:0; color:var(--catalog-primary); background:transparent; font-size:18px; touch-action:manipulation; }
.product-cart-control > button:hover { color:#fff; background:var(--catalog-primary); }
.product-cart-control > span { display:flex; flex-wrap:wrap; align-items:baseline; justify-content:center; gap:3px; min-width:0; }
.product-cart-control strong { color:var(--catalog-text); font-size:14px; }
.product-cart-control small { color:var(--catalog-muted); font-size:11px; overflow-wrap:anywhere; }
.product-card.is-sold_out :is(.product-photo,.product-sprite) { filter:grayscale(.45); opacity:.65; }
.catalog-list-category { display:none; }
.product-grid.is-list-view { grid-template-columns:minmax(0,1fr); gap:10px; }
.product-grid.is-list-view .catalog-list-category { display:flex; align-items:center; gap:10px; margin:14px 0 2px; color:var(--catalog-text); }
.catalog-list-category-icon { display:grid; place-items:center; width:32px; height:32px; border-radius:9px; background:var(--catalog-accent-soft); color:var(--catalog-primary); }
.catalog-list-category strong { font-size:15px; }
.catalog-list-category small { margin-left:auto; font-size:12px; color:var(--catalog-muted); }
.product-grid.is-list-view .product-card { display:grid; grid-template-columns:112px minmax(0,1fr) 154px; grid-template-areas:'image badge purchase' 'image title purchase' 'image description purchase' 'image price purchase' 'image options options'; align-items:start; gap:6px 16px; padding:14px; }
.product-grid.is-list-view .product-image { grid-area:image; width:112px; aspect-ratio:1; border-radius:10px; }
.product-grid.is-list-view .product-info { display:contents; }
.product-grid.is-list-view .product-title-row { grid-area:title; }
.product-grid.is-list-view .product-badge { grid-area:badge; }
.product-grid.is-list-view .product-description { grid-area:description; }
.product-grid.is-list-view .product-price-line { grid-area:price; }
.product-grid.is-list-view .catalog-option-preview { grid-area:options; justify-content:flex-start; }
.product-grid.is-list-view .catalog-option-tile { flex:0 1 106px; }
.product-grid.is-list-view .product-purchase { grid-area:purchase; align-self:center; margin:0; padding:0; }
.product-card [hidden], .product-grid > :is(.product-card,.catalog-list-category)[hidden] { display:none; }
@media (hover:hover) { .product-card:hover { border-color:color-mix(in srgb,var(--catalog-primary) 45%,var(--catalog-border)); box-shadow:0 3px 12px rgba(0,0,0,.04); } }
@media (max-width:1100px) { .product-grid { grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; } }
@media (max-width:700px) {
  .catalog-results-head { gap:8px; margin-bottom:10px; }
  .result-count { font-size:12px; }
  .catalog-view-switch button { min-height:40px; min-width:40px; padding:8px; }
  .catalog-view-switch button span { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
  .product-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
  .product-info { padding:10px; gap:7px; }
  .product-info h3 { font-size:15px; }
  .product-description { font-size:13px; }
  .product-price-line strong { font-size:17px; }
  .catalog-option-preview { gap:5px; }
  .catalog-option-tile { flex-basis:58px; }
  .catalog-option-copy { padding:7px 6px; }
  .catalog-option-copy b { font-size:14px; }
  .product-grid.is-list-view .product-card { grid-template-columns:82px minmax(0,1fr); grid-template-areas:'image badge' 'image title' 'image description' 'price price' 'options options' 'purchase purchase'; gap:5px 12px; padding:12px; }
  .product-grid.is-list-view .product-image { width:82px; }
  .product-grid.is-list-view .catalog-option-tile { flex:1 1 76px; }
  .product-grid.is-list-view .product-price-line { margin-top:2px; }
  .product-grid.is-list-view .product-purchase { padding-top:3px; }
}
