/*
 * V1.1.1
 * Cette feuille de style est chargée UNIQUEMENT sur la page panier.
 * Elle n'est jamais chargée sur /commander/ : le checkout reste WooCommerce d'origine.
 */

/*
 * Brand-ON DTF — Panier & Checkout
 * V1.0.0
 * Esthétique uniquement.
 * IMPORTANT : aucun sélecteur ne cible le header Divi, le footer Divi,
 * le Theme Builder ou les menus globaux.
 */

body.bodtf-cart-modern,
body.bodtf-checkout-modern {
    --bodtf-purple:#431078;
    --bodtf-purple-2:#8436cf;
    --bodtf-purple-soft:#f7f1fb;
    --bodtf-purple-border:#e2d5ed;
    --bodtf-ink:#24162f;
    --bodtf-muted:#73697a;
    --bodtf-green:#2e7d32;
    --bodtf-shadow:0 14px 40px rgba(67,16,120,.08);
}

/* Zone centrale uniquement */
body.bodtf-cart-modern #main-content,
body.bodtf-checkout-modern #main-content {
    background:
      radial-gradient(circle at 12% 8%, rgba(132,54,207,.055), transparent 22%),
      linear-gradient(180deg,#fff 0%,#fcfaff 100%);
}

body.bodtf-cart-modern #main-content .container,
body.bodtf-checkout-modern #main-content .container,
body.bodtf-cart-modern #main-content .et_pb_row,
body.bodtf-checkout-modern #main-content .et_pb_row {
    width:min(94%,1380px);
    max-width:1380px;
}

/* =========================
   PANIER — Woo Blocks
   ========================= */
body.bodtf-cart-modern .wp-block-woocommerce-cart {
    margin:42px auto 56px;
}

body.bodtf-cart-modern .wc-block-cart {
    display:grid;
    grid-template-columns:minmax(0,1.65fr) minmax(320px,.75fr);
    gap:28px;
    align-items:start;
}

body.bodtf-cart-modern .wc-block-cart__main {
    margin:0 !important;
    padding:0 !important;
}

body.bodtf-cart-modern .wc-block-cart-items {
    border-collapse:separate !important;
    border-spacing:0 14px !important;
}

body.bodtf-cart-modern .wc-block-cart-items thead {
    display:none;
}

body.bodtf-cart-modern .wc-block-cart-items tbody tr {
    background:#fff;
    border:1px solid var(--bodtf-purple-border);
    border-radius:18px;
    box-shadow:var(--bodtf-shadow);
}

body.bodtf-cart-modern .wc-block-cart-items tbody tr td {
    border-top:0 !important;
    border-bottom:0 !important;
    padding:22px 18px !important;
    vertical-align:middle;
}

body.bodtf-cart-modern .wc-block-cart-item__image {
    width:120px !important;
}

body.bodtf-cart-modern .wc-block-cart-item__image img {
    border-radius:14px;
    background:#faf8fc;
    border:1px solid #eee7f2;
    padding:6px;
}

body.bodtf-cart-modern .wc-block-components-product-name {
    color:var(--bodtf-ink) !important;
    font-size:18px !important;
    line-height:1.35 !important;
    font-weight:800 !important;
    text-decoration:none !important;
}

body.bodtf-cart-modern .wc-block-components-product-price,
body.bodtf-cart-modern .wc-block-cart-item__total-price-and-sale-badge-wrapper {
    color:var(--bodtf-purple);
    font-weight:800;
}

body.bodtf-cart-modern .wc-block-components-product-metadata,
body.bodtf-cart-modern .wc-block-components-product-details {
    color:var(--bodtf-muted);
    font-size:13px;
    line-height:1.55;
}

body.bodtf-cart-modern .wc-block-components-quantity-selector {
    border:1px solid #d9cce3 !important;
    border-radius:12px !important;
    background:#fff;
    overflow:hidden;
}

body.bodtf-cart-modern .wc-block-components-quantity-selector input {
    min-height:42px;
    color:var(--bodtf-ink);
    font-weight:700;
}

