/* =============================================================
   PRODUCT PAGE — styles spécifiques
   Utilise les variables CSS définies dans style.css
   ============================================================= */

/* ---- Breadcrumb ---- */
.breadcrumb {
  background: var(--muted);
  border-bottom: 1px solid var(--border);
}
.breadcrumb__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--muted-foreground);
}
.breadcrumb__inner a {
  color: var(--muted-foreground);
  text-decoration: none;
  transition: color 0.2s;
}
.breadcrumb__inner a:hover { color: var(--primary); }
.breadcrumb__inner span { color: var(--foreground); font-weight: 500; }
.breadcrumb__inner span:last-of-type { color: var(--primary); }
.breadcrumb__inner svg {
  width: 14px; height: 14px;
  stroke: currentColor; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  flex-shrink: 0;
}

/* ---- Product Hero ---- */
.product-hero {
  padding: 60px 0 80px;
}
.product-hero__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
}

/* ---- Galerie ---- */
.product-gallery {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 100px;
}
.product-gallery__main {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
  border: 1px solid hsl(142 69% 58% / 0.20);
}
.product-gallery__img-wrap {
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.product-gallery__img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.4s ease;
}
.product-gallery__img-wrap:hover img { transform: scale(1.04); }
.product-gallery__badge {
  position: absolute;
  top: 16px;
  left: 16px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Badge catégorie sur l'image (mobile only, caché par défaut) */
.product-gallery__cat-badge {
  display: none;
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: hsl(142 69% 58% / 0.15);
  border: 1px solid hsl(142 69% 58% / 0.3);
  color: var(--primary);
  backdrop-filter: blur(4px);
}
.product-gallery__thumbs {
  display: flex;
  gap: 10px;
}
.product-gallery__thumb {
  flex: 1;
  aspect-ratio: 1 / 1;
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  padding: 8px;
  transition: border-color 0.2s;
}
.product-gallery__thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.product-gallery__thumb.active,
.product-gallery__thumb:hover {
  border-color: var(--primary);
}

/* ---- Product Info (colonne droite) ---- */
.product-info {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.product-info__top {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.product-info__stock {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
}
.product-info__stock svg {
  width: 14px; height: 14px;
  stroke: currentColor; fill: none;
  stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round;
}
.product-info__stock--ok { color: var(--primary); }

.product-info__name {
  font-family: 'Syne', sans-serif;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
  line-height: 1.2;
  color: var(--foreground);
  margin: 0;
}

.product-info__rating {
  display: flex;
  align-items: center;
  gap: 10px;
}
.product-info__stars {
  display: flex;
  gap: 3px;
}
.product-info__stars svg {
  width: 18px; height: 18px;
}
.product-info__reviews {
  font-size: 0.85rem;
  color: var(--muted-foreground);
  text-decoration: underline;
  cursor: pointer;
}

.product-info__price-wrap {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.product-info__price {
  font-family: 'Syne', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
}
.product-info__price-note {
  font-size: 0.8rem;
  color: var(--muted-foreground);
}

.product-info__divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0;
}

/* ---- Variantes ---- */
.product-variants {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.product-variants__label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0;
}
.product-variants__pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.product-variants__pill {
  padding: 8px 18px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--foreground);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.product-variants__pill:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.product-variants__pill.active {
  border-color: var(--primary);
  background: hsl(142 69% 58% / 0.12);
  color: var(--primary);
}

/* ---- CTA quantité + panier ---- */
.product-cta {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.product-cta__add {
  flex: 1;
  min-width: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.product-cta__add svg {
  width: 18px; height: 18px;
  stroke: currentColor; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

.product-qty {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
}
.product-qty__btn {
  width: 42px;
  height: 48px;
  background: transparent;
  border: none;
  color: var(--foreground);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.product-qty__btn:hover { background: var(--secondary); }
.product-qty__btn svg {
  width: 16px; height: 16px;
  stroke: currentColor; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.product-qty__val {
  min-width: 40px;
  text-align: center;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  padding: 0 4px;
}

/* ---- Description courte ---- */
.product-info__short-desc {
  font-size: 0.92rem;
  color: var(--muted-foreground);
  line-height: 1.7;
  margin: 0;
  padding: 16px;
  background: var(--muted);
  border-radius: var(--radius);
  border-left: 3px solid var(--primary);
}

/* ---- Réassurance ---- */
.product-reassurance {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.product-reassurance__item {
  flex: 1;
  min-width: 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
}
.product-reassurance__icon {
  width: 22px; height: 22px;
  stroke: var(--primary); fill: none;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.product-reassurance__item span {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted-foreground);
}

/* ---- Onglets détails ---- */
.product-details {
  padding: 40px 0 80px;
  border-top: 1px solid var(--border);
}
.product-details__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

.product-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 40px;
  overflow-x: auto;
}
.product-tabs__btn {
  padding: 14px 28px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--muted-foreground);
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s, border-color 0.2s;
}
.product-tabs__btn:hover { color: var(--foreground); }
.product-tabs__btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.product-tabs__panel { display: none; }
.product-tabs__panel.active { display: block; }
.product-tabs__panel h3 {
  font-family: 'Syne', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--foreground);
}
.product-tabs__panel p,
.product-tabs__panel li {
  font-size: 0.95rem;
  color: var(--muted-foreground);
  line-height: 1.75;
  margin-bottom: 12px;
}
.product-tabs__panel ul,
.product-tabs__panel ol {
  padding-left: 20px;
  margin-bottom: 16px;
}

/* Tableau composition */
.product-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  font-size: 0.9rem;
}
.product-table td {
  padding: 10px 16px;
  border: 1px solid var(--border);
  color: var(--muted-foreground);
}
.product-table tr:nth-child(odd) td { background: var(--card); }
.product-table td:first-child { font-weight: 600; color: var(--foreground); }

/* Note info */
.product-details__note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  background: hsl(142 69% 58% / 0.06);
  border: 1px solid hsl(142 69% 58% / 0.2);
  border-radius: var(--radius);
  font-size: 0.85rem !important;
  color: var(--muted-foreground) !important;
  margin-bottom: 0 !important;
}
.product-details__note svg {
  width: 16px; height: 16px;
  stroke: var(--primary); fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  flex-shrink: 0;
  margin-top: 2px;
}

/* ---- Section produits similaires ---- */
.products-section--related {
  border-top: 1px solid var(--border);
}

/* ---- Lien pcard (pour product.html) ---- */
.pcard__link {
  display: block;
  text-decoration: none;
  color: inherit;
}

/* ---- Galerie photo unique (pas de miniatures) ---- */
.product-gallery--single .product-gallery__thumbs { display: none; }

/* ---- Description courte en liste ---- */
ul.product-info__short-desc {
  list-style: none;
  padding-left: 16px;
}
ul.product-info__short-desc li {
  position: relative;
  padding-left: 14px;
  font-size: 0.92rem;
  color: var(--muted-foreground);
  line-height: 1.7;
}
ul.product-info__short-desc li + li { margin-top: 4px; }
ul.product-info__short-desc li::before {
  content: '▸';
  color: var(--primary);
  position: absolute;
  left: 0;
  font-size: 0.85em;
  top: 3px;
}

/* ---- Carte hors stock ---- */
.pcard--outofstock { opacity: 0.65; pointer-events: auto; }
.pcard--outofstock:hover { transform: none; box-shadow: none; }
.pcard__badge--outofstock {
  background: hsl(0 84% 60% / 0.15);
  color: hsl(0 84% 70%);
  border: 1px solid hsl(0 84% 60% / 0.25);
}

/* ============================================================
   AVIS CLIENTS
   ============================================================ */
.product-reviews {
  padding: 64px 0;
  border-top: 1px solid var(--border);
}
.product-reviews__inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 24px;
}
.product-reviews__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.product-reviews__title {
  font-family: 'Syne', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--foreground);
  margin: 0;
}
.product-reviews__summary {
  display: flex;
  align-items: center;
  gap: 10px;
}
.product-reviews__stars,
.product-review__stars {
  display: flex;
  gap: 3px;
}
.product-reviews__stars svg,
.product-review__stars svg {
  width: 16px;
  height: 16px;
}
.product-reviews__count {
  font-size: 0.88rem;
  color: var(--muted-foreground);
}
.product-reviews__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Carte avis */
.product-review {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  transition: border-color .2s;
}
.product-review:hover { border-color: hsl(142 69% 58% / 0.3); }
.product-review__header {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.product-review__author {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--foreground);
}
.product-review__date {
  font-size: 0.8rem;
  color: var(--muted-foreground);
  margin-left: auto;
}
.product-review__text {
  font-size: 0.93rem;
  color: var(--muted-foreground);
  line-height: 1.65;
  margin: 0;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .product-hero__inner {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .product-gallery {
    position: static;
    max-width: 480px;
    margin: 0 auto;
    width: 100%;
  }
}

@media (max-width: 600px) {
  /* Breadcrumb masqué pour libérer de l'espace */
  .breadcrumb                 { display: none; }

  /* Héro plus compact */
  .product-hero               { padding: 16px 0 24px; }
  .product-hero__inner        { gap: 12px; }

  /* Image moins haute */
  .product-gallery__img-wrap  { aspect-ratio: 16 / 9; padding: 12px; }

  /* Badge catégorie sur l'image, masqué dans les infos */
  .product-gallery__cat-badge { display: inline-flex; }
  #productCat                 { display: none; }

  /* Supprimer "En stock" */
  .product-info__stock        { display: none; }

  /* Infos plus compactes */
  .product-info               { gap: 10px; }
  .product-info__name         { font-size: clamp(1.1rem, 5vw, 1.4rem); }
  .product-info__price        { font-size: 1.4rem; }

  /* CTA sur une seule ligne */
  .product-cta                { flex-direction: row; flex-wrap: nowrap; }
  .product-cta__add           { min-width: unset; }
  .product-qty__btn           { width: 36px; height: 40px; }

  .product-reassurance        { gap: 6px; }
  .product-reassurance__item  { min-width: 80px; }
  .product-tabs__btn          { padding: 12px 16px; font-size: 0.88rem; }
}
