/* ==========================================================================
   Refonte page détail box (Piste C) — Lot 3
   Restyle la structure WooCommerce existante (gallery + summary + variations +
   S'abonner/Offrir) SANS toucher aux mécaniques du tunnel. Scopé .rh-box-detail.
   ========================================================================== */

.rh-box-detail{
  --wine:#8b3f3f; --wine-dark:#6b2f2f; --wine-soft:#a8626a;
  --cream:#f6f0e7; --sand:#ece2d2; --paper:#fbf8f3;
  --ink:#2a2320; --text:#4b433e; --muted:#8a807a; --line:#e6ddd0;
  --rh-shadow:0 24px 60px -24px rgba(99,39,47,.28);
  font-family:'Larsseit',sans-serif;color:var(--text);
}
.rh-box-detail h1,.rh-box-detail h2,.rh-box-detail h3{font-family:'Ivar Display Condensed',serif;font-weight:700;color:var(--wine);line-height:1.03;letter-spacing:-.01em}
.rh-box-detail .rh-eyebrow{font-size:12.5px;letter-spacing:.2em;text-transform:uppercase;color:var(--wine-soft);font-weight:700;margin-bottom:14px}
.rh-box-detail .rh-btn{display:inline-flex;align-items:center;justify-content:center;gap:9px;font-weight:500;text-transform:uppercase;letter-spacing:.09em;font-size:13px;line-height:1;padding:16px 32px;border:1.5px solid var(--wine);transition:.22s;text-decoration:none;cursor:pointer}
.rh-box-detail .rh-btn-primary{background:var(--wine);color:#fff}
.rh-box-detail .rh-btn-primary:hover{background:var(--wine-dark);border-color:var(--wine-dark)}
.rh-box-detail .rh-btn-ghost{background:transparent;color:var(--wine)}
.rh-box-detail .rh-btn-ghost:hover{background:var(--wine);color:#fff}

/* ---- HERO produit : gallery | (tagline + summary) ---- */
.rh-box-detail .product_intro{padding:34px 24px 72px;background:var(--paper)}
.rh-box-detail .product_intro > .container{max-width:1240px;margin:0 auto;display:grid;grid-template-columns:1.05fr .95fr;column-gap:60px;align-items:start}
.rh-box-detail .product_intro > .container > h1.is-style-title_2{grid-column:2;grid-row:1;font-family:'Ivar Display Condensed',serif;font-style:italic;color:var(--wine-soft);font-size:22px;font-weight:700;margin:0 0 6px;line-height:1.2}
.rh-box-detail .woocommerce-product-gallery{grid-column:1;grid-row:1 / span 2;position:sticky;top:100px;margin:0}
.rh-box-detail .woocommerce-product-gallery__wrapper{margin:0}
.rh-box-detail .woocommerce-product-gallery__image{border:1px solid var(--line);overflow:hidden}
.rh-box-detail .woocommerce-product-gallery__image img{width:100%;height:auto;display:block}
.rh-box-detail .summary.entry-summary{grid-column:2;grid-row:2;margin:0;float:none;width:auto}

.rh-box-detail .summary .product_title{font-size:clamp(44px,5vw,68px);color:var(--wine-dark);margin:0 0 14px;line-height:1}
.rh-box-detail .summary .price{font-family:'Ivar Display Condensed',serif;color:var(--wine);font-size:34px;margin:6px 0 8px;line-height:1}
.rh-box-detail .summary .price .amount,.rh-box-detail .summary .price bdi{font-family:inherit}
.rh-box-detail .summary .price del{opacity:.5;font-size:.7em;margin-right:8px}
.rh-box-detail .woocommerce-product-details__short-description{font-size:15px;color:var(--text);margin-bottom:22px;line-height:1.6}
.rh-box-detail .contenu_box ul{list-style:none;margin:0;padding:0}
.rh-box-detail .contenu_box li{position:relative;padding:5px 0 5px 26px;font-size:14.5px}
.rh-box-detail .contenu_box li::before{content:'';position:absolute;left:0;top:12px;width:11px;height:6px;border-left:2px solid var(--wine);border-bottom:2px solid var(--wine);transform:rotate(-45deg)}

/* ---- Formulaire variations (config) ---- */
.rh-box-detail .variations_form{border:1px solid var(--line);background:#fff;padding:22px 24px;margin:22px 0}
.rh-box-detail table.variations{width:100%;border-collapse:collapse;margin:0 0 8px}
.rh-box-detail table.variations tr{display:block;margin-bottom:16px}
.rh-box-detail table.variations td{display:block;padding:0}
.rh-box-detail table.variations td.label{font-size:12px;letter-spacing:.1em;text-transform:uppercase;color:var(--muted);font-weight:700;margin-bottom:8px}
.rh-box-detail table.variations td.label label{margin:0}
.rh-box-detail table.variations select{width:100%;padding:12px 14px;border:1.5px solid var(--line);background:#fff;font-family:'Larsseit',sans-serif;font-size:15px;color:var(--ink);cursor:pointer}
.rh-box-detail table.variations select:focus{border-color:var(--wine);outline:none}
.rh-box-detail .woocommerce-variation-price{margin:6px 0 2px}
.rh-box-detail .woocommerce-variation-price .price{font-size:30px}
.rh-box-detail .reset_variations{font-size:12px;color:var(--muted);text-transform:uppercase;letter-spacing:.06em}

/* ---- CTA S'abonner / Offrir ---- */
.rh-box-detail .product_buttons{display:flex;gap:12px;flex-wrap:wrap;margin:8px 0 0}
.rh-box-detail .product_buttons .button_sabonner,
.rh-box-detail .product_buttons .button_offrir{flex:1;min-width:150px;display:inline-flex;align-items:center;justify-content:center;
  font-family:'Larsseit',sans-serif;font-weight:500;text-transform:uppercase;letter-spacing:.09em;font-size:13px;line-height:1;padding:17px 28px;border:1.5px solid var(--wine);transition:.22s;text-decoration:none;cursor:pointer}
.rh-box-detail .product_buttons .button_sabonner{background:var(--wine);color:#fff}
.rh-box-detail .product_buttons .button_sabonner:hover{background:var(--wine-dark);border-color:var(--wine-dark)}
.rh-box-detail .product_buttons .button_offrir{background:transparent;color:var(--wine)}
.rh-box-detail .product_buttons .button_offrir:hover{background:var(--wine);color:#fff}
.rh-box-detail .attributes_box_a_offrir{display:none}
/* miniature réservée à la barre sticky (banner_pop) : masquée dans le flux */
.rh-box-detail .product__thumbnail-wrapper{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}

/* réassurance sous les CTA */
.rh-box-detail .rh-reassure{display:flex;gap:22px;flex-wrap:wrap;font-size:13px;color:var(--muted);margin-top:18px}
.rh-box-detail .rh-reassure span{display:flex;align-items:center;gap:7px}
.rh-box-detail .rh-reassure svg{width:16px;height:16px;color:var(--wine)}

/* ---- Sections génériques ---- */
.rh-box-detail .rh-sec{padding:80px 24px}
.rh-box-detail .rh-sec-head{text-align:center;max-width:640px;margin:0 auto 48px}
.rh-box-detail .rh-sec-head h2{font-size:clamp(32px,4.4vw,50px);margin:0 0 12px}
.rh-box-detail .rh-sec-head p{font-size:16px;color:var(--muted);margin:0}
.rh-box-detail .rh-inner{max-width:1160px;margin:0 auto}

/* Comment ça marche */
.rh-box-detail .rh-how{background:var(--cream)}
.rh-box-detail .rh-how-inner{max-width:980px;margin:0 auto}
.rh-box-detail .rh-how-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:0}
.rh-box-detail .rh-hstep{text-align:center;padding:0 34px;position:relative}
.rh-box-detail .rh-hstep + .rh-hstep::before{content:'';position:absolute;left:0;top:8%;height:84%;width:1px;background:var(--wine-soft);opacity:.35}
.rh-box-detail .rh-hstep img{height:96px;margin:0 auto 22px;object-fit:contain}
.rh-box-detail .rh-hstep p{font-size:16px;color:var(--text);max-width:220px;margin:0 auto;line-height:1.45}

/* Cross-sell autres box */
.rh-box-detail .rh-cross-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:24px}
.rh-box-detail .rh-cross-card{background:#fff;border:1px solid var(--line);overflow:hidden;transition:.25s;text-decoration:none;display:block}
.rh-box-detail .rh-cross-card:hover{transform:translateY(-6px);box-shadow:var(--rh-shadow)}
.rh-box-detail .rh-cross-media{height:190px;position:relative;background:var(--sand)}
.rh-box-detail .rh-cross-media img{width:100%;height:100%;object-fit:cover}
.rh-box-detail .rh-cross-media img.rh-cross-picto{position:absolute;left:16px;top:16px;width:52px;height:52px;object-fit:contain;background:#fff;border-radius:50%;padding:8px;box-shadow:0 6px 16px rgba(0,0,0,.14)}
.rh-box-detail .rh-cross-body{padding:24px}
.rh-box-detail .rh-cross-body h3{font-size:26px;margin:0 0 4px}
.rh-box-detail .rh-cross-body .rh-tag{font-family:'Ivar Display Condensed',serif;font-style:italic;color:var(--wine-soft);font-size:14px;margin-bottom:14px}
.rh-box-detail .rh-cross-body .rh-foot{display:flex;align-items:center;justify-content:space-between}
.rh-box-detail .rh-cross-body .rh-p{font-family:'Ivar Display Condensed',serif;color:var(--wine);font-size:20px}
.rh-box-detail .rh-cross-body .rh-see{font-weight:700;text-transform:uppercase;font-size:12px;letter-spacing:.1em;color:var(--wine);border-bottom:1.5px solid var(--wine);padding-bottom:2px}

/* FAQ */
.rh-box-detail .rh-faq-in{max-width:820px;margin:0 auto}
.rh-box-detail .rh-faq-item{border-bottom:1px solid var(--line)}
.rh-box-detail .rh-faq-q{display:flex;justify-content:space-between;align-items:center;gap:20px;padding:22px 0;cursor:pointer;font-size:18px;font-weight:500;color:var(--ink)}
.rh-box-detail .rh-faq-q .rh-pm{width:26px;height:26px;flex:none;position:relative}
.rh-box-detail .rh-faq-q .rh-pm::before,.rh-box-detail .rh-faq-q .rh-pm::after{content:'';position:absolute;background:var(--wine);transition:.25s}
.rh-box-detail .rh-faq-q .rh-pm::before{top:12px;left:3px;width:20px;height:2px}
.rh-box-detail .rh-faq-q .rh-pm::after{left:12px;top:3px;width:2px;height:20px}
.rh-box-detail .rh-faq-item.open .rh-pm::after{transform:rotate(90deg);opacity:0}
.rh-box-detail .rh-faq-a{max-height:0;overflow:hidden;transition:max-height .3s ease}
.rh-box-detail .rh-faq-a p{padding:0 0 22px;font-size:15px;color:var(--muted);margin:0}

/* storytelling (box_paragraphs) + citation : reprises telles quelles, léger lifting */
.rh-box-detail .box_paragraphs{max-width:1160px;margin:0 auto;gap:60px}
.rh-box-detail .box_paragraphs .is-style-title_2{font-family:'Ivar Display Condensed',serif;color:var(--wine);font-size:clamp(30px,3.6vw,44px)}
.rh-box-detail .section_citation{background:var(--cream)}

/* ---- Responsive ---- */
@media(max-width:960px){
  /* Neutralise la géométrie legacy de style.css (.product_cat-box @900/@1200 :
     .summary{width:350px;margin:auto;text-align:center} + .container>div{width:100%})
     qui décalait le résumé à droite et chevauchait la photo en portrait (retour
     recette L T29/T36, S T15/T36). Tout est repris par la grille refonte, en
     !important car les sélecteurs legacy (5 classes) sont plus spécifiques. */
  .rh-box-detail .product_intro{padding:24px 18px 56px}
  .rh-box-detail .product_intro > .container{grid-template-columns:1fr;row-gap:22px;column-gap:0;padding:0!important;width:100%!important;max-width:100%!important}
  .rh-box-detail .product_intro > .container > div,
  .rh-box-detail .product_intro > .container > h1.is-style-title_2{width:100%!important;max-width:100%!important;margin-left:0!important;margin-right:0!important;float:none!important}
  .rh-box-detail .product_intro > .container > h1.is-style-title_2{grid-column:1;grid-row:auto;order:0;text-align:left!important;margin-top:0!important}
  /* galerie en premier (image -> tagline -> résumé) pour que le picto médaillon
     reste sur la galerie et n'écrase plus la tagline en haut. */
  .rh-box-detail .woocommerce-product-gallery{grid-column:1;grid-row:auto;position:static!important;order:-1;width:100%!important;max-width:100%!important}
  .rh-box-detail .summary.entry-summary{grid-column:1;grid-row:auto;order:1;width:100%!important;max-width:100%!important;margin:0!important;text-align:left!important;padding-bottom:0!important}
  .rh-box-detail .rh-gallery-picto{width:56px;height:56px;left:12px;top:12px;padding:9px}
  .rh-box-detail .rh-cross-grid{grid-template-columns:1fr 1fr}
}
@media(max-width:760px){
  .rh-box-detail .rh-how-grid{grid-template-columns:1fr;gap:40px}
  .rh-box-detail .rh-hstep{padding:0}
  .rh-box-detail .rh-hstep + .rh-hstep::before{display:none}
  .rh-box-detail .rh-hstep img{height:84px;margin-bottom:16px}
}
@media(max-width:720px){
  .rh-box-detail .rh-sec{padding:56px 20px}
  .rh-box-detail .rh-cross-grid{grid-template-columns:1fr}
  .rh-box-detail .product_buttons .button_sabonner,
  .rh-box-detail .product_buttons .button_offrir{min-width:100%}
}

/* --- Overrides fins (galerie WooCommerce, selects, prix) --- */
.rh-box-detail .woocommerce-product-gallery{width:100%!important;float:none!important;max-width:none}
.rh-box-detail .woocommerce-product-gallery .flex-viewport,
.rh-box-detail .woocommerce-product-gallery__wrapper{width:100%!important}
.rh-box-detail .woocommerce-product-gallery__image{width:100%}
.rh-box-detail .woocommerce-product-gallery__image img{width:100%!important;height:auto!important;max-width:none}
.rh-box-detail .woocommerce-product-gallery__trigger{top:16px;right:16px}
/* prix bien visible dans le résumé */
.rh-box-detail .summary > .price{display:block;margin:4px 0 14px}

/* Résumé + formulaire config en pleine largeur de la colonne.
   WooCommerce impose summary 48% + select 250px : on force. */
.rh-box-detail .summary.entry-summary{width:100%!important;max-width:none!important;float:none!important}
.rh-box-detail form.variations_form.cart{width:100%!important;max-width:100%!important;display:block}
.rh-box-detail .single_variation_wrap{width:100%}
.rh-box-detail table.variations,
.rh-box-detail table.variations tbody,
.rh-box-detail table.variations tr,
.rh-box-detail table.variations td{width:100%}
.rh-box-detail table.variations td.value{width:100%!important;display:block}
/* selects natifs (masqués au profit des pastilles) + select2 de secours */
.rh-box-detail table.variations select{width:100%!important;max-width:100%!important;min-width:0!important;background:#fff!important}
.rh-box-detail .selected_attributes{width:100%!important}
.rh-box-detail .select2-container{width:100%!important}
.rh-box-detail .select2-container .select2-selection--single{height:46px;border:1.5px solid var(--line);border-radius:0;display:flex;align-items:center;padding:0 14px}
.rh-box-detail .select2-container--default .select2-selection--single .select2-selection__arrow{height:44px}

/* FIX marges storytelling (#27) : override classes thème pl-13/padding-30/pt-9 */
.rh-box-detail .box_paragraphs.wp-block-columns,
.rh-box-detail .box_paragraphs{max-width:1160px!important;margin:0 auto!important;padding:80px 24px!important;display:flex!important;gap:60px;align-items:flex-start}
.rh-box-detail .box_paragraphs > .wp-block-column,
.rh-box-detail .box_paragraphs > .column{padding:0!important;margin:0!important;flex:1;min-width:0}
.rh-box-detail .box_paragraphs .is-style-title_2{margin:0}
.rh-box-detail .box_paragraphs p{margin:0;font-size:16px;line-height:1.7;color:var(--text)}
.rh-box-detail .pt-9{padding-top:0!important}
.rh-box-detail .section_citation{margin:0}

/* ==== Refonte fiche box (mockup #29) : pastilles, badge phare, picto galerie ==== */
.rh-box-detail .rh-native-hidden{display:none!important}
.rh-box-detail .rh-pills{display:flex;flex-wrap:wrap;gap:10px;margin-top:2px}
.rh-box-detail .rh-pill{font-family:'Larsseit',sans-serif;font-size:14px;line-height:1.1;padding:12px 18px;border:1.5px solid var(--line);background:#fff;color:var(--ink);cursor:pointer;transition:.18s}
.rh-box-detail .rh-pill:hover{border-color:var(--wine-soft);color:var(--wine)}
.rh-box-detail .rh-pill.on{border-color:var(--wine);color:var(--wine);background:#fdf6f2;font-weight:500}
.rh-box-detail .rh-pill-badge{display:inline-block;margin-left:8px;padding:2px 6px;background:var(--wine);color:#fff;font-size:11px;font-weight:600;line-height:1.2;letter-spacing:.02em;vertical-align:middle}
.rh-box-detail .rh-pill-off .rh-pill-badge{background:var(--muted)}

/* Badge "Notre box phare" (injecté via hook, avant le titre) */
.rh-box-detail .rh-phare-badge{display:inline-block;background:var(--wine);color:#fff;font-family:'Larsseit',sans-serif;
  font-size:11px;letter-spacing:.16em;text-transform:uppercase;font-weight:700;padding:7px 14px;margin:0 0 14px}

/* Picto gravé en médaillon sur la galerie */
.rh-box-detail .product_intro > .container{position:relative}
.rh-box-detail .rh-gallery-picto{position:absolute;left:20px;top:20px;z-index:3;width:74px;height:74px;
  object-fit:contain;background:#fff;border-radius:50%;padding:12px;box-shadow:0 8px 22px rgba(0,0,0,.14)}

/* S'abonner désactivé tant qu'aucune variation complète n'est choisie */
.rh-box-detail .button_sabonner.rh-disabled{opacity:.55;pointer-events:none}

/* Pastille désactivée (combinaison non dispo) */
.rh-box-detail .rh-pill-off{opacity:.4;cursor:not-allowed;pointer-events:none;background:#faf7f3}
/* Marge sous le bloc config pour l'annotation "une carte cadeau" (#31) */
.rh-box-detail .variations_form{padding-bottom:46px}
.rh-box-detail .bouton_offrir_annotation{white-space:nowrap}

/* Miniatures galerie WooCommerce (flexslider) — apparaissent si le produit a plusieurs images */
.rh-box-detail .flex-control-thumbs{display:flex;gap:12px;margin-top:12px;padding:0;list-style:none}
.rh-box-detail .flex-control-thumbs li{flex:1;margin:0}
.rh-box-detail .flex-control-thumbs img{width:100%;height:88px;object-fit:cover;border:1px solid var(--line);cursor:pointer;opacity:.7;transition:.2s}
.rh-box-detail .flex-control-thumbs img.flex-active,
.rh-box-detail .flex-control-thumbs img:hover{opacity:1;border-color:var(--wine)}

/* ==== Ce que vous recevez ==== */
.rh-box-detail .rh-contient{background:linear-gradient(180deg,var(--cream),var(--paper))}
.rh-box-detail .rh-cont-grid{max-width:720px;margin:0 auto;display:grid;grid-template-columns:repeat(2,1fr);gap:26px}
.rh-box-detail .rh-cont-card{background:#fff;border:1px solid var(--line);padding:34px 26px;text-align:center}
.rh-box-detail .rh-cont-ic{width:48px;height:48px;margin:0 auto 18px;color:var(--wine)}
/* Pictos bouteilles : hauteur auto + largeurs bornées pour ne jamais rogner/déborder
   (retour recette S T30 : "un seul visible pour Alba, tronqués pour Crescendo/Intégrale"). */
.rh-box-detail .rh-cont-bottles{display:flex;justify-content:center;align-items:flex-end;gap:8px;min-height:58px;margin:0 auto 18px;flex-wrap:nowrap}
.rh-box-detail .rh-cont-bottles img{height:58px;width:auto;max-width:32%;object-fit:contain}
.rh-box-detail .rh-cont-card h3{font-family:'Ivar Display Condensed',serif;font-weight:700;color:var(--wine);font-size:22px;margin:0 0 8px}
.rh-box-detail .rh-cont-card p{font-size:14px;color:var(--muted);margin:0;line-height:1.5}

/* ==== Les dernières box (CTA vers la page éditions) ==== */
.rh-box-detail .rh-editions{background:var(--paper)}
.rh-box-detail .rh-ed-all{text-align:center;margin-top:36px}

@media(max-width:760px){
  .rh-box-detail .rh-cont-grid{grid-template-columns:1fr}
  /* storytelling + citation : empilage vertical (sinon 2 colonnes serrées sur mobile) */
  .rh-box-detail .box_paragraphs,
  .rh-box-detail .box_paragraphs.wp-block-columns{flex-direction:column!important;gap:26px;padding:56px 20px!important}
  .rh-box-detail .section_citation .wp-block-columns{flex-direction:column}
  .rh-box-detail .section_citation .wp-block-column,
  .rh-box-detail .section_citation .column{flex-basis:auto!important;width:100%!important}
}