body.bodtf-cart-modern .wc-block-components-quantity-selector button {
    min-width:40px;
    color:var(--bodtf-purple);
}

body.bodtf-cart-modern .wc-block-cart-item__remove-link {
    color:#a33 !important;
    font-weight:700;
    text-decoration:none !important;
    padding:7px 10px !important;
    border-radius:8px;
}
body.bodtf-cart-modern .wc-block-cart-item__remove-link:hover {
    background:#fff0f0;
}

body.bodtf-cart-modern .wc-block-cart__sidebar {
    position:sticky;
    top:24px;
    align-self:start;
    padding:24px !important;
    background:#fff;
    border:1px solid var(--bodtf-purple-border);
    border-radius:18px;
    box-shadow:var(--bodtf-shadow);
}

body.bodtf-cart-modern .wc-block-cart__totals-title {
    color:var(--bodtf-ink);
    font-size:20px !important;
    font-weight:800 !important;
    text-align:left !important;
    text-transform:none !important;
    letter-spacing:0 !important;
}

body.bodtf-cart-modern .wc-block-components-totals-wrapper {
    border-top:1px solid #eee6f2 !important;
}

body.bodtf-cart-modern .wc-block-components-totals-coupon__button,
body.bodtf-checkout-modern .wc-block-components-totals-coupon__button {
    border-radius:10px !important;
    min-height:42px;
}

body.bodtf-cart-modern .wc-block-components-button.wc-block-cart__submit-button {
    min-height:56px !important;
    border:0 !important;
    border-radius:14px !important;
    background:linear-gradient(135deg,var(--bodtf-purple),var(--bodtf-purple-2)) !important;
    color:#fff !important;
    font-size:16px !important;
    font-weight:800 !important;
    box-shadow:0 12px 24px rgba(67,16,120,.24);
    transition:transform .16s ease, box-shadow .16s ease;
}

body.bodtf-cart-modern .wc-block-components-button.wc-block-cart__submit-button:hover {
    transform:translateY(-1px);
    box-shadow:0 16px 30px rgba(67,16,120,.30);
}

body.bodtf-cart-modern .wc-block-cart__submit-container::before {
    content:"🔒 Paiement sécurisé · Livraison calculée à l’étape suivante";
    display:block;
    margin:14px 0 10px;
    padding:10px 12px;
    border-radius:10px;
    background:var(--bodtf-purple-soft);
    color:#5e4f68;
    font-size:12px;
    font-weight:650;
    line-height:1.45;
}

/* =========================
   CHECKOUT — Woo Blocks
   ========================= */
body.bodtf-checkout-modern .wp-block-woocommerce-checkout {
    margin:34px auto 58px;
}

body.bodtf-checkout-modern .wc-block-checkout {
    display:grid;
    grid-template-columns:minmax(0,1.55fr) minmax(340px,.75fr);
    gap:30px;
    align-items:start;
}

body.bodtf-checkout-modern .wc-block-checkout__main {
    margin:0 !important;
    padding:0 !important;
}

body.bodtf-checkout-modern .wc-block-checkout__sidebar {
    position:sticky;
    top:24px;
    align-self:start;
    padding:22px !important;
    background:#fff;
    border:1px solid var(--bodtf-purple-border);
    border-radius:18px;
    box-shadow:var(--bodtf-shadow);
}

body.bodtf-checkout-modern .wc-block-components-checkout-step {
    margin-bottom:18px !important;
    padding:22px 24px !important;
    background:#fff;
    border:1px solid var(--bodtf-purple-border);
    border-radius:16px;
    box-shadow:0 8px 24px rgba(67,16,120,.045);
}

body.bodtf-checkout-modern .wc-block-components-checkout-step__heading {
    margin-bottom:14px !important;
}

body.bodtf-checkout-modern .wc-block-components-checkout-step__title {
    color:var(--bodtf-ink);
    font-size:21px !important;
    font-weight:800 !important;
}

