/**
 * ==============================================================================
 * CARTE PRODUIT UNIQUE (THE TIMER'S)
 * Fichier : assets/css/02-components/product-card.css
 * ==============================================================================
 * SPÉCIFICATIONS (Phase 2 Corrigée) :
 * - Fond gris #E9E9E9
 * - Coins arrondis 10 px sur le bloc, 0 px sur l'image produit carrée 1:1
 * - Image au ratio 1:1 (cadrage carré fidèle au site actuel)
 * - Badge "En rupture de stock" si hors-stock
 * - Marque en majuscules (Inter Tight 700)
 * - Nom limité à 2 lignes avec hauteur réservée pour aligner les prix
 * - Bouton plein pêche #E7B088 "Voir les détails" (texte bleu nuit #272361, ratio AA 7,31:1)
 * - Carte intégralement cliquable vers la fiche produit
 * - AUCUN bouton WhatsApp sur la carte produit
 */

.tt-product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background-color: var(--wp--preset--color--base, #FFFFFF);
  border: 1px solid #EBEBEF;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: none;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  height: 100%;
  cursor: pointer;
}

.tt-product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px -8px rgba(20, 20, 43, 0.08);
  border-color: var(--wp--preset--color--accent, #E7B088);
}

/* 1. Zone Image Carrée 1:1 (Fond galerie horlogère neutre #F7F7F9) */
.tt-product-card__media {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background-color: #F7F7F9;
  border-bottom: 1px solid #F0F0F4;
  border-radius: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tt-product-card__media .wp-block-post-featured-image,
.tt-product-card__media .wp-block-post-featured-image a {
  width: 100%;
  height: 100%;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tt-product-card__media img,
.tt-product-card__media .wp-block-post-featured-image img {
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background-color: transparent;
  border-radius: 0;
  padding: 1rem;
  transition: transform 0.4s ease;
}

.tt-product-card:hover .tt-product-card__media img {
  transform: scale(1.03);
}

/* Badges minimalistes monochromes sur l'image produit */
.tt-product-card__badge,
.tt-product-card__badge-outofstock,
.tt-product-card__badge--sale,
.tt-product-card__badge--lowstock,
.tt-product-card__badge--new {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 2;
  padding: 0.3125rem 0.625rem;
  background-color: rgba(255, 255, 255, 0.96);
  color: var(--wp--preset--color--primary, #272361);
  border: 1px solid rgba(39, 35, 97, 0.14);
  font-family: var(--tt-font-body, "Inter Tight", sans-serif);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 3px;
  pointer-events: none;
  box-shadow: none;
}

.outofstock .tt-product-card__media::after,
.is-out-of-stock .tt-product-card__media::after {
  content: "Épuisé";
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 2;
  padding: 0.3125rem 0.625rem;
  background-color: rgba(255, 255, 255, 0.96);
  color: #6E6E77;
  border: 1px solid #E4E4E9;
  font-family: var(--tt-font-body, "Inter Tight", sans-serif);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 3px;
}

/* 2. Zone Contenu & Typographie */
.tt-product-card__content {
  display: flex;
  flex-direction: column;
  flex: 1 0 auto;
  padding: 1.25rem;
}

/* Marque en majuscules sobres et lisibles */
.tt-product-card__brand {
  font-family: var(--tt-font-body, "Inter Tight", sans-serif);
  font-size: 0.8125rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #6E6E77;
  margin-bottom: 0.375rem;
}

.tt-product-card__brand a {
  color: inherit;
  text-decoration: none;
}

/* Nom limité à 2 lignes avec finesse typographique (16px minimum sur mobile) */
.tt-product-card__title {
  font-family: var(--tt-font-heading, "Inter Tight", sans-serif);
  font-size: clamp(1rem, 0.98rem + 0.15vw, 1.0625rem);
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: -0.005em;
  color: #18181B;
  margin: 0 0 0.75rem 0;
  min-height: 2.9em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Carte entièrement cliquable via lien étirable */
.tt-product-card__title a {
  color: inherit;
  text-decoration: none;
}

.tt-product-card__title a::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

/* Prix en FCFA (Chiffres tabulaires sobres, poids 600) */
.tt-product-card__price {
  font-family: var(--tt-font-body, "Inter Tight", sans-serif);
  font-size: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--wp--preset--color--primary, #272361);
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid #F2F2F5;
  margin-bottom: 0.875rem;
}

/* 3. Bouton minimaliste "Voir les détails" */
.tt-product-card__action {
  position: relative;
  margin-top: 0.125rem;
  pointer-events: none;
}

.tt-product-card__btn,
a.tt-product-card__btn,
.wp-block-read-more.tt-product-card__btn {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  width: 100%;
  padding: 0.6875rem 1rem;
  min-height: 44px;
  background-color: #FAFAFC;
  color: var(--wp--preset--color--primary, #272361) !important;
  font-family: var(--tt-font-body, "Inter Tight", sans-serif);
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-align: center;
  text-transform: none;
  text-decoration: none !important;
  border: 1px solid #E5E5EC;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

a.tt-product-card__btn,
.wp-block-read-more.tt-product-card__btn {
  pointer-events: auto;
}

span.tt-product-card__btn {
  pointer-events: none;
}

.tt-product-card__btn::after {
  content: "→";
  display: inline-block;
  font-size: 0.8125rem;
  color: var(--wp--preset--color--accent, #E7B088);
  transition: transform 0.2s ease, color 0.2s ease;
}

.tt-product-card:hover .tt-product-card__btn {
  background-color: var(--wp--preset--color--primary, #272361);
  border-color: var(--wp--preset--color--primary, #272361);
  color: var(--wp--preset--color--base, #FFFFFF) !important;
}

.tt-product-card:hover .tt-product-card__btn::after {
  color: var(--wp--preset--color--accent, #E7B088);
  transform: translateX(3px);
}

/* 4. Densité adaptée aux écrans mobiles compacts (1 carte par ligne confortable) */
@media (max-width: 599px) {
  .tt-product-card__media img,
  .tt-product-card__media .wp-block-post-featured-image img {
    padding: 1rem;
  }

  .tt-product-card__content {
    padding: 1.125rem;
  }

  .tt-product-card__title {
    font-size: 1rem;
    min-height: auto;
  }

  .tt-product-card__price {
    font-size: 1.0625rem;
    margin-bottom: 0.75rem;
  }

  .tt-product-card__btn,
  a.tt-product-card__btn,
  .wp-block-read-more.tt-product-card__btn {
    padding: 0.6875rem 1rem;
    font-size: 0.9375rem;
  }
}
