/* ==========================================================================
   Panier WooCommerce - Style custom
   A enqueue dans le child theme (functions.php), APRES le style WooCommerce
   et APRES le style du thème/Elementor pour garantir la priorité en cascade.
   Utilise les classes injectées par cart.php / cart-totals.php custom.
   ========================================================================== */

:root {
    --cart-brown: #C38841;
    --cart-text: #000000;
    --cart-border: #C38841;
    --cart-border-light: #C38841;
    --cart-red: #E64947;
    --cart-green: #8CC73F;
    --cart-radius: 20px;
}

/* --------------------------------------------------------------------
   Typographie globale — !important nécessaire pour dominer la typo
   globale d'Elementor (Site Settings > Typography s'applique souvent
   avec une spécificité élevée sur body/h1-h6/p).
   -------------------------------------------------------------------- */

.wc-custom-cart-layout,
.wc-custom-cart-layout *,
.wc-custom-totals-card,
.wc-custom-totals-card * {
    font-family: "Laca", Sans-serif !important;
    color: var(--cart-text);
    font-size: 16px;
    font-weight: 400;
    line-height: normal;
    box-sizing: border-box;
}

/* --------------------------------------------------------------------
   Layout général
   -------------------------------------------------------------------- */

.wc-custom-cart-layout {
    display: flex;
    align-items: flex-start;
    gap: 22px;
    max-width: 1105px;
    margin: 0 auto;
    align-items: center;
}

.wc-custom-cart-products {
    flex: 1 1 auto;
    min-width: 0;
}

.wc-custom-cart-sidebar {
    flex: 0 0 354px;
    width: 354px;
}



/* --------------------------------------------------------------------
   Table produits — override des styles par défaut WooCommerce
   (bordures, padding, largeur d'image imposées par woocommerce.css)
   -------------------------------------------------------------------- */

.woocommerce table.shop_table.cart.woocommerce-cart-form__contents {
    width: 100%;
    border-collapse: collapse;
    border: none;
    margin: 0;
}

.woocommerce table.cart th,
.woocommerce table.cart td {
    border: none;
    padding: 0;
    background: transparent !important;
}

table.cart.woocommerce-cart-form__contents thead th {
    text-align: left;
    text-transform: uppercase;
    font-size: 16px !important;
    font-weight: 600 !important;
    padding: 0 8px 16px !important;
    border-bottom: 1px solid var(--cart-border-light) !important;
    border-block-start: none !important;
    color: var(--cart-brown) !important;
}

table.cart.woocommerce-cart-form__contents thead th.product-price {
    text-align: center;
}

table.cart.woocommerce-cart-form__contents thead th.product-quantity {
    text-align: center;
}

table.cart.woocommerce-cart-form__contents thead th.product-subtotal {
    text-align: right;
}

table.cart.woocommerce-cart-form__contents tbody tr.woocommerce-cart-form__cart-item {
    border-bottom: 1px solid var(--cart-border-light);
}

table.cart.woocommerce-cart-form__contents td {
    padding: 18px 8px !important;
    vertical-align: middle;
}

table.cart.woocommerce-cart-form__contents td.actions {
    padding-bottom: 0 !important;
}

td.product-price {
    text-align: center;
    font-weight: 600;
}

td.product-quantity {
    text-align: center;
}

td.product-subtotal,
td.product-subtotal bdi,
td.product-subtotal bdi .woocommerce-Price-currencySymbol {
    text-align: right;
    font-weight: 400;
}

/* Nom produit : croix + image + titre alignés sur une ligne */

td.product-name {
    display: flex;
    align-items: center;
    gap: 14px;
}

/* Bouton supprimer (x) — override du style rouge par défaut de WooCommerce */

.woocommerce a.remove.wc-custom-remove {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    border-radius: 50% !important;
    border: 1.5px solid var(--cart-brown) !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    color: var(--cart-brown) !important;
    background: transparent !important;
    text-decoration: none;
}

.woocommerce a.remove.wc-custom-remove:hover {
    background: var(--cart-brown) !important;
    color: #fff !important;
}

/* Image produit — !important car woocommerce.css force souvent
   une largeur fixe sur les images du panier */

