/*
 * Fiche produit — galerie, summary, sélecteurs, tabs, anatomie, cross-sell, sticky CTA.
 */

/* ============================================================
   Layout
   ============================================================ */

.lpc-product {
  padding-block: var(--lpc-space-10);
}

.lpc-product__breadcrumb {
  font-size: var(--lpc-fs-small);
  color: var(--lpc-ink-3);
  margin-bottom: var(--lpc-space-6);
}

.lpc-product__breadcrumb a {
  color: var(--lpc-ink-3);
  text-decoration: none;
}

.lpc-product__top {
  display: grid;
  grid-template-columns: 45% 1fr; /* galerie réduite à ~3/4 (était 60%) */
  gap: var(--lpc-space-10);
  align-items: start;
}

@media (max-width: 1023px) {
  .lpc-product__top {
    grid-template-columns: 1fr;
    gap: var(--lpc-space-6);
  }
}

/* ============================================================
   Galerie
   ============================================================ */

.lpc-gallery {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: var(--lpc-space-4);
}

@media (max-width: 767px) {
  .lpc-gallery {
    grid-template-columns: 1fr;
  }
}

.lpc-gallery__thumbs {
  display: flex;
  flex-direction: column;
  gap: var(--lpc-space-2);
  max-height: 600px;
  overflow-y: auto;
  scrollbar-width: none;
}

.lpc-gallery__thumbs::-webkit-scrollbar { display: none; }

@media (max-width: 767px) {
  .lpc-gallery__thumbs { display: none; }
}

.lpc-gallery__thumb {
  aspect-ratio: 1 / 1;
  background: transparent;
  border: 2px solid transparent;
  border-radius: var(--lpc-radius-sm);
  cursor: pointer;
  overflow: hidden;
  padding: 0;
  transition: border-color 150ms ease;
}

.lpc-gallery__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.lpc-gallery__thumb--active {
  border-color: var(--lpc-ink);
}

.lpc-gallery__main {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--lpc-bg-2);
  border-radius: var(--lpc-radius);
  overflow: hidden;
}

@media (max-width: 767px) {
  .lpc-gallery__main {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }
  .lpc-gallery__main::-webkit-scrollbar { display: none; }
}

.lpc-gallery__slide {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  transition: opacity 200ms ease;
}

.lpc-gallery__slide--active {
  opacity: 1;
}

@media (max-width: 767px) {
  .lpc-gallery__slide {
    position: relative;
    flex: 0 0 100%;
    opacity: 1;
    scroll-snap-align: start;
  }
}

.lpc-gallery__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ============================================================
   Summary
   ============================================================ */

.lpc-summary {
  position: sticky;
  top: 120px;
  display: flex;
  flex-direction: column;
  gap: var(--lpc-space-4);
}

@media (max-width: 1023px) {
  .lpc-summary { position: static; }
}

.lpc-summary__pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--lpc-space-2);
}

.lpc-summary__title {
  font-family: var(--lpc-font-display);
  font-weight: 500;
  font-size: clamp(28px, 3vw, 38px);
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--lpc-ink);
  margin: 0;
}

.lpc-summary__rating {
  display: flex;
  align-items: center;
  gap: var(--lpc-space-2);
  text-decoration: none;
  color: var(--lpc-ink-3);
  font-size: var(--lpc-fs-small);
}

.lpc-summary__stars { letter-spacing: 2px; color: var(--lpc-line); }
.lpc-summary__star--filled { color: var(--lpc-butter); }

.lpc-summary__price {
  font-family: var(--lpc-font-display);
  font-weight: 500;
  font-size: clamp(28px, 2.5vw, 32px);
  color: var(--lpc-ink);
  margin-block: var(--lpc-space-2);
}

.lpc-summary__price ins {
  background: transparent;
  color: var(--lpc-terra);
  text-decoration: none;
}

.lpc-summary__price del {
  color: var(--lpc-ink-3);
  margin-right: var(--lpc-space-2);
  font-size: 0.7em;
}

/* ============================================================
   Sélecteurs variations
   ============================================================ */

.lpc-variations { display: flex; flex-direction: column; gap: var(--lpc-space-5); margin-block: var(--lpc-space-5); }

.lpc-variation {
  display: flex;
  flex-direction: column;
  gap: var(--lpc-space-3);
}

.lpc-variation__label {
  font-size: var(--lpc-fs-small);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--lpc-ink-2);
}

.lpc-variation__selected {
  text-transform: none;
  font-weight: 400;
  color: var(--lpc-ink-3);
  margin-left: var(--lpc-space-2);
}

.lpc-variation__chips,
.lpc-variation__swatches {
  display: flex;
  gap: var(--lpc-space-2);
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
}

