/**
 * BIENHABILLÉ — product-card.css (Bloc C)
 * Carte produit boucle : ratio fixe, mini-carrousel galerie, pastilles, ajout rapide.
 */

.bh-product-card,
.bh-product-loop-item {
  position: relative;
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

.bh-product-card__media {
  position: relative;
  width: 100%;
  max-width: 100%;
}

/* ─── Défilement horizontal (scroll-snap) : une vue par couleur / image ─── */
.bh-product-card__slider {
  position: relative;
  outline: none;
  width: 100%;
  max-width: 100%;
}

/* --bh-card-slide-w (px) est défini par shop-archive.js ; secours 100 % une fois la grille WC neutralisée. */
.bh-product-card__viewport {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}

.bh-product-card__viewport::-webkit-scrollbar {
  display: none;
  height: 0;
}

.bh-product-card__slide {
  flex: 0 0 var(--bh-card-slide-w, 100%);
  min-width: var(--bh-card-slide-w, 100%);
  max-width: var(--bh-card-slide-w, 100%);
  scroll-snap-align: start;
  scroll-snap-stop: always;
  box-sizing: border-box;
}

.bh-product-card__slide-link {
  display: block;
  width: 100%;
  text-decoration: none;
  color: inherit;
}

.bh-product-card__image {
  position: relative;
  aspect-ratio: var(--bh-card-image-ratio);
  overflow: hidden;
  background: var(--bh-bg-secondary);
}

.bh-product-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--bh-transition-base);
}

.bh-product-card__slide-link:hover .bh-product-card__image img {
  transform: scale(1.03);
}

/* Pastilles taille : tirets en haut à gauche, gris clair / actif plus foncé */
.bh-product-card__dots {
  position: absolute;
  top: 10px;
  left: 10px;
  bottom: auto;
  transform: none;
  display: flex;
  flex-direction: row;
  gap: 4px;
  z-index: 5;
  pointer-events: auto;
}

.bh-product-card:has(.bh-product-card__badges--start) .bh-product-card__dots {
  top: 42px;
}

.bh-product-card__dot {
  width: 14px;
  height: 3px;
  padding: 0;
  border: 0;
  border-radius: 1px;
  background: rgba(0, 0, 0, 0.18);
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}

.bh-product-card__dot:hover,
.bh-product-card__dot:focus-visible {
  background: rgba(0, 0, 0, 0.35);
}

.bh-product-card__dot.is-active {
  background: rgba(0, 0, 0, 0.55);
}

/* Desktop : chevrons fins sur les bords — masqués sur mobile */
.bh-product-card__arrows {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2px;
  pointer-events: none;
  z-index: 4;
}

.bh-product-card__arrow {
  width: 32px;
  height: 48px;
  margin: 0;
  border-radius: 0;
  border: 0;
  background: transparent;
  color: var(--bh-color-primary);
  font-size: 1.5rem;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s, transform 0.2s;
  opacity: 0.88;
}

.bh-product-card__arrow:hover,
.bh-product-card__arrow:focus-visible {
  opacity: 1;
  transform: scale(1.08);
  background: transparent;
}

/* Ajout rapide : bas centre sur mobile, bas droite sur desktop */
.bh-product-card__quick-add {
  position: absolute;
  right: var(--bh-space-sm);
  bottom: var(--bh-space-sm);
  z-index: 6;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: var(--bh-text-primary);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

@media (max-width: 1023px) {
  .bh-product-card__arrows {
    display: none !important;
  }

  .bh-product-card__quick-add {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
  }

  .bh-product-card__quick-add:hover,
  .bh-product-card__quick-add:focus-visible {
    transform: translateX(-50%) scale(1.06);
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.16);
  }
}

@media (min-width: 1024px) {
  .bh-product-card__quick-add:hover,
  .bh-product-card__quick-add:focus-visible {
    transform: scale(1.06);
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.16);
  }
}

.bh-product-card__quick-add--variable {
  /* Même icône : ouvre la fiche pour choisir taille / couleur */
}

.bh-product-card__badges--start .bh-product-card__badge {
  padding: var(--bh-space-2xs) var(--bh-space-sm);
  font-size: var(--bh-fs-xs);
  font-weight: var(--bh-fw-semibold);
  border-radius: var(--bh-radius-xs);
}

.bh-product-card__swatches {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: 0 0 var(--bh-space-xs);
}

.bh-product-card__swatch {
  width: 16px;
  height: 16px;
  border-radius: 1px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.14);
  flex-shrink: 0;
  display: block;
}

.bh-product-card__swatch img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.bh-product-card__swatch-hex {
  display: block;
  width: 100%;
  height: 100%;
}

.bh-product-card__swatches-more {
  font-size: var(--bh-fs-xs);
  font-weight: 600;
  color: var(--bh-text-secondary);
  padding: 0 2px;
}

.bh-product-card__meta {
  display: block;
  text-decoration: none;
  color: inherit;
}

.bh-product-card__body {
  padding: var(--bh-space-sm) 0;
}

.bh-product-card__title {
  font-size: var(--bh-card-title-fs);
  font-weight: var(--bh-fw-medium);
  color: var(--bh-text-primary);
  margin: 0 0 var(--bh-space-2xs);
  line-height: var(--bh-lh-tight);
}

.bh-product-card__meta:hover .bh-product-card__title {
  color: var(--bh-color-primary);
}

.bh-product-card__price {
  font-size: var(--bh-card-price-fs);
  color: var(--bh-text-primary);
}

.bh-product-card__price .bh-price--old {
  color: var(--bh-price-old-color);
  text-decoration: line-through;
}

.bh-product-card__price .bh-price--sale {
  color: var(--bh-price-sale-color);
}
