/**
 * Afro-Exotique — fiche produit UX 2026
 * Scope strict : body.single-product uniquement (0 impact hors fiche).
 * Couleur marque site : #00b14d
 */

body.single-product {
  --ae-brand: #00b14d;
  --ae-brand-dark: #009640;
  --ae-ink: #1a1a1a;
  --ae-muted: #5c5c5c;
  --ae-line: #e8e8e8;
  --ae-bg: #f7f6f3;
  --ae-card: #ffffff;
  --ae-radius: 16px;
  --ae-shadow: 0 8px 28px rgba(0, 0, 0, 0.06);
}

/* Fond page plus doux — contenu seulement */
body.single-product #content.site-content {
  background: var(--ae-bg);
  padding-bottom: 2rem;
}

body.single-product .woocommerce-breadcrumb {
  font-size: 13px;
  color: var(--ae-muted);
  margin: 1rem 0 1.25rem;
}

body.single-product .woocommerce-breadcrumb a {
  color: var(--ae-muted);
  text-decoration: none;
}

body.single-product .woocommerce-breadcrumb a:hover {
  color: var(--ae-brand);
}

/* Carte produit principale */
body.single-product .single-product-wrapper {
  background: var(--ae-card);
  border-radius: calc(var(--ae-radius) + 4px);
  box-shadow: var(--ae-shadow);
  padding: 1.25rem;
  margin-bottom: 1.5rem !important;
  align-items: start;
}

@media (min-width: 992px) {
  body.single-product .single-product-wrapper {
    padding: 2rem;
    gap: 0;
  }
}

