/**
 * BienHabillé — Product Card CSS
 * Cards listing + hover taille overlay
 *
 * @package BienHabille
 */

/* ============================================================
   CARD
   ============================================================ */

.bh-product-card {
  position: relative;
  background: var(--bh-white);
  display: flex;
  flex-direction: column;
}

/* ============================================================
   IMAGE
   ============================================================ */

.bh-product-card__image-wrap {
  position: relative;
  background: var(--bh-beige-light);
  overflow: hidden;
  aspect-ratio: 3/4;
}

.bh-product-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--bh-transition-slow);
}

.bh-product-card:hover .bh-product-card__image {
  transform: scale(1.03);
}

/* ============================================================
   HOVER OVERLAY — Tailles
   ============================================================ */

.bh-product-card__hover {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--bh-space-4);
  opacity: 0;
  transition: opacity var(--bh-transition);
  padding: var(--bh-space-5);
}

.bh-product-card:hover .bh-product-card__hover {
  opacity: 1;
}

/* Tooltip titre */
.bh-product-card__hover-title {
  background: var(--bh-white);
  color: var(--bh-black);
  font-size: var(--bh-text-xs);
  font-weight: 600;
  padding: var(--bh-space-2) var(--bh-space-4);
  border-radius: var(--bh-radius-pill);
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Grille tailles */
.bh-product-card__sizes {
  width: 100%;
}

.bh-product-card__sizes-label {
  font-size: var(--bh-text-xs);
  color: var(--bh-white);
  font-weight: 600;
  text-align: center;
  margin-bottom: var(--bh-space-2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.bh-product-card__sizes-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
}

.bh-product-card__size-btn {
  background: var(--bh-white);
  border: none;
  padding: var(--bh-space-2) var(--bh-space-1);
  font-size: 11px;
  font-weight: 600;
  color: var(--bh-black);
  cursor: pointer;
  text-align: center;
  transition: background var(--bh-transition), color var(--bh-transition);
  font-family: var(--bh-font);
  line-height: 1.4;
}

.bh-product-card__size-btn:hover {
  background: var(--bh-black);
  color: var(--bh-white);
}

.bh-product-card__size-btn--unavailable {
  opacity: 0.4;
  cursor: not-allowed;
  text-decoration: line-through;
}

/* ============================================================
   BADGES
   ============================================================ */

.bh-product-card__badges {
  position: absolute;
  top: var(--bh-space-3);
  left: var(--bh-space-3);
  display: flex;
  flex-direction: column;
  gap: var(--bh-space-1);
  z-index: 2;
}

.bh-product-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px var(--bh-space-3);
  border-radius: var(--bh-radius-pill);
  font-size: 11px;
  font-weight: 700;
  text-transform: lowercase;
  letter-spacing: 0.02em;
  background: var(--bh-black);
  color: var(--bh-white);
}

.bh-product-badge--new    { background: var(--bh-black);  color: var(--bh-white); }
.bh-product-badge--sale   { background: var(--bh-red);    color: var(--bh-white); }
.bh-product-badge--custom { background: var(--bh-black);  color: var(--bh-white); }

/* Badge "Epuisé" */
.bh-product-badge--sold-out {
  background: var(--bh-gray-text);
  color: var(--bh-white);
}

/* ============================================================
   CONTENU CARTE
   ============================================================ */

.bh-product-card__body {
  padding: var(--bh-space-3) var(--bh-space-2) var(--bh-space-4);
  display: flex;
  flex-direction: column;
  gap: var(--bh-space-2);
  flex: 1;
}

/* Swatches couleur */
.bh-product-card__swatches {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.bh-product-card__swatch {
  width: 16px;
  height: 16px;
  border-radius: 2px;
  border: 1px solid var(--bh-gray-mid);
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--bh-transition);
  flex-shrink: 0;
}

.bh-product-card__swatch:hover,
.bh-product-card__swatch.is-active {
  transform: scale(1.15);
  border-color: var(--bh-black);
}

.bh-product-card__swatch img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Titre */
.bh-product-card__title {
  font-size: var(--bh-text-sm);
  font-weight: 400;
  color: var(--bh-black);
  line-height: 1.3;
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.bh-product-card__title:hover {
  color: var(--bh-gray-text);
}

/* Prix */
.bh-product-card__price-wrap {
  display: flex;
  align-items: center;
  gap: var(--bh-space-2);
}

.bh-product-card__price {
  font-size: var(--bh-text-sm);
  font-weight: 700;
  color: var(--bh-black);
}

.bh-product-card__price--sale {
  color: var(--bh-red);
}

.bh-product-card__price-original {
  font-size: var(--bh-text-sm);
  font-weight: 400;
  color: var(--bh-gray-text);
  text-decoration: line-through;
}

/* ============================================================
   GRILLE SHOP
   ============================================================ */

.bh-shop-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--bh-space-1);
}

.bh-shop-grid--2col {
  grid-template-columns: repeat(2, 1fr);
}

@media (max-width: 1279px) {
  .bh-shop-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 767px) {
  .bh-shop-grid { grid-template-columns: repeat(2, 1fr); }
  .bh-product-card__hover { display: none; } /* pas d'hover sur mobile */
}