.wc-custom-thumb,
.wc-custom-thumb a {
    flex: 0 0 auto;
    display: block;
    width: 79px;
    height: 79px;
}

.wc-custom-thumb img,
td.product-name img {
    width: 79px !important;
    height: 79px !important;
    max-width: 79px !important;
    object-fit: cover;
    border-radius: 10px;
    display: block;
}

.wc-custom-product-name {
    font-weight: 600;
    width: 100%;
}

.wc-custom-product-name a {
    color: var(--cart-text);
    text-decoration: none;
    font-weight: 400;
}

/* --------------------------------------------------------------------
   Quantité — override du input[type=number] par défaut du thème
   -------------------------------------------------------------------- */

td.product-quantity .quantity {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--cart-border) !important;
    border-radius: 3px !important;
    overflow: hidden;
    background: #fff;
}

td.product-quantity input.qty {
    width: 38px !important;
    max-width: 44px !important;
    text-align: center;
    border: none !important;
    background: transparent !important;
    font-weight: 400 !important;
    color: var(--cart-text) !important;
    padding: 8px 0 !important;
    border-radius: 3px !important;
}

.cs-qty-btn {
    border: none;
    color: var(--cart-brown) !important;
}

.cs-qty-btn:hover,
.cs-qty-btn:focus,
.cs-qty-btn:focus-visible {
    background: transparent;
    color: var(--cart-brown) !important;
    outline: none;

}

td.product-quantity input.qty::-webkit-outer-spin-button,
td.product-quantity input.qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* --------------------------------------------------------------------
   Ligne coupon + actualiser — sur la même ligne (flex, natif WC)
   -------------------------------------------------------------------- */

.wc-custom-actions-row td {
    padding-top: 24px !important;
}

.wc-custom-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.wc-custom-actions .coupon {
    display: flex;
    align-items: center;
    gap: 0px;
    flex: 1 1 auto;
}

.wc-custom-actions .coupon input#coupon_code {
    border: 1px solid var(--cart-border) !important;
    border-radius: var(--cart-radius) !important;
    padding: 8px 18px !important;
    font-weight: 400 !important;
    min-width: 180px;
    background: #fff !important;
    box-shadow: none !important;
    min-height: 40px;
    color: var(--cart-brown);
}
.wc-custom-actions .coupon input#coupon_code::placeholder{
    color: var(--cart-brown);
}
.woocommerce .wc-custom-actions .coupon button.button {
    border: 2px solid var(--cart-green) !important;
    border-radius: var(--cart-radius) !important;
    background: var(--cart-green) !important;
    color: white !important;
    padding: 8px 22px !important;
    font-weight: 700 !important;
    font-size: 16px;
    letter-spacing: 0.4px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s ease, color 0.2s ease;
    margin-left: -35px;
    min-height: 40px;
    font-family: "Laca", Sans-serif !important;
    text-transform: uppercase;

}

.woocommerce .wc-custom-actions .coupon button.button:hover {
    background: #008D36 !important;
    border: 2px solid #008D36 !important;
    color: #fff !important;
}

/* Bouton Actualiser — état neutre/discret comme sur la maquette
   (WooCommerce ne le désactive pas nativement tant qu'il n'y a pas
   eu de changement de quantité ; on le rend visuellement secondaire) */
table.cart.woocommerce-cart-form__contents td.actions{
    padding-top: 35px !important;
}
.woocommerce .wc-custom-actions button.wc-custom-update {
    flex: 0 0 auto;
    margin-left: auto;
    background: transparent !important;
    border: none !important;
    color: #DEAF76 !important;
    font-weight: 400 !important;
    padding: 10px 4px !important;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    opacity: 1;
}

.woocommerce .wc-custom-actions button.wc-custom-update::before {
    content: "";
    width: 14px;
    height: 14px;
    display: inline-block;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M17.65 6.35A7.95 7.95 0 0012 4a8 8 0 108 8h-2a6 6 0 11-1.76-4.24L13 11h7V4l-2.35 2.35z'/%3E%3C/svg%3E") center/contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M17.65 6.35A7.95 7.95 0 0012 4a8 8 0 108 8h-2a6 6 0 11-1.76-4.24L13 11h7V4l-2.35 2.35z'/%3E%3C/svg%3E") center/contain no-repeat;
}