body.bodtf-checkout-modern .wc-block-components-checkout-step__description {
    color:var(--bodtf-muted);
}

body.bodtf-checkout-modern .wc-block-components-text-input input,
body.bodtf-checkout-modern .wc-block-components-address-form input,
body.bodtf-checkout-modern .wc-block-components-combobox .components-combobox-control__input,
body.bodtf-checkout-modern .wc-block-components-textarea {
    min-height:48px !important;
    border:1px solid #d8cde1 !important;
    border-radius:11px !important;
    background:#fff !important;
    box-shadow:none !important;
}

body.bodtf-checkout-modern .wc-block-components-text-input input:focus,
body.bodtf-checkout-modern .wc-block-components-address-form input:focus {
    border-color:var(--bodtf-purple-2) !important;
    box-shadow:0 0 0 3px rgba(132,54,207,.10) !important;
}

body.bodtf-checkout-modern .wc-block-components-radio-control-accordion-option {
    margin:9px 0 !important;
    border:1px solid #dfd3e8 !important;
    border-radius:13px !important;
    overflow:hidden;
    background:#fff;
}

body.bodtf-checkout-modern .wc-block-components-radio-control-accordion-option--checked-option-highlighted {
    border-color:#9b69c4 !important;
    box-shadow:0 0 0 2px rgba(132,54,207,.08);
}

body.bodtf-checkout-modern .wc-block-components-radio-control__option {
    min-height:58px;
    padding:13px 16px !important;
}

body.bodtf-checkout-modern .wc-block-components-checkout-place-order-button {
    min-height:58px !important;
    border:0 !important;
    border-radius:14px !important;
    background:linear-gradient(135deg,var(--bodtf-purple),var(--bodtf-purple-2)) !important;
    color:#fff !important;
    font-size:16px !important;
    font-weight:800 !important;
    box-shadow:0 12px 24px rgba(67,16,120,.24);
}

body.bodtf-checkout-modern .wc-block-components-checkout-place-order-button:hover {
    transform:translateY(-1px);
}

body.bodtf-checkout-modern .wc-block-components-order-summary {
    border:0 !important;
}

body.bodtf-checkout-modern .wc-block-components-order-summary__button-text {
    color:var(--bodtf-ink);
    font-weight:800;
}

body.bodtf-checkout-modern .wc-block-components-order-summary-item {
    padding:14px 0 !important;
    border-bottom:1px solid #eee6f2 !important;
}

body.bodtf-checkout-modern .wc-block-components-order-summary-item__image img {
    border-radius:10px;
    border:1px solid #eee7f2;
    background:#faf8fc;
}

body.bodtf-checkout-modern .wc-block-components-totals-item__label {
    color:#594e61;
}

body.bodtf-checkout-modern .wc-block-components-totals-footer-item {
    padding-top:16px !important;
    border-top:2px solid #e8ddf0 !important;
}

body.bodtf-checkout-modern .wc-block-components-totals-footer-item .wc-block-components-totals-item__label,
body.bodtf-checkout-modern .wc-block-components-totals-footer-item .wc-block-components-totals-item__value {
    color:var(--bodtf-ink);
    font-size:21px !important;
    font-weight:900 !important;
}

/* =========================
   PANIER CLASSIQUE fallback
   ========================= */
body.bodtf-cart-modern form.woocommerce-cart-form,
body.bodtf-cart-modern .cart-collaterals {
    background:#fff;
    border:1px solid var(--bodtf-purple-border);
    border-radius:18px;
    box-shadow:var(--bodtf-shadow);
    padding:22px;
}

body.bodtf-cart-modern table.shop_table {
    border:0 !important;
    border-collapse:separate !important;
    border-spacing:0 10px !important;
}

body.bodtf-cart-modern table.shop_table th {
    color:var(--bodtf-ink);
    font-weight:800;
}

