/* ============================================
   GS Pack - Product cards
   v3 - 2025-02-25
   ============================================ */

/* === DESKTOP ONLY : Layout 60/40 === */
@media (min-width: 992px) {
  body#product .gs-pack-cards {
    flex: 0 0 60% !important;
    max-width: 60% !important;
  }
  body#product .col-purchase {
    flex: 0 0 40% !important;
    max-width: 40% !important;
  }
}

/* === GRID 3 colonnes desktop === */
.gs-pack-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 0;
}

/* === CARTE PRODUIT === */
.gs-pack-card {
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 12px;
  padding: 12px 8px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: box-shadow 0.2s;
}
.gs-pack-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

/* Image */
.gs-pack-card-img {
  width: 100%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  overflow: hidden;
}
.gs-pack-card-img img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 6px;
}

/* Nom */
.gs-pack-card-name {
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 6px;
  line-height: 1.3;
  min-height: 28px;
}
.gs-pack-card-name a { color: #222; text-decoration: none; }
.gs-pack-card-name a:hover { color: #1B8BDF; }

/* === ATTRIBUTS === */
.gs-pack-card-attrs { width: 100%; }
.gs-pack-attr-group { margin-bottom: 4px; }
.gs-pack-attr-label {
  font-size: 8px;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: center;
  margin-bottom: 2px;
}

/* === PILLS === */
.gs-pack-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  justify-content: center;
}
.gs-pack-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 7px;
  border: 1.5px solid #ddd;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 600;
  color: #333;
  background: #fff;
  cursor: pointer;
  transition: all 0.15s;
  min-height: 24px;
  line-height: 1;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}
.gs-pack-pill:hover {
  border-color: #1B8BDF;
  color: #1B8BDF;
  background: #f0f8ff;
}
.gs-pack-pill.active {
  border-color: #1B8BDF;
  border-width: 2px;
  color: #1B8BDF;
  background: #f0f8ff;
  font-weight: 700;
}
.gs-pack-pill.out-of-stock {
  opacity: 0.45;
  background: #f5f5f5;
  border-color: #ddd;
  color: #bbb;
  cursor: not-allowed;
  position: relative;
  text-decoration: line-through;
  text-decoration-color: #bbb;
}
.gs-pack-pill.out-of-stock.active {
  border-color: #1B8BDF;
  opacity: 0.6;
}

/* === PRIX === */
.gs-pack-card-price {
  margin-top: 6px;
  text-align: center;
  font-size: 11px;
}
.gs-pack-card-old {
  color: #999;
  text-decoration: line-through;
  font-size: 10px;
  margin-right: 3px;
}
.gs-pack-card-new {
  color: #e74c3c;
  font-weight: 700;
  font-size: 13px;
}

/* === SUCCESS === */
.gs-pack-cart-success {
  background: #27ae60;
  color: #fff;
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  text-align: center;
  margin-top: 10px;
}

/* ==============================
   TABLET : 2 colonnes
   ============================== */
@media (max-width: 991px) {
  .gs-pack-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .gs-pack-pill {
    padding: 4px 9px;
    font-size: 11px;
    min-height: 26px;
  }
}

/* ==============================
   MOBILE
   ============================== */
@media (max-width: 767px) {

  /* Colonnes 100% empilées - override product-purchase-block.css 65/35 */
  body#product.gs-pack-page .product-container > .col-md-7,
  body#product.gs-pack-page .product-container > .col-md-5,
  body#product.gs-pack-page .col-images,
  body#product.gs-pack-page .col-purchase {
    flex: 0 0 100% !important;
    max-width: 100% !important;
    width: 100% !important;
  }

  /* Annuler sticky résiduel */
  body#product .col-purchase .gs-block {
    position: static !important;
    top: auto !important;
    left: auto !important;
    width: auto !important;
  }

  /* Grille 2 colonnes compactes */
  .gs-pack-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  /* Carte verticale */
  .gs-pack-card {
    flex-direction: column;
    align-items: center;
    padding: 10px 6px 8px;
  }

  .gs-pack-card-img {
    width: 56px;
    height: 56px;
    min-width: 56px;
    aspect-ratio: 1;
    margin-bottom: 6px;
  }

  .gs-pack-card-name {
    font-size: 10px;
    text-align: center;
    min-height: auto;
    margin-bottom: 6px;
    line-height: 1.2;
  }

  /* Pills : grosses, wrappées, pleine largeur */
  .gs-pack-attr-label {
    font-size: 9px;
    text-align: center;
    margin-bottom: 3px;
  }
  .gs-pack-pills {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
  }
  .gs-pack-pill {
    padding: 6px 10px;
    font-size: 11px;
    min-height: 32px;
    border-radius: 25px;
  }

  .gs-pack-card-price {
    text-align: center;
    margin-top: 6px;
  }
  .gs-pack-card-old { font-size: 10px; }
  .gs-pack-card-new { font-size: 12px; }
}

/* Très petits écrans */
@media (max-width: 374px) {
  .gs-pack-grid {
    grid-template-columns: 1fr;
  }
}

/* ── PILLS VERROUILLÉES (auto-sélection config imposée) ─────────────────── */

/* Pill imposée non-active : visible, non cliquable, grisée légèrement */
.gs-pack-pill.gs-pack-pill-locked {
  opacity: 0.35;
  cursor: not-allowed;
  background: #f0f0f0;
  border-color: #d0d0d0;
  color: #999;
  pointer-events: none;
}

/* Pill imposée active : mise en avant couleur distinctive, non cliquable */
.gs-pack-pill.gs-pack-pill-locked-active {
  background: #1a3c5e;
  border-color: #1a3c5e;
  color: #fff;
  cursor: default;
  pointer-events: none;
  box-shadow: none;
  font-weight: 600;
}

/* Carte verrouillée : léger fond pour indiquer l'état imposé */
.gs-pack-card.gs-pack-card-locked {
  background: #f8f9fb;
}

/* Label "Sélectionné avec votre config" */
.gs-pack-auto-label {
  margin-top: 6px;
  font-size: 10px;
  color: #1a3c5e;
  text-align: center;
  font-style: italic;
  opacity: 0.85;
}
.gs-pack-auto-icon {
  margin-right: 3px;
  font-style: normal;
}
