/* =========================================================================
   Réhabillage visuel du panier / checkout / page "Réservation effectuée"
   WooCommerce CLASSIQUES (shortcodes [woocommerce_cart]/[woocommerce_checkout],
   pas le checkout par blocs — confirmé). Chargé en PLUS des styles/scripts
   WooCommerce existants (jamais à la place) : voir fh_enqueue_checkout_assets()
   dans functions_woocommerce.php. Ne touche à aucun gabarit ni script réel
   (checkout.js, Select2, SDK PayPal) — uniquement de la couleur/typo/mise en
   page par-dessus le HTML existant. Les couleurs reprennent la palette
   --fh-* déjà utilisée sur les pages migrées (voir assets/css/fh-design/style.css),
   dupliquée ici en local pour ne pas dépendre de ce fichier (qui n'est pas
   chargé ici et viderait les styles WooCommerce/PayPal si on l'enfilait tel quel).
   ========================================================================= */

body.woocommerce-cart,
body.woocommerce-checkout,
body.woocommerce-order-received {
    --fhc-primary: #673131;
    --fhc-primary-hover: #823a3a;
    --fhc-cream: #fffaf6;
    --fhc-ink: #2a2020;
    --fhc-ink-soft: #5a4433;
    --fhc-muted: #8a7a7a;
    --fhc-sand: #f3d9b4;
    --fhc-line: rgba(103, 49, 49, .14);
    background: var(--fhc-cream);
}

body.woocommerce-cart #content,
body.woocommerce-checkout #content,
body.woocommerce-order-received #content {
    padding-top: 2.5rem;
    padding-bottom: 3.5rem;
}

/* Le header/footer fh-design est injecté par-dessus le gabarit WooCommerce
   d'origine (voir functions_woocommerce.php) : tout élément <button> de ces
   pages hérite sinon du style générique "gros bouton plein" du thème/de
   WooCommerce (fond, padding 20px 45px, radius, ombre) — y compris des
   boutons qui n'existent que sur ces pages, comme .fh-checkout-line-remove.
   Réinitialisation générale d'abord (tout <button> du header/footer/panneaux
   fh-design, hors vrais CTA .fh-btn), puis chaque composant reprend sa
   propre apparence par-dessus — voir style.css pour les valeurs d'origine
   de chacun (.fh-icon-link, .fh-to-top, .fh-modal__close, .fh-burger,
   .fh-mobile-tab, .fh-checkout-line-remove ci-dessous). */
body.woocommerce-cart .fh-header button:not(.fh-btn),
body.woocommerce-cart .fh-footer button:not(.fh-btn),
body.woocommerce-cart .fh-panel button:not(.fh-btn),
body.woocommerce-cart .fh-mobile-tabbar button,
body.woocommerce-cart .fh-to-top,
body.woocommerce-cart .fh-checkout-line-remove,
body.woocommerce-checkout .fh-header button:not(.fh-btn),
body.woocommerce-checkout .fh-footer button:not(.fh-btn),
body.woocommerce-checkout .fh-panel button:not(.fh-btn),
body.woocommerce-checkout .fh-mobile-tabbar button,
body.woocommerce-checkout .fh-to-top,
body.woocommerce-checkout .fh-checkout-line-remove,
body.woocommerce-order-received .fh-header button:not(.fh-btn),
body.woocommerce-order-received .fh-footer button:not(.fh-btn),
body.woocommerce-order-received .fh-panel button:not(.fh-btn),
body.woocommerce-order-received .fh-mobile-tabbar button,
body.woocommerce-order-received .fh-to-top {
    padding: 0 !important;
    box-shadow: none !important;
    font: inherit !important;
}

body.woocommerce-cart .fh-icon-link,
body.woocommerce-checkout .fh-icon-link,
body.woocommerce-order-received .fh-icon-link {
    width: 38px !important;
    height: 38px !important;
    border-radius: 50% !important;
    background: transparent !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}
