/*
================================================================
 STYLES POUR LA PAGE PANIER PERSONNALISÉE
================================================================
*/

/* -- 1. Variables de design (Identiques à la page checkout) -- */
:root {
    --theme-primary-color: #000F85;
    --theme-primary-hover: #0a0d6b;
    --theme-text-color: #1a1a1a;
    --theme-text-light: #6b7280;
    --theme-background-color: #f4f5f7;
    --theme-surface-color: #ffffff;
    --theme-border-color: #e5e7eb;
    --theme-border-radius: 8px;
    --theme-box-shadow: 0 4px 25px rgba(0, 0, 0, 0.07);
    --theme-font-family: inherit;
}

/* -- 2. Mise en page générale -- */
body.page-template-panier-personnalise {
    background-color: var(--theme-background-color);
}

.woocommerce-custom-cart-wrapper {
    padding: 4rem 0;
    font-family: var(--theme-font-family);
}

/* On utilise Flexbox pour créer la disposition en 2 colonnes */
.woocommerce-cart .woocommerce {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
}

.woocommerce-cart .woocommerce-cart-form {
    flex: 2; /* Prend 2/3 de l'espace */
    min-width: 320px;
}

.woocommerce-cart .cart-collaterals {
    flex: 1; /* Prend 1/3 de l'espace */
    min-width: 300px;
}

/* -- 3. Le tableau des articles -- */
.woocommerce table.shop_table {
    border: none;
    border-radius: var(--theme-border-radius);
    box-shadow: var(--theme-box-shadow);
    background: var(--theme-surface-color);
    padding: 1.5rem;
    border-collapse: separate;
    border-spacing: 0;
}

.woocommerce table.shop_table th {
    border: none;
    text-transform: uppercase;
    font-size: 0.8em;
    color: var(--theme-text-light);
    padding: 1em 1.5em;
    border-bottom: 1px solid var(--theme-border-color);
}

.woocommerce table.shop_table td {
    border: none;
    padding: 1.5em;
    vertical-align: middle;
    border-bottom: 1px solid var(--theme-border-color);
}
.woocommerce table.shop_table tbody tr:last-child td {
    border-bottom: none;
}
.woocommerce table.shop_table .product-thumbnail img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: var(--theme-border-radius);
}

.woocommerce .actions .coupon .input-text {
    border-color: var(--theme-border-color);
    border-radius: var(--theme-border-radius);
}
.woocommerce .actions .coupon .button,
.woocommerce .actions > .button {
    background-color: transparent;
    color: var(--theme-primary-color);
    border: 1px solid var(--theme-primary-color);
    border-radius: var(--theme-border-radius);
    padding: 0.8em 1.5em;
    font-weight: 600;
    transition: all 0.3s;
}
.woocommerce .actions .coupon .button:hover,
.woocommerce .actions > .button:hover {
    background-color: var(--theme-primary-color);
    color: #fff;
}

/* -- 4. La section "Total du panier" -- */
.woocommerce .cart_totals {
    background: var(--theme-surface-color);
    border-radius: var(--theme-border-radius);
    padding: 2rem;
    box-shadow: var(--theme-box-shadow);
    position: sticky;
    top: 40px;
}
.woocommerce .cart_totals h2 {
    margin-top: 0;
    font-size: 1.5em;
}

/* Bouton "Valider la commande" */
.woocommerce .wc-proceed-to-checkout a.checkout-button {
    background: var(--theme-primary-color);
    color: #fff !important;
    text-align: center;
    display: block;
    width: 100%;
    padding: 1em;
    font-size: 1.1em;
    font-weight: 700;
    border-radius: var(--theme-border-radius);
    text-decoration: none;
    transition: all 0.3s ease;
}
.woocommerce .wc-proceed-to-checkout a.checkout-button:hover {
    background: var(--theme-primary-hover);
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(0, 15, 133, 0.2);
}

/* -- 5. Responsive pour Mobile -- */
@media (max-width: 991px) {
    .woocommerce-cart .woocommerce {
        flex-direction: column;
    }
    .woocommerce .cart_totals {
        position: static;
    }
}
@media (max-width: 768px) {
    .woocommerce-custom-cart-wrapper { padding: 2rem 0; }
    .woocommerce table.shop_table thead { display: none; }
    .woocommerce table.shop_table tbody tr { display: block; margin-bottom: 2rem; padding-bottom: 1rem; border-bottom: 2px solid var(--theme-border-color); }
    .woocommerce table.shop_table tbody tr:last-child { border-bottom: none; }
    .woocommerce table.shop_table td { display: block; text-align: right !important; padding: 0.5em 0; border: none; }
    .woocommerce table.shop_table td::before { content: attr(data-title); float: left; font-weight: 600; color: var(--theme-text-light); }
    .woocommerce table.shop_table td.product-thumbnail,
    .woocommerce table.shop_table td.product-remove { text-align: center !important; }
    .woocommerce table.shop_table td.product-thumbnail::before,
    .woocommerce table.shop_table td.product-remove::before { display: none; }
}