/*
Theme Name: Éditions ATP
Theme URI:  https://www.editions-atp.com/
Description: Thème principal sur-mesure pour les Éditions ATP avec système de vente au chapitre (Cairn.info), annuaire des auteurs, visionneuse PDF.js et design unifié.
Author:     Agence Tâmbour / Cedric Fotso
Author URI: https://cedricfotso.com/
Version:    2.0.0
Text Domain: editions-atp
Domain Path: /languages
License:    GNU General Public License v2 or later
Requires at least: 6.0
Requires PHP: 8.0
*/

.product-authors{
    line-height: 1.8;
}

.product-authors strong{
    color: #000;
    font-weight: 700;
    text-decoration: underline;
    text-decoration-color: var(--atp-accent-text, #b45309);
    text-decoration-thickness: 3px;
    text-underline-offset: 6px;
    margin-right: 6px;
}

.product-authors a{
    color: #000 !important;
    text-decoration: underline !important;
    text-decoration-color: #000 !important;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.product-authors a:hover{
    text-decoration-color: var(--atp-accent-text, #b45309) !important;
}


/* ==========================================================================
   Boutique & Archives — Cartes produit WooCommerce
   IMPORTANT : atp-theme-style déclare woocommerce-general en dépendance pour
   charger APRÈS woocommerce.css. Ne pas changer l'ordre des dépendances.
   ========================================================================== */

/* ── Variables ─────────────────────────────────────────────────────────────── */

:root {
    --atp-card-radius      : 10px;
    --atp-card-shadow      : 0 2px 12px rgba(0, 0, 0, .08);
    --atp-card-shadow-hover: 0 10px 30px rgba(0, 0, 0, .15);
    --atp-card-border      : #e5e7eb;
    --atp-card-text        : #1d2327;
    --atp-card-muted       : #6b7280;
    --atp-card-orange      : var(--atp-accent-text, #b45309);
    --atp-card-btn-bg      : #1d2327;
    --atp-card-btn-hover   : #f2b300;
}

/* ── Grille déléguée à templates.css ────────────────────────────────────────── */

/* ── Carte produit ─────────────────────────────────────────────────────────── */

ul.products li.product {
    background: #fff;
    border: 1px solid var(--atp-card-border);
    border-radius: var(--atp-card-radius);
    box-shadow: var(--atp-card-shadow);
    overflow: hidden;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    transition: box-shadow .22s ease, transform .22s ease;
    position: relative;
    float: none;
    clear: none;
    width: auto;
}

ul.products li.product:hover {
    box-shadow: var(--atp-card-shadow-hover);
    transform: translateY(-4px);
}

/* ── Zone image — ratio portrait 2:3 ──────────────────────────────────────── */

ul.products li.product a.woocommerce-LoopProduct-link,
ul.products li.product a.woocommerce-loop-product__link {
    display: block !important;
    position: relative !important;
}

/*
 * object-fit: contain → couverture entière visible, aucun recadrage
 * aspect-ratio: 2/3   → hauteur uniforme pour toutes les cartes
 * background          → remplace le letterboxing blanc par un gris neutre
 * (La miniature WC peut être carrée : contain la "pose" dans le cadre portrait
 *  sans couper aucun contenu. Regen miniatures WC recommandée pour le plein effet.)
 */
ul.products li.product a img {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 2 / 3 !important;
    object-fit: contain !important;
    background: #f5f5f5 !important;
    display: block !important;
    margin: 0 !important;
    transition: filter .28s ease !important;
    border-radius: 0 !important;
    max-width: 100% !important;
}

ul.products li.product:hover a img {
    filter: brightness(1.07) saturate(1.04) !important;
}

/* ── Badges de format (injectés par PHP, positionnés sur l'image) ──────────── */

/*
 * .atp-loop-badges est injecté par editions_atp_loop_format_badges()
 * (woocommerce_before_shop_loop_item_title, prio 15) — il est dans le même
 * <a> que l'image. L'<a> a position:relative → les badges s'y ancrent.
 */
.atp-loop-badges {
    position: absolute !important;
    top: 8px !important;
    left: 8px !important;
    z-index: 10 !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 4px !important;
    pointer-events: none !important;
    line-height: normal !important;
}

.atp-loop-badge {
    display: inline-flex !important;
    align-items: center !important;
    gap: 3px !important;
    padding: 3px 8px !important;
    border-radius: 20px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    line-height: 1.5 !important;
    white-space: nowrap !important;
    letter-spacing: .15px !important;
    box-shadow: 0 1px 5px rgba(0, 0, 0, .22) !important;
}

.atp-loop-badge--papier   { background: #dcfce7 !important; color: #15803d !important; border: 1px solid #bbf7d0 !important; }
.atp-loop-badge--pdf      { background: #e0f2fe !important; color: #0369a1 !important; border: 1px solid #bae6fd !important; }
.atp-loop-badge--chapitre { background: #ede9fe !important; color: #5b21b6 !important; border: 1px solid #ddd6fe !important; }

/* ── Zone texte ────────────────────────────────────────────────────────────── */

ul.products li.product .woocommerce-loop-product__title,
ul.products li.product .atp-loop-auteurs,
ul.products li.product .price,
ul.products li.product .button {
    padding-left: 14px !important;
    padding-right: 14px !important;
}

/* ── Titre ─────────────────────────────────────────────────────────────────── */

ul.products li.product .woocommerce-loop-product__title {
    color: #1d2327 !important;
    padding-top: 12px !important;
    padding-bottom: 4px !important;
    margin: 0 !important;
}

/* ── Auteur(s) — encadré haut/bas, police réduite ──────────────────────────── */

ul.products li.product .atp-loop-auteurs {
    display: block !important;
    font-size: 12px !important;
    line-height: 1.4 !important;
    color: #6b7280 !important;
    margin: 6px 0 !important;
    padding: 7px 14px !important;
    border-top: 1px solid #e5e7eb !important;
    border-bottom: 1px solid #e5e7eb !important;
}

/* display:inline annule le display:block global de WooCommerce sur les <a>
   dans les cartes produit, ce qui causait chaque auteur sur sa propre ligne */
ul.products li.product .atp-loop-auteurs a,
.woocommerce ul.products li.product .atp-loop-auteurs a {
    display: inline !important;
    color: #6b7280 !important;
    text-decoration: none !important;
    font-size: 12px !important;
    transition: color .15s !important;
}

ul.products li.product .atp-loop-auteurs a:hover,
.woocommerce ul.products li.product .atp-loop-auteurs a:hover {
    color: #1d2327 !important;
    text-decoration: underline !important;
}

/* ── Prix ──────────────────────────────────────────────────────────────────── */

ul.products li.product .price {
    font-size: 13px !important;
    font-weight: 700 !important;
    color: var(--atp-card-orange) !important;
    display: block !important;
    margin: 0 !important;
    padding-top: 2px !important;
    padding-bottom: 10px !important;
    line-height: 1.4 !important;
}

ul.products li.product .price del {
    font-size: 11px !important;
    font-weight: 400 !important;
    opacity: .55 !important;
    margin-right: 4px !important;
}

ul.products li.product .price ins {
    text-decoration: none !important;
    font-weight: 700 !important;
}

/* ── Note (étoiles) ────────────────────────────────────────────────────────── */

ul.products li.product .star-rating {
    font-size: .7em !important;
    margin: 0 14px 4px !important;
}

/* ── Bouton "Acheter le livre" / "Choix des options" ──────────────────────── */

ul.products li.product .button {
    display: block !important;
    width: calc(100% - 28px) !important;
    margin: auto 14px 14px !important;
    padding: 10px 20px !important;
    border-radius: 50px !important;
    font-family: inherit !important;   /* Inter Tight héritée du thème */
    font-weight: 700 !important;
    text-align: center !important;
    background: #f2b300 !important;
    color: #1d2327 !important;
    border: none !important;
    text-decoration: none !important;
    transition: background .18s, color .18s !important;
    margin-top: auto !important;
    box-sizing: border-box !important;
}

ul.products li.product .button:hover,
ul.products li.product .button:focus-visible {
    background: #1d2327 !important;
    color: #f2b300 !important;
    text-decoration: none !important;
}

ul.products li.product .button.disabled,
ul.products li.product .button:disabled {
    opacity: .55 !important;
    cursor: not-allowed !important;
}

/* ── Badge "Soldes" WooCommerce ────────────────────────────────────────────── */

ul.products li.product .onsale {
    position: absolute !important;
    top: 8px !important;
    right: 8px !important;
    left: auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    width: auto !important;
    height: auto !important;
    line-height: 1.5 !important;
    padding: 3px 9px !important;
    border-radius: 20px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    letter-spacing: .15px !important;
    background: #ef4444 !important;
    color: #fff !important;
    text-transform: none !important;
    box-shadow: 0 1px 5px rgba(0, 0, 0, .22) !important;
    z-index: 10 !important;
}

/* ── Responsive ────────────────────────────────────────────────────────────── */

@media (max-width: 1024px) {
    ul.products {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)) !important;
        gap: 18px !important;
    }
}

@media (max-width: 768px) {
    ul.products {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
        max-width: 380px !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    ul.products li.product .woocommerce-loop-product__title {
        font-size: 15px !important;
        font-weight: 700 !important;
        line-height: 1.35 !important;
    }

    ul.products li.product .button {
        font-size: 13.5px !important;
        padding: 10px 16px !important;
        background-color: var(--e-global-color-accent, var(--atp-yellow, #f59e0b)) !important;
        color: #000000 !important;
        font-weight: 700 !important;
    }
}

/* ── Barre résultats / tri ─────────────────────────────────────────────────── */

.woocommerce .woocommerce-ordering select,
.woocommerce-page .woocommerce-ordering select {
    padding: 6px 10px !important;
    border: 1px solid #d1d5db !important;
    border-radius: 6px !important;
    font-size: 13px !important;
    color: #1d2327 !important;
    background-color: #fff !important;
    cursor: pointer !important;
}

.woocommerce .woocommerce-result-count,
.woocommerce-page .woocommerce-result-count {
    font-size: 13px !important;
    color: #6b7280 !important;
    margin-bottom: 1.5rem !important;
}

/* ── Pagination ────────────────────────────────────────────────────────────── */

.woocommerce nav.woocommerce-pagination ul {
    border: none !important;
}

.woocommerce nav.woocommerce-pagination ul li a,
.woocommerce nav.woocommerce-pagination ul li span {
    border: 1px solid #e5e7eb !important;
    border-radius: 6px !important;
    margin: 0 3px !important;
    padding: 6px 12px !important;
    font-size: 13px !important;
    color: #1d2327 !important;
    transition: background .16s, color .16s !important;
}

.woocommerce nav.woocommerce-pagination ul li a:hover {
    background: #f2b300 !important;
    border-color: #f2b300 !important;
    color: #1d2327 !important;
    text-decoration: none !important;
}

.woocommerce nav.woocommerce-pagination ul li span.current {
    background: #1d2327 !important;
    border-color: #1d2327 !important;
    color: #fff !important;
}

/* ==========================================================================
   Prix — page produit
   ========================================================================== */

.single-product div.product p.price,
.single-product div.product span.price {
    font-weight: 600 !important;
    line-height: 1.4 !important;
    color: #1d2327 !important;
    margin: .5rem 0 .75rem !important;
}

/* Ancien prix barré */
.single-product div.product .price del {
    font-weight: 400 !important;
    opacity: .5 !important;
    margin-right: 6px !important;
}
.single-product div.product .price del .woocommerce-Price-amount {
    text-decoration: line-through !important;
}

/* Prix soldé mis en avant */
.single-product div.product .price ins {
    text-decoration: none !important;
}

/* ==========================================================================
   Quantité +/− — stepper compact [−][1][+]
   ========================================================================== */

/*
 * Structure HTML (quantity-input.php) :
 *   .quantity.atp-qty          ← conteneur-bordure unique
 *     button.atp-qty__btn--minus
 *     input.qty                ← séparé par bordures latérales
 *     button.atp-qty__btn--plus
 */

/* Une seule bordure autour du trio.
 * overflow:visible pour éviter le clipping du bouton + si le parent
 * contraint la largeur — chaque bouton porte son propre border-radius. */
.woocommerce div.product form.cart .quantity.atp-qty {
    float: none !important;
    width: auto !important;
    max-width: none !important;
    display: inline-flex !important;
    align-items: stretch !important;
    border: 1px solid #d1d5db !important;
    border-radius: 6px !important;
    overflow: visible !important;
    background: #fff !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Boutons − et + — cible tactile conforme WCAG (min 44px) */
.atp-qty__btn {
    min-width: 44px !important;
    min-height: 44px !important;
    width: 44px !important;
    height: 44px !important;
    background: #f5f5f5 !important;
    border: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-family: inherit !important;
    font-size: 18px !important;
    font-weight: 400 !important;
    line-height: 1 !important;
    color: #374151 !important;
    cursor: pointer !important;
    padding: 0 !important;
    flex-shrink: 0 !important;
    transition: background .12s !important;
    user-select: none !important;
}
/* Border-radius sur chaque côté externe (overflow:visible) */
.atp-qty__btn--minus { border-radius: 5px 0 0 5px !important; }
.atp-qty__btn--plus  { border-radius: 0 5px 5px 0 !important; }
.atp-qty__btn:hover {
    background: #e0e0e0 !important;
    color: #1d2327 !important;
}

/* Champ numérique */
.woocommerce div.product .atp-qty input.qty {
    width: 44px !important;
    height: 44px !important;
    border: none !important;
    border-left: 1px solid #d1d5db !important;
    border-right: 1px solid #d1d5db !important;
    border-radius: 0 !important;
    text-align: center !important;
    font-family: inherit !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    color: #1d2327 !important;
    background: #fff !important;
    padding: 0 !important;
    box-shadow: none !important;
    -moz-appearance: textfield !important;
    appearance: textfield !important;
}
.woocommerce div.product .atp-qty input.qty::-webkit-inner-spin-button,
.woocommerce div.product .atp-qty input.qty::-webkit-outer-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
}
.woocommerce div.product .atp-qty input.qty:focus {
    outline: none !important;
    background: #fffcf0 !important;
}

/* ==========================================================================
   Sélecteur de variation — page produit (Format, Langue, etc.)
   ========================================================================== */

/* Table entière en bloc gris — override le fond rose/saumon du thème */
.woocommerce div.product .variations_form table.variations,
.woocommerce-page div.product .variations_form table.variations {
    display: block !important;
    background: #f3f4f6 !important;
    border-radius: 10px !important;
    padding: 16px !important;
    margin-bottom: 1rem !important;
    border-collapse: unset !important;
    border-spacing: 0 !important;
    width: 100% !important;
}

/* Chaque ligne → bloc empilé : label au-dessus, select en dessous */
.variations_form table.variations tr {
    display: block !important;
    margin-bottom: 14px !important;
}
.variations_form table.variations tr:last-child {
    margin-bottom: 0 !important;
}

.variations_form table.variations td {
    display: block !important;
    border: none !important;
    padding: 0 !important;
    background: transparent !important;
}

/* Label : transparent — annule tout fond injecté par WooCommerce ou Elementor */
.variations_form table.variations td.label,
.woocommerce div.product .variations_form table.variations td.label {
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    padding-bottom: 8px !important;
}

.variations_form table.variations td.label label,
.woocommerce div.product .variations_form table.variations td.label label,
.elementor-widget-woocommerce-add-to-cart .variations td.label label {
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    font-family: inherit !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: .1em !important;
    color: #374151 !important;
    margin: 0 !important;
    display: block !important;
}

/* Select bien dessiné */
.variations_form table.variations select {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    width: 100% !important;
    padding: 10px 36px 10px 14px !important;
    border: 1.5px solid #d1d5db !important;
    border-radius: 8px !important;
    font-family: inherit !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    color: #1d2327 !important;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 12px center / 14px !important;
    cursor: pointer !important;
    line-height: 1.4 !important;
    display: block !important;
    transition: border-color .14s !important;
    box-shadow: 0 1px 2px rgba(0,0,0,.04) !important;
}
.variations_form table.variations select:hover {
    border-color: #9ca3af !important;
}
.variations_form table.variations select:focus {
    outline: none !important;
    border-color: #f2b300 !important;
    box-shadow: 0 0 0 3px rgba(242,179,0,.15) !important;
}

/* ── Lien "Effacer" ─────────────────────────────────────────────────────────── */

.variations_form .reset_variations {
    display: inline-block !important;
    margin-top: 6px !important;
    font-family: inherit !important;
    font-size: 12px !important;
    color: #9ca3af !important;
    text-decoration: none !important;
    transition: color .16s !important;
}

.variations_form .reset_variations:hover {
    color: #ef4444 !important;
}

/* ==========================================================================
   Page Panier — woocommerce/cart/
   ========================================================================== */

/* ── Table produits ─────────────────────────────────────────────────────────── */

.woocommerce-cart .woocommerce-cart-form table.shop_table {
    border: none !important;
    border-collapse: collapse !important;
    width: 100% !important;
}

.woocommerce-cart .shop_table thead th {
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: .08em !important;
    color: #6b7280 !important;
    border-bottom: 2px solid #e5e7eb !important;
    padding: 0 8px 10px !important;
    background: transparent !important;
}

.woocommerce-cart .shop_table .cart_item td {
    padding: 16px 8px !important;
    border-bottom: 1px solid #f0f0f0 !important;
    vertical-align: middle !important;
    background: transparent !important;
}

/* Bouton × supprimer */
.woocommerce-cart .product-remove a.remove {
    color: #c0c0c0 !important;
    font-size: 20px !important;
    line-height: 1 !important;
    background: none !important;
}
.woocommerce-cart .product-remove a.remove:hover {
    color: #ef4444 !important;
    background: none !important;
}

/* Miniature */
.woocommerce-cart td.product-thumbnail img {
    width: 60px !important;
    height: auto !important;
    border-radius: 6px !important;
    display: block !important;
}

/* Nom du produit et variante */
.woocommerce-cart td.product-name a {
    font-weight: 600 !important;
    color: #1d2327 !important;
    text-decoration: none !important;
}
.woocommerce-cart td.product-name a:hover {
    color: #f2b300 !important;
}
.woocommerce-cart td.product-name .variation {
    font-size: 12px !important;
    color: #6b7280 !important;
    margin-top: 4px !important;
}
.woocommerce-cart td.product-name .variation dt,
.woocommerce-cart td.product-name .variation dd {
    display: inline !important;
    font-weight: 400 !important;
    margin: 0 !important;
}

/* Prix et sous-total */
.woocommerce-cart td.product-price,
.woocommerce-cart td.product-subtotal {
    font-weight: 600 !important;
    color: #1d2327 !important;
}

/* ── Stepper quantité dans le panier ────────────────────────────────────────── */

.woocommerce-cart-form .quantity.atp-qty {
    float: none !important;
    width: auto !important;
    max-width: none !important;
    display: inline-flex !important;
    align-items: stretch !important;
    border: 1px solid #d1d5db !important;
    border-radius: 6px !important;
    overflow: visible !important;
    background: #fff !important;
    padding: 0 !important;
    margin: 0 !important;
}

.woocommerce-cart-form .atp-qty input.qty {
    width: 40px !important;
    height: 36px !important;
    border: none !important;
    border-left: 1px solid #d1d5db !important;
    border-right: 1px solid #d1d5db !important;
    border-radius: 0 !important;
    text-align: center !important;
    font-family: inherit !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    color: #1d2327 !important;
    background: #fff !important;
    padding: 0 !important;
    box-shadow: none !important;
    -moz-appearance: textfield !important;
    appearance: textfield !important;
}
.woocommerce-cart-form .atp-qty input.qty::-webkit-inner-spin-button,
.woocommerce-cart-form .atp-qty input.qty::-webkit-outer-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
}
.woocommerce-cart-form .atp-qty input.qty:focus {
    outline: none !important;
    background: #fffcf0 !important;
}

/* ── Actions : coupon + mettre à jour ──────────────────────────────────────── */

.woocommerce-cart .woocommerce-cart-form .actions {
    padding: 20px 0 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    flex-wrap: wrap !important;
    border-top: 2px solid #e5e7eb !important;
    background: transparent !important;
}

.woocommerce-cart .woocommerce-cart-form .coupon {
    display: flex !important;
    gap: 8px !important;
    align-items: center !important;
    flex: 1 !important;
    min-width: 200px !important;
}

.woocommerce-cart .coupon input#coupon_code {
    padding: 9px 14px !important;
    border: 1px solid #d1d5db !important;
    border-radius: 6px !important;
    font-family: inherit !important;
    font-size: 14px !important;
    color: #1d2327 !important;
    background: #fff !important;
    flex: 1 !important;
}
.woocommerce-cart .coupon input#coupon_code:focus {
    outline: none !important;
    border-color: #f2b300 !important;
}

.woocommerce-cart .coupon .button,
.woocommerce-cart .actions .button[name="update_cart"] {
    padding: 9px 16px !important;
    border-radius: 50px !important;
    background: #f3f4f6 !important;
    color: #1d2327 !important;
    font-family: inherit !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    border: 1px solid #d1d5db !important;
    cursor: pointer !important;
    transition: background .14s !important;
    white-space: nowrap !important;
}
.woocommerce-cart .coupon .button:hover,
.woocommerce-cart .actions .button[name="update_cart"]:hover {
    background: #e5e7eb !important;
}

/* ── Récapitulatif / Totaux ─────────────────────────────────────────────────── */

.woocommerce-cart .cart-collaterals {
    margin-top: 32px !important;
}

.woocommerce-cart .cart-collaterals .cart_totals {
    float: none !important;
    width: 100% !important;
    max-width: 420px !important;
    margin-left: auto !important;
}

.woocommerce-cart .cart_totals h2 {
    font-size: 13px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: .08em !important;
    color: #1d2327 !important;
    margin-bottom: 14px !important;
}

.woocommerce-cart .cart_totals table.shop_table {
    border: 1px solid #e5e7eb !important;
    border-radius: 10px !important;
    overflow: hidden !important;
    width: 100% !important;
}

.woocommerce-cart .cart_totals table.shop_table th,
.woocommerce-cart .cart_totals table.shop_table td {
    padding: 12px 16px !important;
    border-bottom: 1px solid #f3f4f6 !important;
    font-size: 14px !important;
    color: #1d2327 !important;
    background: #fff !important;
}

.woocommerce-cart .cart_totals table.shop_table th {
    font-weight: 600 !important;
    color: #6b7280 !important;
    white-space: nowrap !important;
    width: 40% !important;
}

.woocommerce-cart .cart_totals .order-total th,
.woocommerce-cart .cart_totals .order-total td {
    font-weight: 700 !important;
    color: #1d2327 !important;
    border-bottom: none !important;
    font-size: 15px !important;
}

/* ── Bouton "Passer la commande" ────────────────────────────────────────────── */

.woocommerce-cart .wc-proceed-to-checkout {
    margin-top: 14px !important;
}

.woocommerce-cart .wc-proceed-to-checkout .checkout-button {
    display: block !important;
    width: 100% !important;
    padding: 14px 24px !important;
    border-radius: 50px !important;
    font-family: inherit !important;
    font-weight: 700 !important;
    font-size: 15px !important;
    text-align: center !important;
    background: #f2b300 !important;
    color: #1d2327 !important;
    border: none !important;
    cursor: pointer !important;
    text-decoration: none !important;
    transition: background .18s, color .18s !important;
    text-transform: uppercase !important;
    letter-spacing: .05em !important;
}
.woocommerce-cart .wc-proceed-to-checkout .checkout-button:hover {
    background: #1d2327 !important;
    color: #f2b300 !important;
}

/* ==========================================================================
   Panier — MOBILE (≤ 767px)
   ========================================================================== */

@media (max-width: 767px) {

    /* Masquer les en-têtes de colonnes */
    .woocommerce-cart .woocommerce-cart-form table.shop_table thead {
        display: none !important;
    }

    /* Table et tbody → blocs */
    .woocommerce-cart .woocommerce-cart-form table.shop_table,
    .woocommerce-cart .woocommerce-cart-form table.shop_table tbody {
        display: block !important;
        width: 100% !important;
    }

    /*
     * Page Panier Mobile : Pilotée par templates.css
     * Nettoyage des resets et sécurisation des actions.
     */
    .woocommerce-cart .shop_table tr.cart_item td {
        border: none !important;
        background: transparent !important;
        padding: 0 !important;
    }

    .woocommerce-cart .shop_table .cart_item td::before {
        display: none !important;
    }

    /* ── Actions coupon en colonne ── */
    .woocommerce-cart .woocommerce-cart-form .actions {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
    }
    .woocommerce-cart .woocommerce-cart-form .coupon {
        flex-direction: column !important;
        flex: none !important;
        min-width: 0 !important;
    }
    .woocommerce-cart .coupon input#coupon_code {
        width: 100% !important;
        box-sizing: border-box !important;
    }
    .woocommerce-cart .coupon .button,
    .woocommerce-cart .actions .button[name="update_cart"] {
        width: 100% !important;
        text-align: center !important;
        box-sizing: border-box !important;
    }

    /* ── Totaux pleine largeur ── */
    .woocommerce-cart .cart-collaterals .cart_totals {
        max-width: 100% !important;
        margin-left: 0 !important;
    }
}

/* ==========================================================================
   Page confirmation de commande — order-received
   ========================================================================== */

/* ── Message de succès ─────────────────────────────────────────────────────── */

.woocommerce-order .woocommerce-thankyou-order-received {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    background: #f0fdf4 !important;
    border: 1.5px solid #bbf7d0 !important;
    border-radius: 12px !important;
    color: #14532d !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    padding: 16px 20px !important;
    margin-bottom: 28px !important;
}

.woocommerce-order .woocommerce-thankyou-order-received::before {
    content: '' !important;
    display: inline-flex !important;
    width: 28px !important;
    height: 28px !important;
    flex-shrink: 0 !important;
    background-color: #16a34a !important;
    border-radius: 50% !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E") !important;
    background-size: 16px !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
}

/* ── Récapitulatif commande (4 items : N°, date, email, total) ─────────────── */

ul.woocommerce-order-overview.order_details {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 0 32px !important;
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
}

ul.woocommerce-order-overview.order_details li {
    background: #fff !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 10px !important;
    padding: 14px 16px !important;
    margin: 0 !important;
    font-size: 14px !important;
    color: #1d2327 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
}

ul.woocommerce-order-overview.order_details li::before {
    display: none !important;
}

ul.woocommerce-order-overview.order_details li strong {
    display: block !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: .08em !important;
    color: #9ca3af !important;
    margin-bottom: 2px !important;
}

/* Total : accent jaune ATP */
ul.woocommerce-order-overview.order_details li.woocommerce-order-overview__total {
    border-color: #f2b300 !important;
    background: #fffbeb !important;
}

ul.woocommerce-order-overview.order_details li.woocommerce-order-overview__total strong {
    color: #b45309 !important;
}

/* ── Section "Détails de la commande" ──────────────────────────────────────── */

.woocommerce-order-details {
    margin-bottom: 32px !important;
}

.woocommerce-order-details h2,
.woocommerce-customer-details h2 {
    font-size: 16px !important;
    font-weight: 700 !important;
    color: #1d2327 !important;
    text-transform: uppercase !important;
    letter-spacing: .06em !important;
    border-bottom: 2px solid #f2b300 !important;
    padding-bottom: 8px !important;
    margin-bottom: 16px !important;
}

.woocommerce-table.order_details {
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: 14px !important;
}

.woocommerce-table.order_details thead th {
    background: #f9fafb !important;
    padding: 10px 14px !important;
    text-align: left !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: .07em !important;
    color: #6b7280 !important;
    border-bottom: 1px solid #e5e7eb !important;
}

.woocommerce-table.order_details thead th:last-child {
    text-align: right !important;
}

.woocommerce-table.order_details tbody td {
    padding: 12px 14px !important;
    border-bottom: 1px solid #f3f4f6 !important;
    color: #1d2327 !important;
    vertical-align: top !important;
}

.woocommerce-table.order_details tbody td:last-child {
    text-align: right !important;
    font-weight: 600 !important;
}

.woocommerce-table.order_details tbody .product-name a {
    color: #1d2327 !important;
    text-decoration: none !important;
    font-weight: 600 !important;
}

.woocommerce-table.order_details tbody .product-name a:hover {
    color: #f2b300 !important;
}

/* Ligne total du tableau */
.woocommerce-table.order_details tfoot tr td,
.woocommerce-table.order_details tfoot tr th {
    padding: 10px 14px !important;
    border-top: 1px solid #e5e7eb !important;
    font-size: 13px !important;
    color: #374151 !important;
}

.woocommerce-table.order_details tfoot tr:last-child td,
.woocommerce-table.order_details tfoot tr:last-child th {
    font-size: 15px !important;
    font-weight: 700 !important;
    color: #1d2327 !important;
    border-top: 2px solid #1d2327 !important;
}

.woocommerce-table.order_details tfoot tr td {
    text-align: right !important;
}

/* ── Adresse de facturation ────────────────────────────────────────────────── */

.woocommerce-customer-details address {
    background: #f9fafb !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 10px !important;
    padding: 16px 20px !important;
    font-style: normal !important;
    font-size: 14px !important;
    line-height: 1.7 !important;
    color: #374151 !important;
}

/* ── Responsive mobile ─────────────────────────────────────────────────────── */

@media (max-width: 600px) {
    ul.woocommerce-order-overview.order_details {
        grid-template-columns: 1fr !important;
    }

    .woocommerce-order .woocommerce-thankyou-order-received {
        font-size: 14px !important;
    }

    .woocommerce-table.order_details thead {
        display: none !important;
    }

    .woocommerce-table.order_details tbody td {
        display: block !important;
        padding: 8px 12px !important;
    }

    .woocommerce-table.order_details tbody td:last-child {
        text-align: left !important;
        font-weight: 700 !important;
        padding-bottom: 14px !important;
        border-bottom: 1px solid #e5e7eb !important;
    }
}

/* ==========================================================================
   Page Mon compte — navigation, tableau de bord, responsive
   ========================================================================== */

/* ── Clearfix sur le conteneur principal (floats WooCommerce) ───────────────── */

.woocommerce-account .woocommerce::after {
    content: '';
    display: table;
    clear: both;
}

/* ── Navigation latérale (desktop) ────────────────────────────────────────── */

.woocommerce-account .woocommerce-MyAccount-navigation {
    padding-right: 8px !important;
    overflow: visible !important; /* ne pas couper les chips scrollables sur mobile */
}

.woocommerce-account .woocommerce-MyAccount-navigation ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.woocommerce-account .woocommerce-MyAccount-navigation ul li {
    margin: 0 0 2px !important;
    padding: 0 !important;
}

/* Reset complet des styles Hello Elementor/WooCommerce sur les liens nav */
.woocommerce-account .woocommerce-MyAccount-navigation ul li a {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 10px 14px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: #374151 !important;
    text-decoration: none !important;
    border-radius: 8px !important;
    border: none !important;
    border-left: 3px solid transparent !important;
    background: transparent !important;
    background-color: transparent !important;
    box-shadow: none !important;
    transition: background 0.15s, color 0.15s !important;
    min-height: auto !important;
    line-height: 1.4 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
}

.woocommerce-account .woocommerce-MyAccount-navigation ul li a:hover {
    background: #f3f4f6 !important;
    color: #1d2327 !important;
    box-shadow: none !important;
}

/* Item actif */
.woocommerce-account .woocommerce-MyAccount-navigation ul li.is-active a,
.woocommerce-account .woocommerce-MyAccount-navigation ul li.is-active a:hover {
    background: #fffbeb !important;
    color: #1d2327 !important;
    font-weight: 700 !important;
    border-left-color: #f2b300 !important;
    padding-left: 11px !important;
}

/* Déconnexion — style secondaire */
.woocommerce-account .woocommerce-MyAccount-navigation ul li.woocommerce-MyAccount-navigation-link--customer-logout {
    margin-top: 12px !important;
    padding-top: 12px !important;
    border-top: 1px solid #f3f4f6 !important;
}

.woocommerce-account .woocommerce-MyAccount-navigation ul li.woocommerce-MyAccount-navigation-link--customer-logout a {
    color: #9ca3af !important;
    font-size: 13px !important;
    font-weight: 400 !important;
}

.woocommerce-account .woocommerce-MyAccount-navigation ul li.woocommerce-MyAccount-navigation-link--customer-logout a:hover {
    color: #b32d2e !important;
    background: #fef2f2 !important;
}

/* ── Dashboard — bloc de bienvenue ─────────────────────────────────────────── */

.atp-dashboard {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.atp-dashboard__welcome {
    display: flex;
    align-items: center;
    gap: 16px;
    background: linear-gradient(135deg, #1d2327 0%, #2d3a42 100%);
    border-radius: 14px;
    padding: 20px 24px;
    color: #fff;
}

.atp-dashboard__avatar {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    border-radius: 50%;
    background: #f2b300;
    color: #1d2327;
    font-size: 22px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.atp-dashboard__hello {
    font-size: 20px !important;
    font-weight: 700 !important;
    color: #fff !important;
    margin: 0 0 4px !important;
    line-height: 1.2 !important;
}

.atp-dashboard__sub {
    font-size: 13px !important;
    color: #9ca3af !important;
    margin: 0 !important;
}

/* ── Dashboard — cartes statistiques ───────────────────────────────────────── */

.atp-dashboard__stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.atp-stat-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
}

.atp-stat-card__value {
    font-size: 28px;
    font-weight: 800;
    color: #1d2327;
    line-height: 1;
}

.atp-stat-card__label {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.3;
    text-align: center;
}

/* ── Dashboard — raccourcis ─────────────────────────────────────────────────── */

.atp-dashboard__shortcuts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.atp-shortcut {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    text-decoration: none !important;
    color: #1d2327 !important;
    font-size: 14px;
    font-weight: 600;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.atp-shortcut:hover {
    border-color: #f2b300 !important;
    box-shadow: 0 2px 8px rgba(242, 179, 0, 0.15) !important;
    color: #1d2327 !important;
    text-decoration: none !important;
}

.atp-shortcut__icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    background: #f9fafb;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #f2b300;
}

.atp-shortcut:hover .atp-shortcut__icon {
    background: #fffbeb;
}

.atp-shortcut__label {
    flex: 1;
    line-height: 1.3;
}

.atp-shortcut__arrow {
    color: #9ca3af;
    font-size: 16px;
    flex-shrink: 0;
    transition: transform 0.15s, color 0.15s;
}

.atp-shortcut:hover .atp-shortcut__arrow {
    transform: translateX(3px);
    color: #f2b300;
}

/* ── Navigation mobile (< 769px) : chips horizontaux scrollables ────────────── */

@media (max-width: 768px) {

    /* ── Reset du layout flottant WooCommerce ───────────────────────────────── */

    .woocommerce-account .woocommerce-MyAccount-navigation {
        display: block !important;
        width: 100% !important;
        float: none !important;
        clear: both !important;
        overflow: visible !important;
        margin-bottom: 0 !important;
        padding-right: 0 !important;
    }

    .woocommerce-account .woocommerce-MyAccount-content {
        display: block !important;
        width: 100% !important;
        float: none !important;
        clear: both !important;
        margin-top: 20px !important;
    }

    /* ── Chips horizontaux scrollables ──────────────────────────────────────── */

    .woocommerce-account .woocommerce-MyAccount-navigation ul {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        overflow-y: visible !important;
        gap: 6px !important;
        padding: 4px 16px 8px 0 !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
    }

    .woocommerce-account .woocommerce-MyAccount-navigation ul::-webkit-scrollbar {
        display: none !important;
    }

    .woocommerce-account .woocommerce-MyAccount-navigation ul li {
        flex-shrink: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        border-top: none !important;
    }

    /* Chips */
    .woocommerce-account .woocommerce-MyAccount-navigation ul li a {
        white-space: nowrap !important;
        padding: 7px 14px !important;
        border-radius: 20px !important;
        font-size: 13px !important;
        border: 1px solid #e5e7eb !important;
        border-left: 1px solid #e5e7eb !important;
        background: #fff !important;
        gap: 0 !important;
        display: inline-flex !important;
    }

    .woocommerce-account .woocommerce-MyAccount-navigation ul li.is-active a,
    .woocommerce-account .woocommerce-MyAccount-navigation ul li.is-active a:hover {
        background: #f2b300 !important;
        border-color: #f2b300 !important;
        border-left-color: #f2b300 !important;
        color: #1d2327 !important;
        font-weight: 700 !important;
        padding-left: 14px !important;
    }

    /* Déconnexion : inline comme les autres */
    .woocommerce-account .woocommerce-MyAccount-navigation ul li.woocommerce-MyAccount-navigation-link--customer-logout {
        margin-top: 0 !important;
        padding-top: 0 !important;
        border-top: none !important;
    }

    .woocommerce-account .woocommerce-MyAccount-navigation ul li.woocommerce-MyAccount-navigation-link--customer-logout a {
        border-color: #f3f4f6 !important;
    }

    /* ── Dashboard adaptatif ─────────────────────────────────────────────────── */

    .atp-dashboard {
        gap: 16px;
    }

    .atp-dashboard__welcome {
        padding: 16px;
        border-radius: 12px;
    }

    .atp-dashboard__avatar {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }

    .atp-dashboard__hello {
        font-size: 17px !important;
    }

    /* Stats : 3 colonnes sur mobile mais plus compactes */
    .atp-dashboard__stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .atp-stat-card {
        padding: 12px 8px;
    }

    .atp-stat-card__value {
        font-size: 22px;
    }

    .atp-stat-card__label {
        font-size: 10px;
    }

    /* Raccourcis : 1 colonne sur mobile */
    .atp-dashboard__shortcuts {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .atp-shortcut {
        padding: 12px 14px;
    }

    .atp-shortcut__icon {
        width: 36px;
        height: 36px;
    }
}

/* ==========================================================================
   Widget de contact flottant — bouton + panel
   ========================================================================== */

/* ── Conteneur ──────────────────────────────────────────────────────────────── */

.atp-chat-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
    font-family: inherit;
}

/* ── Bouton déclencheur ─────────────────────────────────────────────────────── */

.atp-chat-trigger {
    width: 58px !important;
    height: 58px !important;
    border-radius: 50% !important;
    background: #f2b300 !important;
    background-color: #f2b300 !important;
    color: #1d2327 !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    cursor: pointer;
    display: flex !important;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25) !important;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    z-index: 2;
    text-decoration: none !important;
    line-height: 1 !important;
}

.atp-chat-trigger:hover,
.atp-chat-trigger:focus,
.atp-chat-trigger:active {
    background: #f2b300 !important;
    background-color: #f2b300 !important;
    color: #1d2327 !important;
    transform: scale(1.08);
    box-shadow: 0 6px 28px rgba(0, 0, 0, 0.3) !important;
}

.atp-chat-trigger:focus-visible {
    outline: 3px solid #f2b300;
    outline-offset: 3px;
}

/* Icônes : ouvert/fermé */
.atp-chat-trigger__icon-close {
    display: none;
}

.atp-chat-widget.is-open .atp-chat-trigger__icon-open {
    display: none;
}

.atp-chat-widget.is-open .atp-chat-trigger__icon-close {
    display: block;
}

/* Pulsation sur le bouton tant que non ouvert */
.atp-chat-widget:not(.is-open) .atp-chat-trigger::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid #f2b300;
    opacity: 0;
    animation: atp-pulse 2.4s ease-out 2s infinite;
}

@keyframes atp-pulse {
    0%   { transform: scale(1);    opacity: .6; }
    70%  { transform: scale(1.35); opacity: 0; }
    100% { transform: scale(1.35); opacity: 0; }
}

/* ── Panel ──────────────────────────────────────────────────────────────────── */

.atp-chat-panel {
    position: absolute;
    bottom: calc(100% + 12px);
    right: 0;
    width: 320px;
    background: #1d2327;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    transform-origin: bottom right;
    animation: atp-chat-in 0.22s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* Le hidden natif supprime l'élément — on override juste pour l'animation */
.atp-chat-panel:not([hidden]) {
    display: block;
}

@keyframes atp-chat-in {
    from { opacity: 0; transform: scale(0.88) translateY(8px); }
    to   { opacity: 1; transform: scale(1)    translateY(0); }
}

/* ── En-tête du panel ───────────────────────────────────────────────────────── */

.atp-chat-panel__header {
    background: #f2b300;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.atp-chat-header-info {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.atp-chat-header-avatar {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    background: #1d2327;
    color: #f2b300;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.atp-chat-panel__header strong {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: #1d2327;
    line-height: 1.2;
}

.atp-chat-panel__header span {
    display: block;
    font-size: 11px;
    color: rgba(29, 35, 39, 0.7);
    line-height: 1.3;
    margin-top: 1px;
}

.atp-chat-close {
    flex-shrink: 0;
    width: 28px !important;
    height: 28px !important;
    border-radius: 50% !important;
    border: none !important;
    background: rgba(29, 35, 39, 0.15) !important;
    background-color: rgba(29, 35, 39, 0.15) !important;
    color: #1d2327 !important;
    cursor: pointer;
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    transition: background 0.15s;
    line-height: 1 !important;
}

.atp-chat-close:hover,
.atp-chat-close:focus,
.atp-chat-close:active {
    background: rgba(29, 35, 39, 0.28) !important;
    background-color: rgba(29, 35, 39, 0.28) !important;
    color: #1d2327 !important;
    border: none !important;
    box-shadow: none !important;
}

/* ── Corps du panel ─────────────────────────────────────────────────────────── */

.atp-chat-panel__body {
    padding: 18px 16px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.atp-chat-question {
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #e5e7eb !important;
    margin: 0 0 6px !important;
    line-height: 1.4 !important;
}

/* Les styles du Widget Chat sont gérés par chat-widget.css */

/* ── Mobile ─────────────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
    .atp-chat-widget {
        display: block !important;
        bottom: 80px !important;
        right: 16px !important;
    }
}

/* Extra-petits écrans (320px) */
@media (max-width: 380px) {

    .atp-dashboard__stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .atp-dashboard__stats .atp-stat-card:last-child {
        grid-column: 1 / -1;
    }

    .atp-stat-card__value {
        font-size: 24px;
    }

    .atp-stat-card__label {
        font-size: 11px;
    }
}