.categories{display:flex;gap:8px;overflow-x:auto;padding:1px 0 14px;scrollbar-width:none}
.categories::-webkit-scrollbar{display:none}
.categories button{flex:0 0 auto;border:1px solid #d7dce6;border-radius:999px;background:#fff;color:#263b65;padding:9px 14px;font-weight:700}
.categories button.active{background:#172b55;border-color:#172b55;color:#fff}
.categories button{display:inline-flex;align-items:center;gap:7px}.category-count{padding:3px 7px;border-radius:999px;background:#ad6f60;color:#fff;font-size:10px;line-height:1}.categories button.active .category-count{background:#fff;color:#8f5143}
.product-view{text-align:center}.product-counter{color:#6c7690;font-size:13px;margin-bottom:8px}.product-gallery{position:relative;display:flex;align-items:center;justify-content:center;background:#f3eee9;border-radius:14px;overflow:hidden;touch-action:pan-y}.product-gallery img{width:100%;max-height:58vh;object-fit:contain;display:block;cursor:zoom-in;transition:transform .22s ease}.product-gallery img.zoomed{transform:scale(2);cursor:zoom-out}.gallery-arrow{position:absolute;z-index:2;top:50%;transform:translateY(-50%);width:44px;height:44px;border:0;border-radius:50%;background:#172b55e8;color:#fff;font-size:34px;line-height:1}.gallery-arrow.prev{left:10px}.gallery-arrow.next{right:10px}.product-view h2{margin:14px 0 4px}.product-price{font-size:19px;font-weight:700;margin:0 0 14px}.product-view #fav{border:0;border-radius:999px;background:#172b55;color:#fff;padding:11px 18px;font-weight:700}.swipe-hint{display:block;color:#6c7690;margin-top:12px}.purchase-box{display:grid;grid-template-columns:1fr 88px;gap:9px;margin-top:14px;padding:12px;border-radius:12px;background:#f5f1ed;text-align:left}.purchase-box label{display:grid;gap:4px;color:#59657f;font-size:11px}.purchase-box select,.purchase-box input{width:100%;height:42px;padding:0 9px;border:1px solid #d8d2cd;border-radius:8px;background:#fff;color:#172b55;font:14px var(--font-body)}.purchase-box button{grid-column:1/-1;height:44px;border:0;border-radius:999px;background:#172b55;color:#fff;font:600 14px var(--font-body)}.purchase-box button:disabled{opacity:.55}.purchase-box>small,.purchase-box>p{grid-column:1/-1;margin:0;color:#59657f;text-align:center}
@media(min-width:720px){.categories{flex-wrap:wrap;overflow-x:visible}.categories button{max-width:100%;white-space:normal}}
.product-gallery img{touch-action:manipulation}
.product-gallery img.zoomed{transform:scale(2.35);cursor:zoom-out}
.product-view{opacity:1;transition:opacity .14s ease}.product-view.changing{opacity:.35}
.product-gallery{background:transparent;border-radius:0}.product-gallery img{max-height:76vh}.product-gallery img.zoomed{transform:scale(2.5)}
#dialog{width:min(96vw,760px);max-width:96vw;padding:8px 8px 16px;border-radius:10px}#dialog>.close{position:relative;z-index:4;margin:2px 2px 4px}.product-view h2{margin-left:10px;margin-right:10px}.product-price,.swipe-hint,.purchase-box{margin-left:10px;margin-right:10px}
@media(min-width:720px){#dialog{width:min(88vw,820px);max-width:88vw;padding:10px 10px 18px}.product-gallery img{max-height:72vh}}
.fixed-product-template{display:grid;grid-template-rows:auto minmax(300px,62vh) 44px 132px auto auto;min-height:min(88vh,850px)}.fixed-product-template .product-gallery{height:100%;min-height:0}.fixed-product-template .product-gallery img{width:100%;height:100%;max-height:none;object-fit:contain;object-position:center}.fixed-product-template .product-gallery img.zoomed{transform:translate(var(--pan-x,0px),var(--pan-y,0px)) scale(2.5);touch-action:none}.photo-controls,.product-navigation{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:10px}.photo-controls button,.product-navigation button{height:38px;border:0;background:transparent;color:#172b55;font:600 13px var(--font-body)}.photo-controls button:first-child,.product-navigation button:first-child{text-align:left}.photo-controls button:last-child,.product-navigation button:last-child{text-align:right}.photo-controls button:disabled{opacity:.25}.photo-controls span{color:#6c7690;font-size:12px}.fixed-product-data{height:132px;padding:4px 12px;overflow:hidden}.fixed-product-data h2{height:2.6em;margin:4px 0;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.fixed-product-data .product-price{height:28px;margin:0}.fixed-product-data .swipe-hint{height:34px;margin:5px 0 0}.product-navigation{grid-template-columns:1fr 1fr;border-top:1px solid #e2ddd9}.product-navigation button{padding:0 10px}.fixed-product-template .purchase-box{margin:8px 10px 0;min-height:118px}#dialogBody{transition:opacity .12s ease}#dialogBody.content-changing{opacity:.72}
@media(max-width:479px){.fixed-product-template{grid-template-rows:auto minmax(280px,56vh) 42px 126px auto auto;min-height:86vh}.fixed-product-data{height:126px}.product-navigation button{font-size:11px}}

/* Stały, wyśrodkowany kadr zdjęcia produktu. */
#dialog{position:relative;box-sizing:border-box}
#dialog>.close{position:absolute;z-index:20;top:8px;right:8px;float:none;margin:0}
#dialogBody{width:100%;clear:both;box-sizing:border-box}
.fixed-product-template{width:100%}
.fixed-product-template .product-gallery{width:100%;height:100%;min-height:0;padding:0;display:flex;align-items:center;justify-content:center;background:#f3eee9}
.fixed-product-template .product-gallery img{display:block;width:100%;height:100%;max-width:100%;max-height:100%;margin:auto;object-fit:contain;object-position:50% 50%;transform-origin:center center}

/* Produkt jest najważniejszy: kompaktowy kadr, minimum pustego tła. */
.photo-controls[hidden]{display:none!important}
.fixed-product-template.single-photo{grid-template-rows:auto minmax(360px,62vh) 0 88px auto auto}
.fixed-product-template.single-photo .fixed-product-data{height:88px;padding-top:6px}
.fixed-product-template .swipe-hint{display:none}
.product-navigation{gap:18px;justify-content:center;border-top:0;padding:8px 0}
.product-navigation button{justify-self:center;width:46px;height:46px;padding:0!important;border-radius:50%;background:#172b55;color:#fff!important;font:700 32px/42px Arial,sans-serif!important;text-align:center!important}
.fixed-product-template .purchase-box button{background:#172b55;color:#fff;font-weight:700}
@media(min-width:720px){#dialog{width:min(92vw,500px);max-width:500px}.fixed-product-template{grid-template-rows:auto minmax(420px,64vh) 44px 110px auto auto}.fixed-product-template.single-photo{grid-template-rows:auto minmax(420px,64vh) 0 88px auto auto}}
@media(max-width:479px){#dialog{width:calc(100vw - 12px);max-width:calc(100vw - 12px);padding:6px}.fixed-product-template,.fixed-product-template.single-photo{grid-template-rows:auto minmax(320px,58vh) 0 84px auto auto}.fixed-product-template:not(.single-photo){grid-template-rows:auto minmax(300px,55vh) 42px 84px auto auto}.fixed-product-data,.fixed-product-template.single-photo .fixed-product-data{height:84px}}

/* Najpierw zakup: przycisk koszyka ma mieścić się w pierwszym ekranie. */
#dialog{max-height:calc(100dvh - 12px);overflow-y:auto}
.fixed-product-template,.fixed-product-template.single-photo{grid-template-rows:auto minmax(300px,50vh) 0 76px auto auto;min-height:0}
.fixed-product-template:not(.single-photo){grid-template-rows:auto minmax(300px,48vh) 42px 76px auto auto}
.fixed-product-data,.fixed-product-template.single-photo .fixed-product-data{height:76px;padding:4px 8px}
.fixed-product-data h2{height:auto;min-height:2.4em;margin:2px 0 4px}
.fixed-product-data .product-price{height:auto;margin:0}
.fixed-product-template .purchase-box{margin:4px 8px 0;min-height:108px;padding:9px}
@media(min-width:720px){#dialog{width:min(92vw,440px);max-width:440px}}
@media(max-width:479px){.fixed-product-template,.fixed-product-template.single-photo{grid-template-rows:auto minmax(300px,52vh) 0 76px auto auto}.fixed-product-template:not(.single-photo){grid-template-rows:auto minmax(280px,48vh) 42px 76px auto auto}}

/* Stałe miejsca elementów zapobiegają znikaniu nazwy i ceny. */
.fixed-product-template>.product-counter{grid-row:1}
.fixed-product-template>.product-gallery{grid-row:2}
.fixed-product-template>.photo-controls{grid-row:3}
.fixed-product-template>.fixed-product-data{grid-row:4}
.fixed-product-template>.purchase-box{grid-row:5}
.fixed-product-template>.product-navigation{grid-row:6}
.photo-controls[hidden]{display:grid!important;visibility:hidden;height:0;min-height:0;overflow:hidden}
.product-navigation[hidden]{display:none!important}

/* Jeden czytelny pasek sprzedażowy: strzałka, koszyk, strzałka. */
.purchase-actions{grid-column:1/-1;display:grid;grid-template-columns:46px minmax(0,1fr) 46px;align-items:center;gap:8px;margin-top:2px}
.purchase-actions #addToCart{grid-column:auto;width:100%;height:48px;margin:0;font-size:16px}
.purchase-product-arrow{width:46px;height:46px!important;padding:0!important;border:0!important;border-radius:50%!important;background:#172b55!important;color:#fff!important;font:700 32px/42px Arial,sans-serif!important;text-align:center}
.purchase-action-status{display:flex;align-items:center;justify-content:center;min-height:46px;text-align:center;font-weight:600}

/* Zdjęcie jest trochę większe, lecz wariant i koszyk nadal pozostają widoczne. */
.fixed-product-template,.fixed-product-template.single-photo{grid-template-rows:auto minmax(330px,56vh) 0 76px auto auto}
.fixed-product-template:not(.single-photo){grid-template-rows:auto minmax(310px,53vh) 42px 76px auto auto}
@media(min-width:720px){#dialog{width:min(92vw,460px);max-width:460px}}
@media(max-width:479px){.fixed-product-template,.fixed-product-template.single-photo{grid-template-rows:auto minmax(320px,55vh) 0 76px auto auto}.fixed-product-template:not(.single-photo){grid-template-rows:auto minmax(300px,51vh) 42px 76px auto auto}}

/* Korekta po audycie S25/laptop: pełna cena i równy pasek akcji. */
.fixed-product-template,.fixed-product-template.single-photo{grid-template-rows:auto minmax(330px,56vh) 0 102px auto auto}
.fixed-product-template:not(.single-photo){grid-template-rows:auto minmax(310px,53vh) 42px 102px auto auto}
.fixed-product-data,.fixed-product-template.single-photo .fixed-product-data{height:102px;min-height:102px;overflow:visible}
.fixed-product-data h2{min-height:2.2em;margin:4px 0 6px}
.fixed-product-data .product-price{display:block!important;min-height:30px;line-height:30px;margin:0!important}
.purchase-actions button{grid-column:auto!important}
.purchase-actions .purchase-product-arrow{display:flex;align-items:center;justify-content:center;width:46px!important;min-width:46px;height:46px!important;margin:0!important}
.purchase-actions #addToCart{display:block;grid-column:2!important;width:100%!important;min-width:0;border-radius:999px}
.fixed-product-template .product-gallery img{touch-action:none;user-select:none;-webkit-user-drag:none}
.fixed-product-template .product-gallery img.zoomed{transform:translate(var(--pan-x,0px),var(--pan-y,0px)) scale(var(--zoom-scale,2.2))}
@media(max-width:479px){.fixed-product-template,.fixed-product-template.single-photo{grid-template-rows:auto minmax(315px,53vh) 0 98px auto auto}.fixed-product-template:not(.single-photo){grid-template-rows:auto minmax(295px,49vh) 42px 98px auto auto}.fixed-product-data,.fixed-product-template.single-photo .fixed-product-data{height:98px;min-height:98px}}