.wc-custom-continue-shopping {
    margin-top: 52px;
    text-align: left;
    margin-bottom: 0;
}

.wc-custom-continue-shopping a {
    color: var(--cart-brown);
    text-decoration: underline;
    font-weight: 500;
    text-transform: uppercase;
}

/* --------------------------------------------------------------------
   Carte "Total panier"
   -------------------------------------------------------------------- */

.wc-custom-totals-card {
    border-radius: 20px;
    background: #FFF4E5;
    padding: 28px;
    width: 100% !important;
    float: none !important;
    margin-top: -72px;
}

.wc-custom-totals-title {
    font-family: "Laca", Sans-serif !important;
    font-size: 24px !important;
    font-weight: 700 !important;
    margin: 0 0 40px;
    color:var(--cart-brown);
    text-transform: uppercase;
}

.wc-custom-subtotal-row,
.wc-custom-coupon-row,
.wc-custom-fee-row,
.wc-custom-tax-row,
.wc-custom-total-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 8px;
    flex-direction: column;
}

.wc-custom-subtotal-row {
    margin-top: 15px;
    margin-bottom: 17px;
}

.wc-custom-subtotal-row bdi {
    font-weight: 600;
}

.wc-custom-sep {
    border: none;
    border-top: 1px solid var(--cart-border-light);
    margin: 16px 0;
}

.wc-custom-shipping-block {
    margin: 20px 0;
}

.wc-custom-shipping-block .wc-custom-shipping-label {
    margin: 0px;
    font-weight: 400;
}

.wc-custom-free-shipping-notice,
.wc-custom-free-shipping-notice bdi,
.wc-custom-free-shipping-notice .woocommerce-Price-currencySymbol {
    color: var(--cart-red) !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    margin: 7px 0;
}

/* Radio expédition — reconstruits en CSS pur pour un rendu identique
   sur tous navigateurs (appearance:none + pseudo-élément) */

.wc-custom-shipping-methods ul#shipping_method {
    list-style: none;
    margin: 0;
    padding: 0;
}

.wc-custom-shipping-methods ul#shipping_method li {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.wc-custom-shipping-methods ul#shipping_method input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--cart-brown) !important;
    border-radius: 50%;
    margin: 0 10px 0 0 !important;
    position: relative;
    flex: 0 0 auto;
    cursor: pointer;
}
.shipping-method-description{
    margin-bottom: 0;
}
.wc-custom-shipping-methods ul#shipping_method input[type="radio"]:checked::after {
    content: "";
    position: absolute;
    inset: 3px;
    background: var(--cart-brown);
    border-radius: 50%;
}

.wc-custom-shipping-methods ul#shipping_method label {
    font-weight: 400;
    cursor: pointer;
}

.wc-custom-shipping-methods ul#shipping_method label {
    flex: 1 1 0;
    min-width: 0;
}

.wc-custom-shipping-methods .shipping-method-description {
    flex-basis: 100%;
    padding-left: 28px;
}

/* Total */

.wc-custom-total-row .label {
    margin-top: 12px;
    font-size: 16px !important;
    font-weight: 600 !important;
}

.wc-custom-total-row .value {
    text-align: right;
}

.wc-custom-total-row bdi,
.wc-custom-total-row bdi .woocommerce-Price-currencySymbol {
    font-size: 16px !important;
    font-weight: 600 !important;
}

/* WooCommerce enveloppe la mention "(dont X TVA)" dans <small class="includes_tax"> */
.wc-custom-total-row .includes_tax,
.wc-custom-total-row .includes_tax .woocommerce-Price-amount,
.wc-custom-total-row .includes_tax .woocommerce-Price-amount .woocommerce-Price-currencySymbol {
    font-weight: 600 !important;
}

/* --------------------------------------------------------------------
   Bouton "Valider la commande" — style outline, pas rempli
   -------------------------------------------------------------------- */

.wc-proceed-to-checkout {
    margin-top: 12px;
}

