/* ==========================================================================
   TRENDHUB — fiche produit
   ========================================================================== */

th-product,
th-gallery {
  display: block;
}
.product {
  display: grid;
  gap: 1.75rem;
  padding-bottom: clamp(3rem, 2rem + 4vw, 6rem);
}
@media (min-width: 990px) {
  .product {
    grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
    gap: clamp(2.5rem, 4vw, 5.5rem);
    padding-top: 1.5rem;
  }
}

/* ---------- Galerie ---------- */
.product__gallery {
  min-width: 0;
}
@media (max-width: 989px) {
  .product__gallery {
    margin-inline: calc(var(--gutter) * -1);
  }
}
.gallery {
  position: relative;
}
.gallery__track {
  position: relative;
  display: flex;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.gallery__track::-webkit-scrollbar {
  display: none;
}
.gallery__item {
  position: relative;
  flex: 0 0 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: var(--c-media);
  scroll-snap-align: start;
}
.gallery__zoom {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}
.gallery__img,
.gallery__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.gallery__counter {
  position: absolute;
  right: var(--gutter);
  bottom: 1rem;
  padding: 0.3rem 0.55rem;
  font-size: var(--fs-micro);
  letter-spacing: 0.12em;
  font-variant-numeric: tabular-nums;
  background: rgba(var(--c-bg-rgb), 0.88);
}
.gallery__dots {
  position: absolute;
  left: var(--gutter);
  bottom: 1.45rem;
  display: flex;
  gap: 5px;
}
.gallery__dot {
  width: 16px;
  height: 2px;
  background: rgba(var(--c-ink-rgb), 0.22);
  transition: background-color 0.3s var(--ease), width 0.4s var(--ease-out);
}
.gallery__dot.is-active {
  width: 28px;
  background: var(--c-ink);
}
@media (min-width: 990px) {
  .gallery__track {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    overflow: visible;
  }
  .gallery__item:first-child,
  .gallery__item:nth-child(even):last-child {
    grid-column: 1 / -1;
    aspect-ratio: 4 / 5;
  }
  .gallery__counter,
  .gallery__dots {
    display: none;
  }
  .gallery__zoom img {
    transition: transform 1.4s var(--ease-out);
  }
  .gallery__zoom:hover img {
    transform: scale(1.02);
  }
}

/* ---------- Informations ---------- */
.product__info {
  min-width: 0;
}
.product__info-inner {
  display: grid;
  gap: 1.5rem;
}
@media (min-width: 990px) {
  .product__info-inner {
    position: sticky;
    top: calc(var(--header-h) + 2rem);
    padding-bottom: 2rem;
  }
}
.product__head {
  display: grid;
  justify-items: start;
  gap: 0.65rem;
}
.product__vendor {
  font-size: var(--fs-micro);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 600;
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size 0.5s var(--ease-out);
}
.product__vendor:hover {
  background-size: 100% 1px;
}
.product__title {
  font: 400 clamp(2.1rem, 1.6rem + 1.8vw, 3.1rem) / 1.02 var(--f-serif);
  letter-spacing: -0.01em;
}
.product__price {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  font-size: var(--fs-md);
}
.product__tax {
  font-size: var(--fs-micro);
  letter-spacing: 0.1em;
  color: var(--c-muted);
}
.product__form {
  display: grid;
  gap: 1.5rem;
}

/* ---------- Options : tailles, couleurs ---------- */
.option {
  position: relative;
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
.option__legend {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  width: 100%;
  padding: 0;
  font-size: var(--fs-micro);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 500;
}
.option__value {
  font-size: var(--fs-sm);
  letter-spacing: 0.01em;
  text-transform: none;
  font-weight: 400;
  color: var(--c-muted);
}
.option__guide {
  margin-left: auto;
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0;
  font-size: var(--fs-micro);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 500;
  color: inherit;
  background: none;
  border: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.option__values {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.option__input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}
.option__pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-width: 3.1rem;
  height: 2.85rem;
  padding: 0 0.95rem;
  font-size: var(--fs-sm);
  border: 1px solid rgba(var(--c-ink-rgb), 0.2);
  cursor: pointer;
  user-select: none;
  transition: border-color 0.25s var(--ease), background-color 0.25s var(--ease), color 0.25s var(--ease);
}
@media (hover: hover) {
  .option__pill:hover {
    border-color: var(--c-ink);
  }
}
.option__input:checked + .option__pill {
  background: var(--c-ink);
  border-color: var(--c-ink);
  color: var(--c-bg);
}
.option__input:focus-visible + .option__pill {
  outline: 2px solid var(--c-ink);
  outline-offset: 2px;
}
.option__pill.is-unavailable {
  color: rgba(var(--c-ink-rgb), 0.42);
  background-image: linear-gradient(
    to top right,
    transparent calc(50% - 0.5px),
    rgba(var(--c-ink-rgb), 0.28) 50%,
    transparent calc(50% + 0.5px)
  );
}
.option__input:checked + .option__pill.is-unavailable {
  background-color: rgba(var(--c-ink-rgb), 0.08);
  color: var(--c-ink);
}
.option__swatch {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--swatch);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.16);
}
.option__input:checked + .option__pill .option__swatch {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.75);
}

/* ---------- Disponibilité, quantité, boutons ---------- */
.product__stock {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: var(--fs-sm);
}
.product__stock-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #5b7a5f;
}
.product__stock.is-low .product__stock-dot {
  background: #a87a3d;
}
.product__stock.is-out .product__stock-dot {
  background: var(--c-error);
}
.product__buy {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.6rem;
}
.qty--product {
  height: 3.25rem;
}
.qty--product .qty__btn {
  width: 42px;
}
.qty--product .qty__input {
  width: 40px;
  font-size: var(--fs-base);
}
.product__wa {
  margin-top: -0.75rem;
}

/* ---------- Accordéons ---------- */
.product__details {
  margin-top: 0.5rem;
}
.accordion {
  border-top: 1px solid var(--c-line);
}
.accordion:last-child {
  border-bottom: 1px solid var(--c-line);
}
.accordion__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 0;
  font-size: var(--fs-micro);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 500;
  list-style: none;
  cursor: pointer;
}
.accordion__summary::-webkit-details-marker {
  display: none;
}
.accordion__summary .icon {
  transition: transform 0.4s var(--ease-out);
}
.accordion[open] > .accordion__summary .icon {
  transform: rotate(45deg);
}
.accordion__content {
  padding-bottom: 1.4rem;
  font-size: var(--fs-sm);
  color: var(--c-muted);
}
.accordion[open] > .accordion__content {
  animation: th-rise 0.5s var(--ease-out);
}

/* ---------- Visionneuse plein écran ---------- */
dialog.lightbox {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--c-bg);
  overflow-y: auto;
  overscroll-behavior: contain;
}
dialog.lightbox::backdrop {
  background: var(--c-bg);
}
dialog.lightbox[open] {
  animation: th-fade-in-lb 0.4s var(--ease);
}
@keyframes th-fade-in-lb {
  from {
    opacity: 0;
  }
}
.lightbox__close {
  position: fixed;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 2;
  width: 48px;
  height: 48px;
  background: var(--c-bg);
}
.lightbox__list {
  display: grid;
  gap: 0.5rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0;
  list-style: none;
}
.lightbox__list img {
  width: 100%;
  height: auto;
  cursor: zoom-out;
}