body.bodtf-cart-modern .checkout-button,
body.bodtf-cart-modern button[name="apply_coupon"],
body.bodtf-checkout-modern #place_order {
    border:0 !important;
    border-radius:12px !important;
    background:linear-gradient(135deg,var(--bodtf-purple),var(--bodtf-purple-2)) !important;
    color:#fff !important;
    font-weight:800 !important;
}

/* =========================
   CHECKOUT CLASSIQUE fallback
   ========================= */
body.bodtf-checkout-modern form.checkout {
    display:grid;
    grid-template-columns:minmax(0,1.5fr) minmax(340px,.75fr);
    gap:28px;
}

body.bodtf-checkout-modern #customer_details,
body.bodtf-checkout-modern #order_review {
    background:#fff;
    border:1px solid var(--bodtf-purple-border);
    border-radius:18px;
    box-shadow:var(--bodtf-shadow);
    padding:22px;
}

body.bodtf-checkout-modern #order_review_heading {
    color:var(--bodtf-ink);
}

/* =========================
   Responsive
   ========================= */
@media (max-width: 1050px) {
    body.bodtf-cart-modern .wc-block-cart,
    body.bodtf-checkout-modern .wc-block-checkout,
    body.bodtf-checkout-modern form.checkout {
        grid-template-columns:1fr;
    }

    body.bodtf-cart-modern .wc-block-cart__sidebar,
    body.bodtf-checkout-modern .wc-block-checkout__sidebar {
        position:static;
        width:100%;
    }
}

@media (max-width: 760px) {
    body.bodtf-cart-modern #main-content .container,
    body.bodtf-checkout-modern #main-content .container,
    body.bodtf-cart-modern #main-content .et_pb_row,
    body.bodtf-checkout-modern #main-content .et_pb_row {
        width:min(94%,100%);
    }

    body.bodtf-cart-modern .wp-block-woocommerce-cart,
    body.bodtf-checkout-modern .wp-block-woocommerce-checkout {
        margin:20px auto 34px;
    }

    body.bodtf-cart-modern .wc-block-cart-items tbody tr {
        border-radius:14px;
    }

    body.bodtf-cart-modern .wc-block-cart-items tbody tr td {
        padding:14px 12px !important;
    }

    body.bodtf-cart-modern .wc-block-cart-item__image {
        width:84px !important;
    }

    body.bodtf-cart-modern .wc-block-components-product-name {
        font-size:16px !important;
    }

    body.bodtf-cart-modern .wc-block-cart__sidebar,
    body.bodtf-checkout-modern .wc-block-checkout__sidebar,
    body.bodtf-checkout-modern .wc-block-components-checkout-step {
        padding:16px !important;
        border-radius:14px;
    }

    body.bodtf-checkout-modern .wc-block-components-checkout-step__title {
        font-size:18px !important;
    }
}

@media (max-width: 480px) {
    body.bodtf-cart-modern .wc-block-cart-item__image {
        width:70px !important;
    }

    body.bodtf-cart-modern .wc-block-cart__sidebar,
    body.bodtf-checkout-modern .wc-block-checkout__sidebar {
        padding:14px !important;
    }

    body.bodtf-cart-modern .wc-block-components-button.wc-block-cart__submit-button,
    body.bodtf-checkout-modern .wc-block-components-checkout-place-order-button {
        width:100%;
        min-height:54px !important;
    }
}


/* ==========================================================
   V1.0.1 — Correctif largeur colonnes WooCommerce Blocks
   WooCommerce applique des largeurs/flex-basis natifs aux
   zones main/sidebar. On les neutralise uniquement ici.
   ========================================================== */

/* La zone WooCommerce elle-même doit pouvoir utiliser toute la largeur disponible */
body.bodtf-cart-modern .wp-block-woocommerce-cart,
body.bodtf-checkout-modern .wp-block-woocommerce-checkout,
body.bodtf-cart-modern .wc-block-cart,
body.bodtf-checkout-modern .wc-block-checkout {
    width:100% !important;
    max-width:none !important;
}

