/* Catalog density: cards about 20% smaller, more products per screen. */
.catalog-grid{grid-template-columns:repeat(5,1fr);gap:36px 18px}
.catalog-grid .ref-card h3{font-size:max(5.2cqw,13.5px);min-height:max(14.4cqw,39px)}
.catalog-grid .ref-card .reference-price{font-size:max(5.2cqw,13.5px)}
.catalog-grid .ref-card .reference-details{font-size:max(4.55cqw,12.5px);height:max(12.45cqw,34px)}
.catalog-grid .ref-card .reference-bag{height:max(12.45cqw,34px);width:max(12.45cqw,34px)}
.catalog-grid .ref-card .reference-heart{height:max(12.45cqw,34px)}
.photo-navigation.is-empty{height:15.6cqw}
@media(max-width:1000px){.catalog-grid{grid-template-columns:repeat(4,1fr);gap:30px 14px}}
@media(max-width:680px){.catalog-grid{grid-template-columns:repeat(2,1fr);gap:26px 12px}.catalog-grid .ref-card .product-photo{height:62cqw}.catalog-grid .ref-card .photo-navigation{margin:-2cqw auto 6cqw}}

/* Product window gallery */
.reference-gallery.pg{position:relative;padding:0;overflow:hidden}
.pg-track{display:flex;height:100%;overflow-x:auto;overflow-y:hidden;scroll-snap-type:x mandatory;scrollbar-width:none;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch}
.pg-track::-webkit-scrollbar{display:none}
.pg-slide{flex:0 0 100%;height:100%;margin:0;padding:0 3cqw;scroll-snap-align:center;overflow:hidden;display:flex;align-items:center;justify-content:center;cursor:zoom-in}
.pg-slide img{width:100%;height:100%;object-fit:contain;transition:transform .35s ease;user-select:none;-webkit-user-drag:none}
.pg-slide.zoom{cursor:zoom-out}
.pg-slide.zoom img{transform:scale(1.6)}
.pg-count{position:absolute;top:16px;right:18px;direction:ltr;font:500 12px/1 Heebo,Arial,sans-serif;letter-spacing:.12em;color:var(--muted,#68635d);background:#ffffffd9;padding:7px 10px;pointer-events:none}
.pg-thumbs{display:flex;gap:8px;justify-content:safe center;overflow-x:auto;scrollbar-width:none;margin:-4cqw auto 8cqw;padding:2px 3.1cqw}
.pg-thumbs::-webkit-scrollbar{display:none}
.pg-thumb{flex:none;width:52px;height:52px;padding:3px;border:1px solid #e4e4e4;background:#fff;opacity:.62;cursor:pointer;transition:opacity .2s,border-color .2s}
.pg-thumb:hover{opacity:1}
.pg-thumb.active{border-color:#141414;opacity:1}
.pg-thumb img{width:100%;height:100%;object-fit:contain;display:block}
@media(max-width:680px){.pg-thumb{width:46px;height:46px}.pg-count{top:12px;right:12px}}
@media(prefers-reduced-motion:reduce){.pg-slide img{transition:none}}

/* Product window: smaller photo, balanced two column layout on wide screens */
.reference-gallery.pg{height:62cqw}
@media(min-width:900px){
 #product-dialog{width:min(1080px,calc(100% - 48px));max-width:1080px;height:fit-content;max-height:90dvh}
 .reference-product-window{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);column-gap:40px;align-items:start;padding:30px 36px 30px}
 .reference-product-window .reference-gallery.pg{grid-column:1;grid-row:1;height:430px;padding:0;background:#f7f6f3;position:sticky;top:30px}
 .reference-product-window .pg-slide{padding:0 18px}
 .reference-product-window .photo-navigation{grid-column:1;grid-row:2;margin:-26px auto 0;position:sticky;top:434px}
 .reference-product-window .pg-thumbs{grid-column:1;grid-row:3;margin:14px auto 0;padding:2px 0;position:sticky;top:498px}
 .reference-product-window .reference-window-body{grid-column:2;grid-row:1/span 4;padding:44px 0 0}
 .reference-product-window .photo-arrow{width:52px;height:50px;padding:15px}
 .reference-product-window .photo-arrow svg{width:16px;height:16px}
 .reference-window-body h2{font-size:23px;line-height:1.5;min-height:0;letter-spacing:.02em;margin:0 0 10px}
 .reference-window-body .reference-price{font-size:24px;margin:0 0 20px}
 .reference-window-body .reference-actions{gap:12px;margin:0 0 22px}
 .reference-window-body .reference-details{height:52px;font-size:16px}
 .reference-window-body .reference-bag{height:52px;width:52px;padding:12px}
 .reference-window-body .reference-heart{height:52px;width:40px;padding:6px}
 .reference-product-window .window-product-navigation{margin-top:22px}
}

/* Narrow screens: compact product window, photo no taller than a third of the screen */
@media(max-width:899px){
 #product-dialog{height:fit-content;max-height:92dvh}
 .reference-product-window{padding-bottom:18px}
 .reference-gallery.pg{height:min(62cqw,36dvh)}
 .reference-product-window .pg-slide{padding:0 10px}
 .reference-product-window .photo-navigation{margin:-22px auto 0}
 .reference-product-window .photo-arrow{width:44px;height:42px;padding:12px}
 .reference-product-window .photo-arrow svg{width:14px;height:14px}
 .reference-product-window .pg-thumbs{margin:10px auto 14px}
 .pg-thumb{width:42px;height:42px}
 .reference-window-body h2{font-size:19px;line-height:1.45;min-height:0;letter-spacing:.01em;margin:4px 0 8px}
 .reference-window-body .reference-price{font-size:20px;margin:0 0 14px}
 .reference-window-body .reference-actions{gap:10px;margin:0 0 16px}
 .reference-window-body .reference-details{height:46px;font-size:15px}
 .reference-window-body .reference-bag{height:46px;width:46px;padding:11px}
 .reference-window-body .reference-heart{height:46px;width:36px;padding:5px}
}