.lpc-variation__chip[aria-checked="true"] {
  background: var(--lpc-ink);
  color: var(--lpc-bg);
}

.lpc-variation__chip[aria-disabled="true"],
.lpc-variation__chip:disabled {
  opacity: 0.4;
  text-decoration: line-through;
  cursor: not-allowed;
}

.lpc-variation__swatch {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid transparent;
  outline: 1px solid var(--lpc-line);
  outline-offset: -1px;
  cursor: pointer;
  transition: border-color 150ms ease;
}

.lpc-variation__swatch[aria-checked="true"] {
  border-color: var(--lpc-ink);
}

.lpc-variation__swatch:hover {
  border-color: var(--lpc-ink-2);
}

.lpc-variation__swatch[aria-disabled="true"] {
  opacity: 0.4;
  cursor: not-allowed;
}

.lpc-variation__hidden-select {
  position: absolute;
  left: -9999px;
  opacity: 0;
}

/* ============================================================
   Add to cart
   ============================================================ */

.lpc-add-to-cart {
  display: flex;
  gap: var(--lpc-space-3);
  align-items: stretch;
  margin-top: var(--lpc-space-5);
  flex-wrap: wrap;
}

/* ---------- Quantity widget — style container + input, Blocksy gère les arrows ---------- */

.lpc-add-to-cart .quantity {
  border: 1px solid var(--lpc-line);
  border-radius: var(--lpc-radius-pill);
  background: var(--lpc-bg);
  min-height: 54px;
  --quantity-arrows-initial-color: var(--lpc-ink-2);
}

.lpc-add-to-cart .quantity input.qty {
  background: transparent;
  border: none;
  text-align: center;
  font-family: var(--lpc-font-body);
  font-size: 15px;
  font-weight: 500;
  color: var(--lpc-ink);
  outline: none;
  min-height: 54px;
}

/* ---------- Button Add to cart — override Blocksy Woo blue ---------- */

/* Spécificité maximale pour battre Blocksy sur toutes les pages Woo */
.lpc-product .lpc-add-to-cart button.single_add_to_cart_button,
.lpc-product .lpc-add-to-cart .single_add_to_cart_button.button,
form.cart .single_add_to_cart_button.lpc-btn,
button.single_add_to_cart_button.lpc-btn--primary {
  flex: 1;
  min-width: 200px;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: var(--lpc-space-2);
  background: var(--lpc-terra) !important;
  color: var(--lpc-bg) !important;
  border: none !important;
  border-radius: var(--lpc-radius-pill) !important;
  padding: 16px 28px !important;
  font-family: var(--lpc-font-body) !important;
  font-weight: 500 !important;
  font-size: 17px !important;
  line-height: 1 !important;
  cursor: pointer;
  transition: background var(--lpc-t-fast), transform 180ms ease;
  text-decoration: none;
  min-height: 54px;
  text-transform: none !important;
}

.lpc-product .lpc-add-to-cart button.single_add_to_cart_button:hover:not(:disabled),
.lpc-product .lpc-add-to-cart .single_add_to_cart_button.button:hover:not(:disabled),
button.single_add_to_cart_button.lpc-btn--primary:hover:not(:disabled) {
  background: var(--lpc-terra-dark) !important;
  color: var(--lpc-bg) !important;
  transform: translateY(-1px);
}

.lpc-add-to-cart .single_add_to_cart_button:disabled,
.lpc-add-to-cart .single_add_to_cart_button.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.lpc-add-to-cart__price:not(:empty)::before { content: "·"; margin-right: 6px; }

.lpc-summary__question { margin-top: var(--lpc-space-4); width: 100%; justify-content: center; }

/* ============================================================
   Tabs + anatomie
   ============================================================ */

.lpc-product__details { margin-top: var(--lpc-space-16); }

.lpc-tabs {
  border-bottom: 1px solid var(--lpc-line);
  margin-bottom: var(--lpc-space-8);
  overflow-x: auto;
  scrollbar-width: none;
}
.lpc-tabs::-webkit-scrollbar { display: none; }

.lpc-tabs__list {
  display: flex;
  gap: var(--lpc-space-6);
  list-style: none;
  margin: 0;
  padding: 0;
  white-space: nowrap;
}

.lpc-tabs__tab {
  padding: var(--lpc-space-3) 0;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  font-family: var(--lpc-font-body);
  font-size: 15px;
  font-weight: 500;
  color: var(--lpc-ink-3);
  cursor: pointer;
  transition: color 150ms ease, border-color 150ms ease;
}

.lpc-tabs__tab[aria-selected="true"] {
  color: var(--lpc-ink);
  border-bottom-color: var(--lpc-ink);
}