/* Neutralise les largeurs natives des colonnes Blocks */
body.bodtf-cart-modern .wc-block-cart__main,
body.bodtf-cart-modern .wc-block-cart__sidebar,
body.bodtf-checkout-modern .wc-block-checkout__main,
body.bodtf-checkout-modern .wc-block-checkout__sidebar {
    width:100% !important;
    max-width:none !important;
    min-width:0 !important;
    flex:initial !important;
    flex-basis:auto !important;
    margin-left:0 !important;
    margin-right:0 !important;
    box-sizing:border-box !important;
}

/* Panier : largeur équilibrée et lisible */
body.bodtf-cart-modern .wc-block-cart {
    grid-template-columns:minmax(0, 1.75fr) minmax(360px, .85fr) !important;
}

/* Checkout : formulaire principal + résumé suffisamment large */
body.bodtf-checkout-modern .wc-block-checkout {
    grid-template-columns:minmax(0, 1.55fr) minmax(390px, .85fr) !important;
}

/* Le contenu du résumé ne doit jamais se comprimer caractère par caractère */
body.bodtf-cart-modern .wc-block-cart__sidebar *,
body.bodtf-checkout-modern .wc-block-checkout__sidebar * {
    min-width:0;
    word-break:normal !important;
    overflow-wrap:normal;
}

body.bodtf-cart-modern .wc-block-cart__sidebar,
body.bodtf-checkout-modern .wc-block-checkout__sidebar {
    overflow:visible !important;
}

body.bodtf-cart-modern .wc-block-components-totals-wrapper,
body.bodtf-cart-modern .wc-block-components-totals-item,
body.bodtf-checkout-modern .wc-block-components-totals-wrapper,
body.bodtf-checkout-modern .wc-block-components-totals-item,
body.bodtf-checkout-modern .wc-block-components-order-summary {
    width:100% !important;
    max-width:none !important;
}

/* Empêche les titres et libellés du résumé de se casser verticalement */
body.bodtf-cart-modern .wc-block-cart__totals-title,
body.bodtf-cart-modern .wc-block-components-totals-item__label,
body.bodtf-checkout-modern .wc-block-components-order-summary__button-text,
body.bodtf-checkout-modern .wc-block-components-totals-item__label {
    white-space:normal !important;
    word-break:keep-all !important;
}

/* Le produit du résumé checkout doit conserver une vraie zone texte */
body.bodtf-checkout-modern .wc-block-components-order-summary-item {
    display:grid !important;
    grid-template-columns:72px minmax(0,1fr) auto !important;
    column-gap:14px !important;
    align-items:start !important;
}

body.bodtf-checkout-modern .wc-block-components-order-summary-item__image {
    width:72px !important;
    min-width:72px !important;
}

body.bodtf-checkout-modern .wc-block-components-order-summary-item__description {
    min-width:0 !important;
    width:auto !important;
}

body.bodtf-checkout-modern .wc-block-components-order-summary-item__total-price {
    white-space:nowrap !important;
}

/* Responsive : on repasse proprement sur une seule colonne */
@media (max-width:1050px) {
    body.bodtf-cart-modern .wc-block-cart,
    body.bodtf-checkout-modern .wc-block-checkout {
        grid-template-columns:1fr !important;
    }

    body.bodtf-cart-modern .wc-block-cart__sidebar,
    body.bodtf-checkout-modern .wc-block-checkout__sidebar {
        width:100% !important;
        max-width:none !important;
        position:static !important;
    }
}

@media (max-width:620px) {
    body.bodtf-checkout-modern .wc-block-components-order-summary-item {
        grid-template-columns:58px minmax(0,1fr) !important;
    }

    body.bodtf-checkout-modern .wc-block-components-order-summary-item__image {
        width:58px !important;
        min-width:58px !important;
    }

    body.bodtf-checkout-modern .wc-block-components-order-summary-item__total-price {
        grid-column:2;
        justify-self:start;
        margin-top:6px;
    }
}