body.woocommerce-cart .fh-icon-link:hover,
body.woocommerce-checkout .fh-icon-link:hover,
body.woocommerce-order-received .fh-icon-link:hover {
    background: var(--fhc-primary) !important;
}
body.woocommerce-cart .fh-icon-link svg,
body.woocommerce-checkout .fh-icon-link svg,
body.woocommerce-order-received .fh-icon-link svg {
    width: 17px !important;
    height: 17px !important;
    display: block !important;
}

body.woocommerce-cart .fh-to-top,
body.woocommerce-checkout .fh-to-top,
body.woocommerce-order-received .fh-to-top {
    width: 46px !important;
    height: 46px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    background: var(--fhc-primary) !important;
    color: #fff !important;
    box-shadow: 0 12px 26px rgba(103,49,49,.32) !important;
}

body.woocommerce-cart .fh-modal__close,
body.woocommerce-checkout .fh-modal__close,
body.woocommerce-order-received .fh-modal__close {
    width: 38px !important;
    height: 38px !important;
    border-radius: 50% !important;
    background: #fff !important;
    border: 1px solid var(--fhc-line) !important;
    color: var(--fhc-primary) !important;
}

body.woocommerce-cart .fh-burger,
body.woocommerce-checkout .fh-burger,
body.woocommerce-order-received .fh-burger {
    width: 40px !important;
    height: 40px !important;
    border-radius: 0 !important;
    background: transparent !important;
}

body.woocommerce-cart button.fh-mobile-tab,
body.woocommerce-checkout button.fh-mobile-tab,
body.woocommerce-order-received button.fh-mobile-tab {
    padding: .3rem .2rem !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: var(--fhc-ink-soft) !important;
}

body.woocommerce-cart .page,
body.woocommerce-checkout .page,
body.woocommerce-order-received .page {
    background-color: var(--fhc-cream);
}

/* Le thème Elementor pilote l'affichage du titre de page via la variable CSS
   --page-title-display (réglage global "masquer le titre"), qui vaut "none"
   par défaut sur tout le site — y compris ces pages non construites avec
   Elementor. Le <h1> existe déjà dans le HTML (juste avant le contenu du
   shortcode, donc juste avant le bloc code promo) : on le réaffiche. */
body.woocommerce-cart h1.entry-title,
body.woocommerce-checkout h1.entry-title,
body.woocommerce-order-received h1.entry-title {
    display: block !important;
    color: var(--fhc-primary);
    text-align: center;
    margin-top: 0;
}

/* ---------- Cartes de section (billing / order review / payment) ---------- */
.woocommerce-checkout #customer_details,
.woocommerce-checkout #order_review_heading,
.woocommerce-checkout #order_review,
.woocommerce-cart .cart_totals,
#vmwcu-gc-block {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 12px 30px rgba(103,49,49,.08);
    padding: 1.75rem clamp(1.25rem, 3vw, 2rem);
}
.woocommerce-checkout #order_review_heading { margin-bottom: 0; border-radius: 20px 20px 0 0; box-shadow: none; padding-bottom: .5rem; }
.woocommerce-checkout #order_review { border-radius: 0 0 20px 20px; margin-top: 0; padding-top: .5rem; }
.woocommerce-checkout h3, .woocommerce-cart h3 { color: var(--fhc-primary); font-size: 1.15rem; margin: 0 0 1.1rem; }