.woocommerce .wc-proceed-to-checkout a.checkout-button {
    display: inline-block;
    width: auto;
    text-align: center;
    background: var(--cart-green)  !important;
    border: 1.5px solid var(--cart-green) !important;
    color: white !important;
    border-radius: var(--cart-radius) !important;
    padding: 8px 25px !important;
    font-weight: 700 !important;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
    font-family: "Laca", Sans-serif !important;
    margin-bottom: 0;
    border-radius: 20px !important;
    font-size: 16px;
    text-transform: uppercase;
}

.woocommerce .wc-proceed-to-checkout a.checkout-button:hover {
    background: #008D36 !important;
    border: 1.5px solid #008D36 !important;
    color: #fff !important;
}

.woocommerce-cart .wc-custom-thumb {
    flex: 0 0 auto;
    width: 80px;
    height: 105px;
    padding: 12px;
    background: #FFF4EA;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.woocommerce-cart .wc-custom-thumb a {
    display: flex;
    width: 100%;
    height: 100%;
}

.woocommerce-cart .wc-custom-thumb img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain;      /* image entière, sans recadrage */
    mix-blend-mode: multiply; /* le fond blanc de l'image se fond dans le beige */
}

@media (max-width: 767px) {
    .woocommerce-cart .wc-custom-thumb {
        width: 80px;
        height: 105px;
        padding: 8px;
    }
}

@media (max-width: 1024px) {
    .wc-custom-cart-layout {
        flex-direction: column;
        align-items: stretch;
    }

    .wc-custom-cart-products {
        width: 100%;
    }
    
    .wc-custom-cart-sidebar {
        flex: 0 0 auto;
        width: 100%;
    }
    
    .step-guide {
        text-align: center
    }
}

@media (max-width:880px) {
    .step-guide {
        gap: 0;
    }

    .step-guide__line {
        width: 150px;
    }
}

@media (max-width: 767px) {
    .wc-custom-cart-layout {
        max-width: 447px;
    }

    table.cart.woocommerce-cart-form__contents td {
        padding: 10px 8px !important;
    }

    table.cart.woocommerce-cart-form__contents td.product-quantity {
        line-height: 40px;
    }

    .woocommerce table.shop_table_responsive tr td::before,
    .woocommerce-page table.shop_table_responsive tr td::before {
        content: attr(data-title) "\202f: ";
    }

    /* Ligne produit : étiquette en haut, puis image | nom | croix */
    .woocommerce table.shop_table_responsive tr td.product-name {
        display: grid !important;
        grid-template-columns: 79px 1fr auto;
        align-items: center;
        gap: 8px 14px;
        text-align: left !important;
    }

    .woocommerce table.shop_table_responsive tr td.product-name::before {
        grid-column: 1 / -1;
        grid-row: 1;
    }

    td.product-name .wc-custom-thumb {
        grid-column: 1;
        grid-row: 2;
    }

    td.product-name .wc-custom-product-name {
        grid-column: 2;
        grid-row: 2;
        width: auto;
        margin-top: 0;
    }

    .woocommerce td.product-name a.remove.wc-custom-remove {
        grid-column: 3;
        grid-row: 2;
        float: none;
    }

    /* Code promo : champ et bouton l'un sous l'autre, sur toute la largeur */
    .wc-custom-actions .coupon {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        width: 100%;
    }

    .wc-custom-actions .coupon input#coupon_code {
        min-width: 0;
        width: 100% !important;
    }

    .woocommerce .wc-custom-actions .coupon button.button {
        float: none !important;
        width: 100% !important;
        margin-left: 0 !important;
    }
}

@media (max-width: 694px) {
    .step-guide {
        gap: 4px;
        padding: 20px 0;
        margin-bottom: 40px;
    }

    .step-guide__item {
        flex: 0 0 auto;
        width: 72px;
    }

    .step-guide__label {
        font-size: 13px;
        line-height: 15px;
        text-align: center;
    }

    .step-guide__line {
        flex: 1 1 0;
        width: auto;
        min-width: 12px;
    }
}

@media (max-width: 425px) {

    .wc-custom-cart-sidebar {
        width: 100%;
        flex-basis: auto;
    }

    .wc-custom-product-name {
        text-align: left;
        margin-top: 7px;
    }
}