/* Page produit Magot */
.single-product {
  --magot-ink: #2b2b2b;
  --magot-muted: #6b6b6b;
  --magot-line: #dcd8d2;
  --magot-soft: #f5f3f0;
  --magot-accent: #c0592b;
}

/* ---------- Prix au m² ---------- */
.magot-unit-price { display: flex; flex-direction: column; gap: 2px; margin: -4px 0 18px; }
.magot-price-m2 { font-size: 1.6em; font-weight: 700; color: var(--magot-ink); line-height: 1.2; }
.magot-price-m2 small { font-size: .55em; font-weight: 500; color: var(--magot-muted); }
.magot-price-box { font-size: .92em; color: var(--magot-muted); }

/* ---------- Pastilles ---------- */
.single-product table.variations { border: 0; margin-bottom: 8px; }
.single-product table.variations tr { display: block; margin-bottom: 18px; }
.single-product table.variations th.label,
.single-product table.variations td.value { display: block; padding: 0; background: none; border: 0; text-align: left; }
.single-product table.variations th.label label { font-weight: 600; color: var(--magot-ink); }
.magot-chosen { font-weight: 400; color: var(--magot-muted); }
.single-product table.variations select.magot-hidden-select {
  position: absolute !important; width: 1px !important; height: 1px !important;
  opacity: 0 !important; pointer-events: none !important; overflow: hidden;
}
.magot-sw { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.single-product .magot-sw .magot-sw-item {
  appearance: none; cursor: pointer; background: #fff; color: var(--magot-ink);
  border: 1px solid var(--magot-line); border-radius: 6px; padding: 0; font: inherit; font-size: 14px;
  box-shadow: none; text-transform: none; letter-spacing: 0;
  transition: border-color .15s, opacity .15s;
}
.single-product .magot-sw .magot-sw-item:hover,
.single-product .magot-sw .magot-sw-item:focus { border-color: #a39d94; background: #fff; color: var(--magot-ink); }
.single-product .magot-sw .magot-sw-item:focus-visible { outline: 2px solid var(--magot-accent); outline-offset: 2px; }
/* Choix sélectionné : contour et fond aux couleurs Magot, bien visibles */
.single-product .magot-sw .magot-sw-item.is-selected { border: 2px solid var(--magot-accent); background: #fbeee8; color: #a84a22; font-weight: 600; }
.single-product .magot-sw .magot-sw-item.is-disabled { opacity: .35; cursor: not-allowed; text-decoration: line-through; }

/* Couleur : ronds */
.single-product .magot-sw--color .magot-sw-item { border-radius: 50%; padding: 3px; border: 2px solid transparent; background: transparent; }
.single-product .magot-sw--color .magot-sw-item:hover,
.single-product .magot-sw--color .magot-sw-item:focus { border-color: var(--magot-line); background: transparent; }
.single-product .magot-sw--color .magot-sw-item.is-selected { border-color: var(--magot-accent); background: transparent; box-shadow: 0 0 0 1px var(--magot-accent); }
.magot-dot {
  display: block; width: 40px; height: 40px; border-radius: 50%;
  background: var(--magot-soft) center / cover no-repeat; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12);
}
.magot-dot--empty { display: flex; align-items: center; justify-content: center; font-size: 14px; color: var(--magot-muted); }

/* Format : carrés proportionnels */
.single-product .magot-sw--format .magot-sw-item {
  min-width: 76px; width: auto; min-height: 76px; height: auto; padding: 8px 10px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
}
.magot-fmt-label {
  font-size: 12px; line-height: 1.15; text-align: center; max-width: 100%;
  padding: 0 2px; overflow-wrap: anywhere;
}
/* Le libellé d'épaisseur (« 60x120 (20 mm) ») reste sur une ligne, la case s'élargit */
.magot-fmt-label { white-space: nowrap; }
.magot-fmt-shape { display: block; border: 1px solid var(--magot-muted); background: var(--magot-soft); }

/* Finition et autres : boutons */
.single-product .magot-sw--pill .magot-sw-item { padding: 7px 16px; background: var(--magot-soft); }
.single-product .magot-sw--pill .magot-sw-item.is-selected { background: #fbeee8; }
.single-product .magot-sw--format .magot-sw-item.is-selected .magot-fmt-shape { border-color: var(--magot-accent); background: #fff; }

.single-product .reset_variations { font-size: 13px; color: var(--magot-muted); }

/* ---------- Bouton panier ---------- */
body.single-product form.cart button.single_add_to_cart_button.button,
body.single-product form.cart button.single_add_to_cart_button.button.alt {
  background: var(--magot-accent); color: #fff; border: 0; border-radius: 999px; padding: 12px 28px; font-weight: 600;
}
body.single-product form.cart button.single_add_to_cart_button.button.alt:hover { background: #a84a22; color: #fff; }
body.single-product form.cart button.single_add_to_cart_button.button.alt.disabled { background: var(--magot-accent); opacity: .5; }

/* Le prix au m² remplace les autres affichages de prix */
.magot-has-m2 .woocommerce-variation-price,
.magot-has-m2 #wtpp_unit_prices { display: none !important; }

/* ---------- Caractéristiques et documents ---------- */
.magot-sections { clear: both; padding-top: 32px; display: flex; flex-direction: column; gap: 14px; }
.magot-acc { border: 1px solid var(--magot-line); border-radius: 8px; background: #fff; }
.magot-acc > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px;
  padding: 18px 22px; font-size: 1.1em; font-weight: 600; color: var(--magot-ink);
}
.magot-acc > summary::-webkit-details-marker { display: none; }
.magot-acc > summary::after { content: '+'; margin-left: auto; font-size: 1.4em; font-weight: 400; line-height: 1; }
.magot-acc[open] > summary::after { content: '\2212'; }
.magot-acc > summary:focus-visible { outline: 2px solid var(--magot-accent); outline-offset: -2px; border-radius: 8px; }
.magot-ico { flex: none; color: var(--magot-muted); }
.magot-acc-body { padding: 0 22px 22px; }
.magot-desc { color: var(--magot-muted); margin-bottom: 16px; }
.magot-desc p:last-child { margin-bottom: 0; }

.magot-specs { width: 100%; border-collapse: collapse; margin: 0; border: 0; }
.magot-specs tr:nth-child(odd) { background: var(--magot-soft); }
.magot-specs th, .magot-specs td { padding: 12px 16px; border: 0; vertical-align: top; text-align: left; }
.magot-specs th { font-weight: 400; color: var(--magot-ink); width: 50%; }
.magot-specs td { font-weight: 600; color: var(--magot-ink); }

.magot-docs-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 32px; }
.magot-docs-list a { display: inline-flex; align-items: center; gap: 8px; color: var(--magot-ink); text-decoration: underline; text-underline-offset: 3px; }
.magot-docs-list a:hover { color: var(--magot-accent); }

@media (max-width: 640px) {
  .magot-acc > summary { padding: 16px; }
  .magot-acc-body { padding: 0 16px 16px; }
  .magot-specs th, .magot-specs td { padding: 10px; }
  .magot-docs-list { grid-template-columns: 1fr; }
}

/* ---------- Prix sur demande ---------- */
.magot-price-request { font-size: 1.25em; font-weight: 600; color: var(--magot-ink); }
.single-product .woocommerce-variation-availability p,
.single-product .wc-no-matching-variations { color: var(--magot-muted); font-size: 14px; }

/* ---------- Calculateur de boîtes ---------- */
.magot-calc { margin: 6px 0 18px; padding: 18px 20px; background: var(--magot-soft); border-radius: 10px; }
.magot-calc[hidden] { display: none; }
.magot-calc-title { margin: 0 0 12px; font-weight: 600; color: var(--magot-ink); }
.magot-calc-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.magot-calc-row label { color: var(--magot-ink); }
.magot-calc-input { display: inline-flex; align-items: center; border: 1px solid var(--magot-line); border-radius: 6px; background: #fff; overflow: hidden; }
.magot-calc-input input { width: 110px; border: 0 !important; padding: 9px 10px; font-size: 15px; background: transparent; }
.magot-calc-input input:focus { outline: none; }
.magot-calc-input span { padding: 0 12px; color: var(--magot-muted); border-left: 1px solid var(--magot-line); line-height: 38px; }
.magot-calc-check { display: flex; gap: 8px; align-items: flex-start; margin: 12px 0 0; font-size: 14px; color: var(--magot-muted); cursor: pointer; }
.magot-calc-check input { margin-top: 3px; accent-color: var(--magot-accent); }
.magot-calc-result:not(:empty) { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--magot-line); display: grid; gap: 6px; }
.magot-calc-result div { display: flex; justify-content: space-between; gap: 12px; color: var(--magot-ink); }
.magot-calc-result strong { font-variant-numeric: tabular-nums; }
.magot-calc-hint { font-size: 14px; color: var(--magot-muted); margin: 0 0 14px; }

/* ---------- Nombre de boîtes (quantité reliée au calculateur) ---------- */
.single-product form.cart .woocommerce-variation-add-to-cart { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; }
.single-product form.cart .quantity.magot-qty {
  display: grid; grid-template-columns: auto auto auto; grid-template-areas: "label label label" "minus input plus" "m2 m2 m2";
  align-items: center; margin: 0; float: none;
}
.magot-qty-label { grid-area: label; font-size: 14px; font-weight: 600; color: var(--magot-ink); margin-bottom: 6px; }
.single-product .magot-qty .magot-qty-btn {
  width: 40px; height: 44px; padding: 0; border: 1px solid var(--magot-line); background: #fff; color: var(--magot-ink);
  font-size: 20px; line-height: 1; cursor: pointer; border-radius: 0;
}
.single-product .magot-qty .magot-qty-btn[data-step="-1"] { grid-area: minus; border-radius: 6px 0 0 6px; }
.single-product .magot-qty .magot-qty-btn[data-step="1"] { grid-area: plus; border-radius: 0 6px 6px 0; }
.single-product .magot-qty .magot-qty-btn:hover { background: var(--magot-soft); color: var(--magot-ink); }
.single-product .magot-qty input.qty {
  grid-area: input; width: 64px; height: 44px; text-align: center; border: 1px solid var(--magot-line); border-left: 0; border-right: 0;
  border-radius: 0; font-size: 16px; font-weight: 600; -moz-appearance: textfield;
}
.single-product .magot-qty input.qty::-webkit-outer-spin-button,
.single-product .magot-qty input.qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.magot-qty-m2 { grid-area: m2; font-size: 13px; color: var(--magot-muted); margin-top: 6px; min-height: 1em; }
.single-product form.cart .woocommerce-variation-add-to-cart .single_add_to_cart_button { height: 44px; margin-bottom: 19px; }

/* ---------- Estimation de livraison ---------- */
.magot-calc-cp { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--magot-line); }
.magot-calc-cp .magot-calc-input input { width: 120px; }
.magot-calc-livraison:not(:empty) { margin-top: 10px; display: grid; gap: 6px; }
.magot-calc-livraison div { display: flex; justify-content: space-between; gap: 12px; color: var(--magot-ink); font-size: 14px; }
.magot-calc-livraison strong { white-space: nowrap; font-variant-numeric: tabular-nums; }
.magot-calc-sub { margin: 0; font-size: 13px; font-weight: 600; color: var(--magot-muted); }
.magot-calc-note { margin: 2px 0 0; font-size: 12px; color: var(--magot-muted); }

/* ---------- Budget livré ---------- */
.magot-calc-recap:not(:empty) { margin-top: 14px; padding: 14px 16px; background: #fff; border: 1px solid var(--magot-line); border-radius: 10px; display: grid; gap: 6px; }
.magot-calc-recap div { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--magot-ink); }
.magot-calc-recap strong { white-space: nowrap; font-variant-numeric: tabular-nums; }
.magot-recap-titre { margin: 0 0 2px; font-weight: 700; color: var(--magot-ink); }
.magot-recap-total { margin-top: 4px; padding-top: 8px; border-top: 1px solid var(--magot-line); font-size: 16px !important; font-weight: 700; }
.magot-recap-delai { margin: 4px 0 0; font-size: 12.5px; color: var(--magot-muted); }

/* ---------- Échantillon (sous le prix) ---------- */
.magot-echantillon { display: flex; align-items: center; gap: 12px; margin: -6px 0 18px; padding: 10px 14px; border: 1px dashed #c0592b; border-radius: 10px; background: #fbf4ef; color: var(--magot-ink, #1f1f1f) !important; text-decoration: none !important; font-size: 14px; line-height: 1.35; transition: background .2s; }
.magot-echantillon:hover { background: #f7e7dc; }
.magot-echantillon .magot-ico { flex: none; color: #c0592b; }
.magot-echantillon-txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.magot-echantillon-txt span { color: var(--magot-muted, #6b6b6b); font-size: 13px; }
.magot-echantillon-fl { margin-left: auto; padding-left: 8px; color: #a84a22; font-weight: 700; white-space: nowrap; }
.magot-echantillon-fl::after { content: " →"; }

/* ---------- Aide à l'achat (sous le bouton) ---------- */
.magot-aide { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 12px; }
.magot-aide li { display: flex; gap: 12px; align-items: flex-start; margin: 0; }
.magot-aide .magot-ico { flex: none; color: var(--magot-accent, #c0592b); margin-top: 2px; }
.magot-aide p { margin: 0; display: flex; flex-direction: column; gap: 2px; font-size: 14px; line-height: 1.45; }
.magot-aide strong { color: var(--magot-ink); }
.magot-aide span { color: var(--magot-muted); }
.magot-aide a { color: var(--magot-accent-dark, #a84a22); text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; }

/* ---------- Badge d'usage ---------- */
.magot-usage { display: inline-block; margin: 4px 0 14px; padding: 5px 12px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: var(--magot-soft); color: var(--magot-ink); border: 1px solid var(--magot-line); }
.magot-usage.is-mur { background: #fbeee6; border-color: #e9c2ac; color: var(--magot-accent-dark, #a84a22); }

/* Méta produit : la référence interne n'aide pas le client ; liens de catégorie aux couleurs de la marque */
.single-product .product_meta .sku_wrapper { display: none; }
.single-product .product_meta { font-size: .9em; color: var(--magot-muted); }
.single-product .product_meta a { color: var(--magot-ink); text-decoration: underline; text-underline-offset: 2px; }
.single-product .product_meta a:hover { color: var(--magot-accent); }

/* Pastille « Classé UPEC » et bloc pro */
.magot-upec { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -6px 0 14px; font-size: 13px; }
.magot-upec a { display: inline-block; padding: 5px 12px; border-radius: 999px; background: #1f1f1f; color: #fff !important; font-weight: 600; text-decoration: none; }
.magot-upec a:hover { background: #c55614; }
.magot-upec-val { font-weight: 600; color: var(--magot-ink, #1f1f1f); font-variant-numeric: tabular-nums; }
.magot-acc--pro td[data-k="upec"] { font-variant-numeric: tabular-nums; }
.magot-pro-links { margin: 14px 0 0; font-size: 14px; line-height: 1.6; }
.magot-pro-links a { color: var(--magot-accent-dark, #a84a22); text-decoration: underline; text-underline-offset: 3px; }

/* Bouton d'ajout grisé tant que le choix n'est pas complet */
.single-product form.cart .single_add_to_cart_button.disabled { opacity: .45 !important; cursor: not-allowed; }
.magot-choix-manquant { flex-basis: 100%; width: 100%; margin: 10px 0 0; color: #a84a22; font-size: 14px; font-weight: 600; }
.magot-sw.is-manquant { outline: 2px solid #c0592b; outline-offset: 6px; border-radius: 10px; }

/* Galerie : toutes les photos au même format que les ambiances (4:3), recadrées sans déformation */
.single-product .woocommerce-product-gallery .woocommerce-product-gallery__image img { width: 100% !important; height: auto !important; aspect-ratio: 4 / 3; object-fit: cover; }
.single-product .woocommerce-product-gallery .flex-control-thumbs li img { aspect-ratio: 1 / 1; object-fit: cover; }
/* Mobile : vignettes sur une seule ligne défilante, pour que le nom et le prix remontent dans le premier écran */
@media (max-width: 767px) {
  .single-product .woocommerce-product-gallery .flex-control-thumbs { display: flex !important; flex-wrap: nowrap; gap: 6px; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; margin-top: 6px !important; }
  .single-product .woocommerce-product-gallery .flex-control-thumbs::-webkit-scrollbar { display: none; }
  .single-product .woocommerce-product-gallery .flex-control-thumbs li { flex: 0 0 58px; width: 58px !important; margin: 0 !important; scroll-snap-align: start; }
}