/* Galerie */
body.single-product .product-images-wrapper {
  background: linear-gradient(145deg, #efece6, #f6f4ef);
  border-radius: var(--ae-radius);
  padding: 0.75rem;
  margin-bottom: 1rem;
}

body.single-product .woocommerce-product-gallery {
  border-radius: 12px;
  overflow: hidden;
}

/*
 * Cadre galerie stable : les images très verticales ne peuvent plus
 * allonger indéfiniment la fiche produit.
 */
body.single-product .product-images-wrapper .woocommerce-product-gallery__wrapper {
  max-height: 560px;
  overflow: hidden;
}

body.single-product .product-images-wrapper .woocommerce-product-gallery__image {
  width: 100%;
  height: 560px;
  max-height: 560px;
  overflow: hidden;
  display: flex !important;
  align-items: center;
  justify-content: center;
}

body.single-product .product-images-wrapper .woocommerce-product-gallery__image > a {
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

body.single-product .woocommerce-product-gallery__image img,
body.single-product .woocommerce-product-gallery__image a {
  border-radius: 10px;
}

body.single-product .product-images-wrapper .woocommerce-product-gallery__image img {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  margin: auto !important;
  object-fit: contain !important;
  object-position: center !important;
}

body.single-product .flex-control-nav li a,
body.single-product .flex-control-thumbs li img {
  border-radius: 10px !important;
  border: 2px solid transparent !important;
  overflow: hidden;
}

body.single-product .flex-control-nav li a.flex-active,
body.single-product .flex-control-thumbs li img.flex-active {
  border-color: var(--ae-brand) !important;
}

/* Résumé */
body.single-product .summary.entry-summary {
  padding-top: 0.25rem;
}

body.single-product .loop-product-categories {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  height: auto !important;
  margin-bottom: 12px;
}

body.single-product .loop-product-categories a {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ae-brand) !important;
  background: rgba(0, 177, 77, 0.1);
  padding: 6px 10px;
  border-radius: 999px;
  text-decoration: none !important;
  text-transform: none;
}

body.single-product .product_title.entry-title {
  font-size: clamp(1.35rem, 2.5vw, 1.85rem) !important;
  line-height: 1.25 !important;
  font-weight: 700 !important;
  color: var(--ae-ink);
  margin: 0 0 10px !important;
}

body.single-product .single-product-title-divider {
  display: none;
}

body.single-product .summary .price {
  font-size: 1.75rem !important;
  font-weight: 700 !important;
  color: var(--ae-brand-dark) !important;
  margin: 0.35rem 0 0.25rem !important;
}

body.single-product .summary .price .woocommerce-Price-amount {
  color: inherit;
}

body.single-product .summary .price .woocommerce-price-suffix {
  display: block;
  font-size: 13px;
  font-weight: 400;
  color: var(--ae-muted);
  margin-top: 2px;
}

body.single-product .woocommerce-product-details__short-description {
  color: var(--ae-muted);
  font-size: 15px;
  margin: 0 0 1.25rem;
  line-height: 1.55;
}

/* Zone achat */
body.single-product form.cart {
  display: flex !important;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 1.1rem !important;
}

body.single-product form.cart .quantity {
  display: flex;
  align-items: center;
  border: 1px solid var(--ae-line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  margin: 0 !important;
  width: auto !important;
  float: none !important;
}

body.single-product form.cart .quantity .qty {
  border: 0 !important;
  height: 48px !important;
  width: 56px !important;
  text-align: center;
  font-size: 16px;
  box-shadow: none !important;
  background: #fff !important;
  margin: 0 !important;
}

body.single-product form.cart .single_add_to_cart_button,
body.single-product form.cart button.button.alt {
  flex: 1 1 180px;
  min-width: 180px;
  height: 48px !important;
  border: 0 !important;
  border-radius: 12px !important;
  background: var(--ae-brand) !important;
  color: #fff !important;
  font-weight: 700 !important;
  font-size: 15px !important;
  line-height: 48px !important;
  padding: 0 1.25rem !important;
  box-shadow: none !important;
  float: none !important;
}

body.single-product form.cart .single_add_to_cart_button:hover,
body.single-product form.cart .single_add_to_cart_button:focus {
  background: var(--ae-brand-dark) !important;
  color: #fff !important;
}

/* Variations (pas de casse) */
body.single-product form.cart table.variations {
  width: 100%;
  margin-bottom: 0.75rem;
}

body.single-product form.cart .single_variation_wrap {
  width: 100%;
}

body.single-product form.variations_form .woocommerce-variation-add-to-cart {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

/* Méta */
body.single-product .product_meta {
  font-size: 13px;
  color: var(--ae-muted);
  padding-top: 12px;
  border-top: 1px solid var(--ae-line);
  margin-top: 0.5rem;
}

body.single-product .product_meta a {
  color: var(--ae-muted);
}

body.single-product .product_meta a:hover {
  color: var(--ae-brand);
}

/* Onglets */
body.single-product .woocommerce-tabs.wc-tabs-wrapper,
body.single-product .electro-tabs {
  background: var(--ae-card);
  border-radius: var(--ae-radius);
  box-shadow: var(--ae-shadow);
  padding: 8px 8px 20px;
  margin-top: 1.5rem;
  border: 0 !important;
}

body.single-product .woocommerce-tabs ul.tabs.wc-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  border-bottom: 1px solid var(--ae-line) !important;
  padding: 8px !important;
  margin: 0 0 0.5rem !important;
  list-style: none;
}

body.single-product .woocommerce-tabs ul.tabs.wc-tabs::before,
body.single-product .woocommerce-tabs ul.tabs.wc-tabs::after {
  display: none !important;
}

body.single-product .woocommerce-tabs ul.tabs.wc-tabs li {
  border: 0 !important;
  background: transparent !important;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 10px;
}

body.single-product .woocommerce-tabs ul.tabs.wc-tabs li a {
  display: block;
  padding: 10px 14px !important;
  border-radius: 10px;
  font-weight: 600;
  color: var(--ae-muted) !important;
  white-space: nowrap;
  border: 0 !important;
  background: transparent !important;
}

body.single-product .woocommerce-tabs ul.tabs.wc-tabs li.active a,
body.single-product .woocommerce-tabs ul.tabs.wc-tabs li a:hover {
  background: rgba(0, 177, 77, 0.1) !important;
  color: var(--ae-brand-dark) !important;
}

body.single-product .woocommerce-Tabs-panel {
  padding: 16px 12px 4px !important;
  font-size: 15px;
  color: #333;
}

/* Sticky CTA mobile — repose sur la feature Electro déjà active */
@media (max-width: 767.98px) {
  body.single-product.sticky-single-add-to-cart-mobile {
    padding-bottom: 88px;
  }

  body.single-product .product-images-wrapper .woocommerce-product-gallery__wrapper {
    max-height: min(105vw, 430px);
  }

  body.single-product .product-images-wrapper .woocommerce-product-gallery__image {
    height: min(105vw, 430px);
    max-height: min(105vw, 430px);
  }

  /*
   * Trois onglets visibles en permanence sur mobile.
   * WooCommerce garde son comportement natif ; seule la disposition change.
   */
  body.single-product .woocommerce-tabs ul.tabs.wc-tabs {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 3px;
    overflow: visible;
    padding: 5px !important;
  }

  body.single-product .woocommerce-tabs ul.tabs.wc-tabs li {
    min-width: 0;
    width: auto !important;
  }

  body.single-product .woocommerce-tabs ul.tabs.wc-tabs li a {
    width: 100%;
    padding: 9px 2px !important;
    overflow: hidden;
    display: block;
    font-size: clamp(10px, 3.15vw, 12px);
    line-height: 1.2;
    letter-spacing: -0.02em;
    text-align: center;
    text-overflow: clip;
    white-space: nowrap;
  }

  body.single-product.sticky-single-add-to-cart-mobile .single_add_to_cart_button {
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    border-radius: 0 !important;
    height: 56px !important;
    line-height: 56px !important;
    background: var(--ae-brand) !important;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.08) !important;
    z-index: 1080;
    padding-bottom: env(safe-area-inset-bottom, 0);
  }

  body.single-product.sticky-single-add-to-cart-mobile .single_add_to_cart_button:hover,
  body.single-product.sticky-single-add-to-cart-mobile .single_add_to_cart_button:focus {
    background: var(--ae-brand-dark) !important;
    color: #fff !important;
  }

  /* Évite conflit avec barre footer handheld si visible */
  body.single-product .electro-handheld-footer-bar {
    bottom: 56px;
  }
}

/* Produits liés : léger air, sans refonte globale */
body.single-product .related.products,
body.single-product .up-sells.products {
  margin-top: 2rem;
}