/* ---------- Champs de formulaire ---------- */
.woocommerce-checkout input[type="text"],
.woocommerce-checkout input[type="email"],
.woocommerce-checkout input[type="tel"],
.woocommerce-checkout input[type="password"],
.woocommerce-checkout input[type="date"],
.woocommerce-checkout textarea,
.woocommerce-checkout select,
.woocommerce-checkout .select2-selection {
    border: 1px solid var(--fhc-line) !important;
    border-radius: 12px !important;
    background: var(--fhc-cream) !important;
    color: var(--fhc-ink) !important;
    padding: .7rem .95rem !important;
    height: auto !important;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.woocommerce-checkout input[type="text"]:focus,
.woocommerce-checkout input[type="email"]:focus,
.woocommerce-checkout input[type="tel"]:focus,
.woocommerce-checkout textarea:focus,
.woocommerce-checkout select:focus,
.woocommerce-checkout .select2-container--focus .select2-selection {
    outline: none !important;
    border-color: var(--fhc-primary) !important;
    box-shadow: 0 0 0 3px rgba(103,49,49,.12) !important;
    background: #fff !important;
}
.woocommerce-checkout .select2-selection__rendered { color: var(--fhc-ink) !important; line-height: 2.1 !important; }
.woocommerce-checkout label { color: var(--fhc-ink-soft); }
.woocommerce-checkout .woocommerce-input-wrapper .required,
.woocommerce-checkout label .required { color: var(--fhc-primary); }

/* Champs "Comment nous avez-vous connus" / consentement photo — déjà mis en
   ligne/flex par functions_woocommerce.php, on n'ajoute que la couleur. */
#customer_source_field input[type="radio"],
#media_consent_field input[type="checkbox"] { accent-color: var(--fhc-primary); }

/* ---------- Boutons ---------- */
.woocommerce-checkout #place_order,
.woocommerce-cart .checkout-button,
.woocommerce-checkout [name="apply_coupon"],
#vmwcu_gc_apply {
    background: var(--fhc-primary) !important;
    border: none !important;
    color: #fff !important;
    border-radius: 999px !important;
    padding: 1rem 2rem !important;
    font-weight: 600;
    letter-spacing: .02em;
    box-shadow: 0 12px 26px rgba(103,49,49,.28);
    transition: background-color .25s ease, transform .25s ease, box-shadow .25s ease;
}
.woocommerce-checkout #place_order:hover,
.woocommerce-cart .checkout-button:hover,
.woocommerce-checkout [name="apply_coupon"]:hover,
#vmwcu_gc_apply:hover {
    background: var(--fhc-primary-hover) !important;
    transform: translateY(-2px);
    box-shadow: 0 18px 34px rgba(103,49,49,.36);
}
.woocommerce-checkout .woocommerce-form-coupon-toggle .woocommerce-info,
.woocommerce-cart .woocommerce-form-coupon-toggle .woocommerce-info { background: transparent; border: none; padding-left: 0; }
.woocommerce-form-coupon-toggle .woocommerce-info::before { display: none; }
.woocommerce-checkout .woocommerce-form-coupon-toggle a,
.woocommerce-cart .woocommerce-form-coupon-toggle a { color: var(--fhc-primary); font-weight: 600; text-decoration: underline; }

/* ---------- Suppression d'une ligne (checkout uniquement) ---------- */
.fh-checkout-line-remove {
    display: inline-flex !important; align-items: center !important; justify-content: center !important;
    width: 22px !important; height: 22px !important; border-radius: 50% !important;
    margin-left: .5rem; border: none !important; background: transparent !important; color: #c65454 !important;
    cursor: pointer; vertical-align: middle; opacity: .75; transition: opacity .2s ease;
}
.fh-checkout-line-remove:hover { opacity: 1; }
.fh-checkout-line-remove.fh-is-loading { opacity: .35; cursor: default; }

/* ---------- Tableau de révision de commande / panier ---------- */
.woocommerce-checkout-review-order-table,
.woocommerce-cart-form .shop_table,
.woocommerce-table--order-details {
    border-collapse: collapse;
    width: 100%;
}
.woocommerce-checkout-review-order-table th,
.woocommerce-cart-form .shop_table th,
.woocommerce-table--order-details th {
    color: var(--fhc-muted);
    font-size: .78rem;
    letter-spacing: .03em;
    text-transform: uppercase;
    font-weight: 600;
    border-bottom: 1px solid var(--fhc-line);
    padding: .6rem .4rem;
}
.woocommerce-checkout-review-order-table td,
.woocommerce-cart-form .shop_table td,
.woocommerce-table--order-details td {
    border-bottom: 1px solid var(--fhc-line);
    padding: .85rem .4rem;
    color: var(--fhc-ink);
}
.woocommerce-checkout-review-order-table .order-total td,
.woocommerce-checkout-review-order-table .order-total th,
.woocommerce-cart-form .shop_table .order-total td { font-weight: 700; color: var(--fhc-primary); border-bottom: none; }
.woocommerce-Price-amount { color: var(--fhc-primary); font-weight: 600; }

