/* ============================================================
   LAYOUT GLOBAL – PAGE PRODUIT
   ============================================================ */

#single-product {
  width: 100%;
}

/* =========================
     TOP PRODUIT (Galerie + Infos)
     ========================= */

.product-top {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--wp--preset--spacing--32);
  align-items: start;
}

.product-media,
.product-info {
  min-width: 0;
}

/* Responsive */
@media (max-width: 768px) {
  .product-top {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
     GALERIE PRODUIT – GLOBAL
     ============================================================ */

.product-gallery {
  width: 100%;
  margin: 0;
}

/* =========================
     MAIN SLIDER
     ========================= */

.product-gallery-main {
  position: relative;
  width: 100%;
  border-radius: 4px;
  background: #fff;
}

.product-gallery-main .swiper-slide {
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-gallery-main img {
  width: 100%;
  height: auto;
  max-height: 480px;
  max-width: 520px;
  margin: 0 auto;
  object-fit: contain;
}

@media screen and (max-width: 768px) {
  .product-gallery-main img {
    max-height: 300px;
  }
}

/* =========================
     NAVIGATION ARROWS
     ========================= */

.product-gallery-main .swiper-button-prev,
.product-gallery-main .swiper-button-next {
  color: var(--wp--preset--color--dark-blue);
  background: rgba(255, 255, 255, 0.9);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.product-gallery-main .swiper-button-prev::after,
.product-gallery-main .swiper-button-next::after {
  font-size: 14px;
  font-weight: 700;
}

/* =========================
     THUMBNAILS (flexbox, max 6)
     ========================= */

.product-gallery-thumbs {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}

.product-gallery-thumb {
  width: 80px;
  height: 80px;
  border: 2px solid var(--wp--preset--color--yellow);
  border-radius: 2px;
  padding: 6px;
  box-sizing: border-box;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-width 0.15s ease;
}

.product-gallery-thumb.active {
  border-width: 3px;
}

.product-gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ============================================================
     RÉASSURANCE
     ============================================================ */

#product-reassurance {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--wp--preset--spacing--16);
  margin: var(--wp--preset--spacing--32) 0;
}

@media (max-width: 768px) {
  #product-reassurance {
    grid-template-columns: 1fr;
  }
}

.reassurance-item {
  border-radius: 8px;
  background-color: var(--wp--preset--color--gray);
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: var(--wp--preset--spacing--16);
  padding: var(--wp--preset--spacing--8);
}

.reassurance-item span {
  font-weight: 600;
}

/* ============================================================
     DÉTAILS PRODUIT
     ============================================================ */

.product-details {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--wp--preset--spacing--32);
  align-items: start;
}

@media (max-width: 768px) {
  .product-details {
    grid-template-columns: 1fr;
  }
}

.product-details h2 {
  margin: 0px;
}

.yellow-spacer {
  border: none;
  background-color: var(--wp--preset--color--yellow);
  height: 2px;
  width: 100%;
  margin-top: 0px;
}

/* ============================================================
     VARIATIONS WOOCOMMERCE
     ============================================================ */

#single-product table.variations {
  width: 100%;
  border-collapse: separate;
  margin-bottom: 0;
}

#single-product table.variations tbody {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

#single-product table.variations tr {
  display: flex;
  flex-direction: column;
  flex: 1 1 calc(50% - 10px);
}

#single-product table.variations tr.full-width {
  flex: 1 1 100%;
}

#single-product table.variations th.label {
  padding: 0 0 4px;
  text-align: left;
}

#single-product table.variations td.value select {
  width: 100%;
  padding: 14px 8px;
  font-size: var(--wp--preset--font-size--14);
  font-family: "Open Sans";
  color: var(--wp--preset--color--dark-blue);
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 2px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSJibGFjayIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJmZWF0aGVyIGZlYXRoZXItY2hldnJvbi1kb3duIj48cG9seWxpbmUgcG9pbnRzPSI2IDkgMTIgMTUgMTggOSI+PC9wb2x5bGluZT48L3N2Zz4=)
    no-repeat;
  background-size: 16px;
  -webkit-background-size: 16px;
  background-position: calc(100% - 12px) 50%;
  -webkit-background-position: calc(100% - 12px) 50%;
}

.reset_variations {
  display: block;
  margin-top: var(--wp--preset--spacing--8);
  margin-bottom: var(--wp--preset--spacing--8);
}

/* ============================================================
     ADD TO CART & QUANTITÉ
     ============================================================ */

/* Supprimer les flèches sur input number – Chrome / Safari / Edge */
.custom-quantity input[type="number"]::-webkit-inner-spin-button,
.custom-quantity input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Supprimer les flèches sur Firefox */
.custom-quantity input[type="number"] {
  -moz-appearance: textfield;
}