.lpc-tabs__panel { display: none; max-width: 760px; }
.lpc-tabs__panel--active { display: block; }
.lpc-tabs__panel h3 { font-family: var(--lpc-font-display); font-size: 20px; margin-bottom: var(--lpc-space-3); }

/* Cache le <summary> du <details> en desktop (le tab fait déjà office de label) */
.lpc-tabs__panel summary { display: none; }
.lpc-tabs__panel details[open] summary,
.lpc-tabs__panel details > summary { list-style: none; }
.lpc-tabs__panel summary::-webkit-details-marker { display: none; }

@media (max-width: 767px) {
  .lpc-tabs { display: none; }
  .lpc-tabs__panel { display: block !important; margin-bottom: var(--lpc-space-6); }
  /* Ré-affiche le <summary> sur mobile comme accordion */
  .lpc-tabs__panel summary { display: block; cursor: pointer; padding: var(--lpc-space-4) 0; border-bottom: 1px solid var(--lpc-line); font-weight: 600; font-family: var(--lpc-font-display); font-size: 16px; }
  .lpc-tabs__panel[open] summary { border-bottom: none; }
}

.lpc-anatomy {
  margin-top: var(--lpc-space-10);
  padding: var(--lpc-space-6);
  background: var(--lpc-bg-2);
  border-radius: var(--lpc-radius);
}

.lpc-anatomy__title {
  font-family: var(--lpc-font-display);
  font-size: 20px;
  font-weight: 500;
  margin-bottom: var(--lpc-space-4);
}

.lpc-anatomy__table { width: 100%; border-collapse: collapse; }
.lpc-anatomy__table th,
.lpc-anatomy__table td {
  padding: var(--lpc-space-3) 0;
  text-align: left;
  border-bottom: 1px solid var(--lpc-line);
}
.lpc-anatomy__table th {
  font-weight: 600;
  color: var(--lpc-ink-2);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  width: 140px;
}
.lpc-anatomy__table td { color: var(--lpc-ink); }

/* ============================================================
   Cross-sell
   ============================================================ */

.lpc-crosssell { margin-top: var(--lpc-space-16); }
.lpc-crosssell__title {
  font-family: var(--lpc-font-display);
  font-size: clamp(24px, 2.5vw, 32px);
  text-align: center;
  margin-bottom: var(--lpc-space-8);
}
.lpc-crosssell__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--lpc-space-5);
}
@media (max-width: 1023px) { .lpc-crosssell__grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 479px) { .lpc-crosssell__grid { grid-auto-flow: column; grid-auto-columns: 70%; grid-template-columns: none; overflow-x: auto; scroll-snap-type: x mandatory; } .lpc-crosssell__grid > * { scroll-snap-align: start; } }

/* ============================================================
   Sticky CTA mobile
   ============================================================ */

.lpc-sticky-cta {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 40;
  padding: var(--lpc-space-3) var(--lpc-space-4);
  padding-bottom: calc(var(--lpc-space-3) + env(safe-area-inset-bottom));
  background: var(--lpc-bg);
  border-top: 1px solid var(--lpc-line);
  box-shadow: 0 -4px 16px rgba(42,36,32,0.08);
  display: none;
  align-items: center;
  gap: var(--lpc-space-3);
  transform: translateY(100%);
  transition: transform 220ms ease;
}

.lpc-sticky-cta--visible { transform: translateY(0); }

@media (max-width: 1023px) {
  .lpc-sticky-cta { display: flex; }
}

.lpc-sticky-cta__price {
  font-family: var(--lpc-font-display);
  font-weight: 500;
  font-size: 18px;
  flex-shrink: 0;
}

.lpc-sticky-cta .lpc-btn { flex: 1; }

/* ============================================================
   YITH Product Add-Ons override (plugin à installer par user)
   ============================================================ */

.yith-wapo-container,
.yith-wapo-block,
.yith-wapo-group {
  margin-block: var(--lpc-space-5) !important;
}

.yith-wapo-addon label,
.yith-wapo-option-label {
  font-family: var(--lpc-font-body) !important;
  font-size: 14px !important;
  color: var(--lpc-ink) !important;
}

.yith-wapo-addon input[type="radio"] + label,
.yith-wapo-option {
  padding: var(--lpc-space-3) !important;
  border: 1px solid var(--lpc-line) !important;
  border-radius: var(--lpc-radius) !important;
  cursor: pointer;
  transition: border-color 150ms ease;
}

.yith-wapo-addon input[type="radio"]:checked + label,
.yith-wapo-option.selected {
  border-color: var(--lpc-ink) !important;
  background: var(--lpc-bg-2) !important;
}