/* ---------- Panier : miniature produit + quantité ---------- */
.woocommerce-cart-form .product-thumbnail img { border-radius: 12px; }
.woocommerce-cart .quantity .qty {
    border: 1px solid var(--fhc-line); border-radius: 999px; padding: .5rem .8rem; width: 4.2rem; text-align: center;
}
.woocommerce-cart .product-remove a.remove {
    color: #c65454 !important; background: transparent !important; font-size: 1.4rem !important;
}
.woocommerce-cart .cart_totals h2 { color: var(--fhc-primary); }

/* ---------- Moyens de paiement ---------- */
.woocommerce-checkout ul.wc_payment_methods { list-style: none; margin: 0 0 1rem; padding: 0; }
.woocommerce-checkout ul.wc_payment_methods li.wc_payment_method {
    border: 1px solid var(--fhc-line); border-radius: 14px; padding: .9rem 1.1rem; margin-bottom: .7rem; background: #fff;
}
.woocommerce-checkout ul.wc_payment_methods li.wc_payment_method label { color: var(--fhc-ink); font-weight: 600; }
.woocommerce-checkout ul.wc_payment_methods input[type="radio"] { accent-color: var(--fhc-primary); margin-right: .5rem; }
.woocommerce-checkout .payment_box { background: var(--fhc-cream) !important; border-radius: 12px; margin-top: .75rem !important; }
.woocommerce-checkout .payment_box:before { display: none; }
.woocommerce-checkout .woocommerce-privacy-policy-text { color: var(--fhc-muted); font-size: .82rem; }

/* ---------- Bloc carte-cadeau (vm-woocommerce-utilitaires) ---------- */
#vmwcu-gc-block { margin-bottom: 1.5rem; }
#vmwcu-gc-block h3 { margin-bottom: .8rem; }
#vmwcu_gc_code {
    border: 1px solid var(--fhc-line); border-radius: 999px; padding: .65rem 1.1rem; margin-right: .6rem;
    background: var(--fhc-cream); min-width: 220px;
}
#vmwcu_gc_apply { padding: .65rem 1.4rem !important; }
.vmwcu-gc-message { margin-top: .6rem; font-size: .88rem; }

/* ---------- Message contact (déjà stylé inline, on arrondit juste les coins) ---------- */
.checkout-contact-message { border-radius: 12px; }

/* ---------- Page "Réservation effectuée" ---------- */
.woocommerce-order-received .woocommerce-thankyou-order-received {
    color: var(--fhc-primary); font-size: 1.15rem; text-align: center; padding: 1.5rem; background: #fff; border-radius: 16px;
    box-shadow: 0 12px 30px rgba(103,49,49,.08); margin-bottom: 2rem;
}
.woocommerce-order-received .woocommerce-order-overview { background: #fff; border-radius: 16px; box-shadow: 0 12px 30px rgba(103,49,49,.08); padding: 1.5rem; list-style: none; }
.woocommerce-order-received .woocommerce-order-overview li { border-right-color: var(--fhc-line) !important; }

@media (max-width: 768px) {
    .woocommerce-checkout #customer_details,
    .woocommerce-checkout #order_review_heading,
    .woocommerce-checkout #order_review,
    .woocommerce-cart .cart_totals,
    #vmwcu-gc-block {
        padding: 1.25rem;
    }
}