#single-product .single_add_to_cart_button {
  padding: 14px 25px;
  font-size: var(--wp--preset--font-size--14);
  font-weight: 700;
  background: var(--wp--preset--color--dark-blue);
  color: var(--wp--preset--color--white);
  border: none;
  border-radius: 2px;
  cursor: pointer;
  transition: 0.3s;
}

#single-product .single_add_to_cart_button:hover {
  background: var(--wp--preset--color--yellow);
  color: var(--wp--preset--color--dark-blue);
}

#single-product .single_add_to_cart_button:disabled {
  opacity: 0.4;
  pointer-events: none;
}

#single-product .custom-quantity-add-to-cart {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 15px;
}

#single-product .custom-quantity {
  display: flex;
  align-items: center;
}

#single-product .custom-quantity .qty-btn {
  width: 48px;
  height: 48px;
  background: var(--wp--preset--color--dark-blue);
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: 0.2s ease-in;
}

#single-product .custom-quantity .qty-btn:hover {
  background-color: var(--wp--preset--color--yellow);
  color: var(--wp--preset-color--dark-blue);
}

#single-product .custom-quantity .qty-input {
  width: 50px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  border: none;
}

#single-product .woocommerce-message {
  border-color: var(--wp--preset--color--dark-blue);
  background-color: #f4fff7;
}

#single-product .woocommerce-message .wp-element-button {
  margin-top: var(--wp--preset--spacing--8);
}

/* Label "Quantité :" au-dessus du sélecteur */
#single-product .custom-quantity-label {
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 0;
}

/* Boutons d'action en ligne (Ajouter au panier + Nous contacter) */
#single-product .custom-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Empêcher les wrappers WP de casser le flex inline */
#single-product .custom-actions .wp-block-buttons {
  flex: 0 0 auto;
  width: auto;
}

/* ============================================================
     META PRODUIT – GRID 2×2
     ============================================================ */

#single-product .product-meta-custom {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--wp--preset--spacing--8) var(--wp--preset--spacing--16);
}

/* Ligne 1, col 1 : Référence */
#single-product .product-meta-custom .product-ref {
  grid-column: 1 / 2;
  grid-row: 1 / 2;
}

/* Ligne 1, col 2 : Indicateur de stock (pastille rouge) */
#single-product .product-meta-custom .product-stock-status {
  grid-column: 2 / 3;
  grid-row: 1 / 2;
  text-align: right;
}

/* Ligne 2, col 1 : Prix */
#single-product .product-meta-custom .product-price {
  grid-column: 1 / 2;
  grid-row: 2 / 3;
}

/* Ligne 2, col 2 : Disponibilité / Délai */
#single-product .product-meta-custom .product-availability {
  grid-column: 2 / 3;
  grid-row: 2 / 3;
  text-align: right;
}

/* Textes gras dans la grid */
#single-product #dynamic-sku,
#single-product #dynamic-price {
  font-weight: 700;
  font-size: 16px;
}

/* ----- Indicateur stock faible (pastille rouge + texte) ----- */
.stock-indicator-low {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #d32f2f;
  font-weight: 700;
}

.stock-indicator-low::before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: #d32f2f;
  flex-shrink: 0;
}

/* ----- Textes de disponibilité ----- */
.availability-instock {
  color: #2e7d32;
  font-weight: 700;
}

.availability-reappro {
  color: #e65100;
  font-weight: 700;
}

.availability-toconfirm {
  font-weight: 700;
}

/* ----- Bandeau gris inscription Le Cosinus ----- */
.cosinus-member-info {
  background-color: #f0f0f0;
  border-radius: 4px;
  padding: 16px 20px;
  margin: 20px 0;
}

.cosinus-member-info p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.5;
}

/* ============================================================
     TITRES & SÉPARATEURS
     ============================================================ */

#single-product .transfo-specs {
  font-size: 16px;
  font-weight: 700;
  color: var(--wp--preset--color--dark-blue);
  border-bottom: 3px solid var(--wp--preset--color--yellow);
  margin-bottom: var(--wp--preset--spacing--16);
  line-height: 1.1;
}

/* ============================================================
     CTA PRODUIT SPECIAL
     ============================================================ */

.cta-produit-special {
  margin-bottom: var(--wp--preset--spacing--32);
}

.cta-header {
  text-align: center;
}

.cta-description {
  line-height: 1.6;
}

.cta-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--wp--preset--spacing--24);
}

.cta-produit-special .btn-solid-primary,
.cta-produit-special .btn-solid-accent {
  display: inline-block;
  width: 100%;
  box-sizing: border-box;
  font-weight: 600;
}