/*
 * Product page (store/pages/product): gallery, price and stock, buy box
 * (sticky at the bottom on phones), description, related products.
 */

.pdp { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s-8); margin-block: var(--s-4) var(--s-12); align-items: start; }
@media (max-width: 991px) { .pdp { grid-template-columns: 1fr; gap: var(--s-5); } }

/* ---- Gallery ----------------------------------------------------------------
   A scroll-snap slider (swipe on phones); product.js turns it and keeps the
   dots and thumbnails in step. Arrows show on hover / focus with a mouse and
   always on touch screens. One image: a single slide, no controls. */
.gallery { position: sticky; inset-block-start: calc(var(--header-h) + 60px); }
@media (max-width: 991px) { .gallery { position: static; } }
.gallery__main { position: relative; aspect-ratio: 1; border-radius: var(--r-xl); background: #fff; border: 1px solid var(--c-border); overflow: hidden; }
.gallery__track { display: flex; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.gallery__track::-webkit-scrollbar { display: none; }
.gallery__track:focus-visible { outline: 2px solid var(--c-primary); outline-offset: -2px; }
.gallery__slide { flex: 0 0 100%; height: 100%; scroll-snap-align: start; padding: var(--s-6); }
.gallery__slide img { width: 100%; height: 100%; object-fit: contain; }
.gallery__slide.img-failed img { padding: 22%; }
.gallery__main .product-card__discount { z-index: 2; inset-block-start: var(--s-4); inset-inline-start: var(--s-4); font-size: var(--fs-sm); padding: 4px 12px; }

.gallery__arrow {
  position: absolute; inset-block-start: 50%; z-index: 2; transform: translateY(-50%);
  width: 40px; height: 40px; display: grid; place-items: center;
  border-radius: var(--r-pill); background: rgba(255, 255, 255, .92); color: var(--c-text);
  border: 1px solid var(--c-border); box-shadow: var(--shadow-sm);
  opacity: 0; transition: opacity var(--t-fast), background var(--t-fast), color var(--t-fast);
}
.gallery__arrow--prev { inset-inline-start: var(--s-3); }
.gallery__arrow--next { inset-inline-end: var(--s-3); }
.gallery__main:hover .gallery__arrow, .gallery__arrow:focus-visible { opacity: 1; }
.gallery__arrow:hover { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }
@media (hover: none) { .gallery__arrow { opacity: 1; width: 34px; height: 34px; } }

.gallery__dots { position: absolute; inset-inline: 0; inset-block-end: var(--s-3); z-index: 2; display: flex; justify-content: center; gap: 6px; pointer-events: none; }
.gallery__dot { pointer-events: auto; width: 8px; height: 8px; padding: 0; border-radius: var(--r-pill); background: var(--c-border); transition: width var(--t-normal) var(--ease-out), background var(--t-normal); }
.gallery__dot.is-active { width: 22px; background: var(--c-primary); }

.gallery__thumbs { display: flex; gap: var(--s-2); margin-block-start: var(--s-3); overflow-x: auto; }
.gallery__thumb { flex: none; width: 72px; height: 72px; padding: 6px; border-radius: var(--r-md); background: #fff; border: 2px solid var(--c-border); transition: border-color var(--t-fast); }
.gallery__thumb img { width: 100%; height: 100%; object-fit: contain; }
.gallery__thumb.is-active, .gallery__thumb:hover { border-color: var(--c-primary); }
@media (max-width: 480px) { .gallery__thumb { width: 58px; height: 58px; } .gallery__slide { padding: var(--s-4); } }
@media (prefers-reduced-motion: reduce) { .gallery__track { scroll-behavior: auto; } }

/* ---- Info ------------------------------------------------------------------- */
.pdp__info { display: flex; flex-direction: column; gap: var(--s-3); }
.pdp__brand { align-self: flex-start; padding: 2px 10px; border-radius: var(--r-pill); background: var(--c-primary-light); color: var(--c-secondary); font-size: var(--fs-sm); font-weight: 700; }
.pdp__info h1 { font-size: clamp(22px, 2.6vw, var(--fs-2xl)); }
.pdp__price { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s-3); }
.pdp__price .price__now { font-size: var(--fs-3xl); }
.pdp__price .price__old { font-size: var(--fs-md); }
.pdp__save { padding: 2px 10px; border-radius: var(--r-pill); background: color-mix(in srgb, var(--c-accent) 16%, #fff); color: #B85A12; font-size: var(--fs-sm); font-weight: 700; }
.pdp__vat { color: var(--c-muted); font-size: var(--fs-xs); margin-block-start: -8px; }

.stock { display: inline-flex; align-items: center; gap: var(--s-2); font-weight: 700; font-size: var(--fs-sm); }
.stock i { font-size: 8px; }
.stock--ok { color: var(--c-success); }
.stock--low { color: var(--c-warning); }
.stock--low i { animation: pulse-dot 1.4s ease-in-out infinite; }
.stock--out { color: var(--c-muted); }
@keyframes pulse-dot { 50% { opacity: .3; } }

/* Buy box: big stepper; the "+" says "add to cart" while nothing is in the cart. */
.buy-box { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); padding-block: var(--s-3); }
.qty--lg { height: 52px; border-radius: var(--r-md); }
.qty--lg .qty__btn { width: 52px; height: 52px; font-size: 18px; }
.qty--lg .qty__value { min-width: 36px; font-size: var(--fs-lg); }
.qty__label { display: none; }
.qty--lg[data-qty="0"] { width: auto; }
.qty--lg[data-qty="0"] .qty__btn--plus { width: auto; display: inline-flex; gap: var(--s-2); padding-inline: var(--s-6); font-weight: 700; font-size: var(--fs-md); }
.qty--lg[data-qty="0"] .qty__label { display: inline; }
.buy-box__fav { width: 52px; height: 52px; position: static; border: 1.5px solid var(--c-border); box-shadow: none; border-radius: var(--r-md); }
@media (max-width: 767px) {
  .buy-box {
    position: fixed; inset-inline: 0; inset-block-end: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom)); z-index: 30;
    padding: var(--s-3) var(--s-4); background: #fff; border-block-start: 1px solid var(--c-border); box-shadow: 0 -8px 20px rgba(16, 24, 40, .08);
    flex-wrap: nowrap;
  }
  .buy-box .qty--lg { flex: 1; justify-content: space-between; }
  .buy-box .qty--lg[data-qty="0"] .qty__btn--plus { flex: 1; justify-content: center; }
  .buy-box__cart { display: none; }
  .pdp__related { padding-block-end: 80px; }
}

.pdp__perks { display: grid; gap: var(--s-2); padding: var(--s-4); border-radius: var(--r-lg); background: #fff; border: 1px solid var(--c-border); font-size: var(--fs-sm); color: var(--c-text-2); }
.pdp__perks i { width: 22px; color: var(--c-primary); }
.pdp__desc h2 { font-size: var(--fs-lg); margin-block: var(--s-3) var(--s-2); }
.prose { color: var(--c-text-2); line-height: 1.9; }
