/* ===========================================
   CART — LAYOUT GLOBAL
   =========================================== */
.cart-section {
    background:var(--surface-color);
    margin-top:24px !important;
    margin-bottom:32px !important;
}

.cart-section .section-header {
    margin-bottom:8px;
}

.cart-section .section-title {
    margin-bottom:0;
}

.cart-layout {
    display:grid;
    grid-template-columns:1fr 420px;
    gap:28px;
}

.cart-left,
.cart-right { width:100%; }

/* ===========================================
   TABLE PANIER
   =========================================== */
.cart-table { border-collapse:collapse; }
.cart-table td {
    border:0;
    padding:10px 0;
}
.cart-table tbody tr:not(:last-child) td {
    border-bottom:1px solid var(--border-color);
}

/* ===========================================
   LIGNE PRODUIT
   =========================================== */
.cart-row {
    display:flex;
    gap:16px;
    padding:10px 0;
    width: 100%;
}

/* ===========================================
   IMAGE PRODUIT
   =========================================== */
.cart-thumb {
    width:96px;
    flex-shrink:0;
    aspect-ratio:var(--img-aspect,0.75);
    overflow:hidden;
    background:var(--surface-muted);
    cursor:pointer;
}
.cart-thumb img {
    width:100%;
    height:100%;
    object-fit:cover;
}

/* ===========================================
   MÉTA PRODUIT
   =========================================== */
.cart-meta {
    flex:1;
    display:flex;
    flex-direction:column;
    gap:6px;
}



.cart-item-name {
    font-family:var(--font-family-heading);
    font-size:14px;
    font-weight:600;
    line-height:1.3;
    color:var(--text-color);
}

.cart-meta-details {
    display:grid;
    row-gap:4px;
    font-size:13px;
    color:var(--text-muted);
    font-family:var(--font-family-meta);
}

.cart-variant-line {
    font-size:12px;
    color:var(--text-muted);
    font-family:var(--font-family-meta);
}

/* ===========================================
   PRIX & PROMO
   =========================================== */
.cart-price-block {
    display:flex;
    flex-direction:column;
    gap:2px;
}

.cart-unit-price {
    font-size:13px;
    font-weight:500;
    color:var(--text-color);
}

.price-meta {
    display:flex;
    align-items:center;
    gap:6px;
}

.original-price {
    font-size:.7rem;
    color:var(--danger-color);
    text-decoration:line-through;
}

.discount-flag {
    background:var(--danger-color);
    color:var(--surface-color);
    padding:.1rem .4rem;
    border-radius:4px;
    font-size:.6rem;
    text-transform:uppercase;
}

.sale-price {
    font-size:.85rem;
    font-weight:600;
    color:var(--text-color);
}

/* ===========================================
   COLONNE DROITE (QTÉ / TOTAL / ACTIONS)
   =========================================== */
.cart-right-col {
    margin-left:auto;
    display:flex;
    flex-direction:column;
    align-items:flex-end;
    gap:6px;
    justify-content: space-between;
}

.cart-qty-box {
    display:inline-flex;
    align-items:center;
    border:1px solid var(--border-color);
    height:36px;
    border-radius:4px;
    overflow:hidden;
}

.cart-qty-btn {
    width:34px;
    height:34px;
    border:0;
    background:transparent;
    font-size:16px;
    cursor:pointer;
}
.cart-qty-btn:hover { background:var(--surface-muted); }

.cart-qty-value {
    min-width:30px;
    text-align:center;
    font-size:14px;
}

.cart-line-total {
    font-size:.85rem;
    font-weight:600;
}

/* Actions */
.cart-line-actions {
    display:flex;
    align-items:center;
    gap:10px;
    margin-top: auto;
}

.cart-action-btn {
    border:0;
    background:transparent;
    padding:0;
    font-size:15px;
    cursor:pointer;
    color:var(--text-muted);
}
.cart-action-btn:hover { color:var(--text-color); }
.cart-action-btn.delete:hover { color:var(--danger-color); }

/* ===========================================
   ACTIONS PANIER
   =========================================== */
.cart-actions {
    margin-top:15px;
    font-size:13px;
}

/* ===========================================
   CHECKOUT / ADRESSES
   =========================================== */
.checkout-card {
    border:1px solid var(--secondary-color-dark);
    padding:16px;
    background:var(--surface-color);
    margin-top:12px !important;
}

.checkout-card h4 {
    font-size:16px;
    font-weight:600;
}

.checkout-card + .checkout-card { margin-top:20px; }

.front-form-alert {
    margin-bottom: 14px;
    padding: 10px 12px;
    font-size: 13px;
    border-width: 1px;
}

.field-error-text {
    margin-top: 4px;
    color: var(--danger-color);
    font-size: 12px;
    line-height: 1.35;
}

.checkout-card .form-control.is-invalid,
.checkout-card .form-select.is-invalid,
.quick-order-form-wrap .form-control.is-invalid,
.quick-order-form-wrap .form-select.is-invalid {
    border-color: var(--danger-color);
    box-shadow: 0 0 0 0.12rem rgba(220, 53, 69, 0.12);
    background-image: none;
}

.address-cards {
    border: 1px solid var(--border-color);
    cursor: pointer;
}

.address-card {
    border:1px solid var(--border-color);
    padding:10px;
    cursor:pointer;
    font-size:13px;
}
.address-card.active {
    border-color: var(--secondary-color-dark);
    background: var(--surface-muted);
}
.address-title {
    font-weight:500;
    margin-bottom:4px;
}

/* ===========================================
   CART SUMMARY
   =========================================== */
.cart-summary-card {

    background:#fff;
}

.cart-summary-box {
    border:1px solid #090909;
    padding:18px;
}

.cart-summary-row {
    display:flex;
    justify-content:space-between;
    gap:12px;
    padding:10px 0;
}
.cart-summary-row + .cart-summary-row {
    border-top: none;
}

.cart-summary-row .label,
.cart-summary-row .value {
    font-size:14px;
    white-space:nowrap;
}

.cart-summary-row .label {
    color: #6b7280;
}

.cart-summary-row .value {
    color: #111827;
}

.cart-summary-total {
    display:flex;
    justify-content:space-between;
    align-items:baseline;
    padding-top:14px;
    margin-top:8px;
    border-top:1px solid #ddd;
}
.cart-summary-total .label {
    font-size:16px;
    font-weight:600;
}
.cart-summary-total .value {
    font-size: 18px;
    font-weight:700;
}

.cart-summary-cta {
    margin-top:12px;
    padding:11px 14px;
    font-weight:600;
    border-radius:0;
}

/* ===========================================
   LIVRAISON GRATUITE
   =========================================== */
.cart-free-ship {
    padding:14px 16px;
    border-bottom:1px solid #eee;
    background:#fff;
}

.cart-free-ship-head {
    display:flex;
    align-items:center;
    gap:8px;
    font-size:13px;
}
.cart-free-ship-head.success { color:#166534; }
.cart-free-ship-head.pending { color:#1f2937; }

.cart-free-ship-bar {
    margin-top:10px;
    height:8px;
    background:#e5e7eb;
    border-radius:999px;
    overflow:hidden;
}
.cart-free-ship-bar .bar-fill {
    height:100%;
    display:block;
    background:#16a34a;
    transition:width .3s ease;
}

/* ===========================================
   RESPONSIVE
   =========================================== */
@media (max-width:991px) {
    .cart-section {
        margin-top:16px !important;
        margin-bottom:20px !important;
    }

    .cart-layout {
        grid-template-columns:1fr;
        gap:16px;
    }

    .cart-row {
        display: grid;
        grid-template-columns: 96px minmax(0, 1fr);
        gap: 12px;
        align-items: start;
    }
    .cart-thumb {
        width: 96px;
        max-width: 96px;
    }
    .cart-meta {
        min-width: 0;
    }
    .cart-side {
        grid-column: 1 / -1;
        width: 100%;
        min-width: 0;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding-top: 6px;
        border-top: 1px solid #f1f1f1;
    }
    .cart-side-top,
    .cart-side-bottom {
        flex: 0 0 auto;
    }
    .cart-right-col { align-items:flex-start; margin-left:0; }
    .cart-summary-box { padding:14px; }
    .cart-summary-row .label,
    .cart-summary-row .value { font-size:13px; }

    .checkout-card {
        padding:14px;
        margin-top:10px !important;
    }
}

@media (max-width:575px) {
    .cart-section .section-header {
        margin-bottom:4px;
    }

    .cart-section {
        padding-bottom: 96px;
    }

    .cart-thumb {
        width: 82px;
        max-width: 82px;
    }
    .cart-item-name { font-size:14px; }

    .cart-table td {
        padding:6px 0;
    }

    .cart-row {
        grid-template-columns: 82px minmax(0, 1fr) auto;
        gap:10px;
        padding:6px 0;
        align-items: start;
    }

    .cart-meta {
        gap: 5px;
        min-width: 0;
    }

    .cart-side {
        grid-column: 3;
        grid-row: 1;
        gap: 8px;
        padding-top: 0;
        border-top: 0;
        min-width: 92px;
        align-items: flex-end;
    }

    .cart-side-top {
        justify-content: flex-end;
    }

    .cart-side-bottom {
        margin-top: 2px;
        font-size: .9rem;
        text-align: right;
    }

    .cart-side .qty-control {
        width: 90px;
    }

    .cart-side-actions {
        gap: 8px;
    }

    .cart-action-btn-bar--checkout,
    .cart-action-btn-bar--update {
        display: none !important;
    }

    .cart-actions-bar {
        gap:8px;
        padding:14px 0 10px;
        margin-top:10px;
    }

    .cart-summary-box {
        padding:12px;
    }

    .cart-summary-row {
        padding:7px 0;
    }

    .cart-summary-total {
        padding-top:10px;
        margin-top:6px;
    }

    .checkout-card {
        padding:12px;
    }

    .checkout-card .mb-2,
    .checkout-card .mb-0,
    .checkout-card .address-cards,
    .checkout-card .form-label,
    .checkout-card .d-flex.justify-content-between.align-items-center.mb-1 {
        margin-bottom:8px !important;
    }

    .checkout-card textarea.form-control,
    .checkout-card input.form-control,
    .checkout-card select.form-select {
        min-height:38px;
    }

    .cart-free-ship {
        padding:12px;
    }

    .cart-summary-cta {
        position: fixed;
        left: 12px;
        right: 12px;
        bottom: 12px;
        z-index: 1050;
        margin-top: 0;
        box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
    }
}



/* Colonne droite indépendante */
.cart-side {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-end;
    min-width: 120px;
}

/* Haut : quantité */
.cart-side-top {
    display: flex;
    justify-content: flex-end;
}

/* Centre : actions */
.cart-side-actions {
    display: flex;
    gap: 10px;
}

/* Bas : total */
.cart-side-bottom {
    font-size: .9rem;
    font-weight: 600;
}

/* ===========================================
   BARRE ACTIONS PANIER
   =========================================== */
.cart-actions-bar {
    display: flex;
    justify-content: center;
    gap: 16px;
    padding: 24px 0;
    border-top: 1px solid #eee;
    margin-top: 20px;
}

.cart-action-btn-bar {
    min-width: 180px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 2px;
}

/* Mobile */
@media (max-width: 768px) {
    .cart-actions-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .cart-action-btn-bar {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .cart-action-btn-bar {
        min-width: 100%;
        padding: 8px 12px;
        font-size: 13px;
    }
}


.cart-action-btn-bar {
    min-width: 150px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.2;
    border-radius: 2px;
}
.cart-free-ship-box {
    border: 1px solid #e5f5ec;
    background: #f6fdf9;
    border-radius: 6px;
}


/* ------------------------------
   Quantité
-------------------------------- */

.qty-row{
    display:flex;
    align-items:center;
    gap:10px;
    margin-bottom:12px;
}

.qty-label{
    font-size:12px;
    color:#6b7280;
    white-space:nowrap;
}

.qty-control{
    display:flex;
    align-items:center;
    width:100px;
    height:30px;
    border:1px solid #cfd4dc;
    background:#fff;
}

.qty-btn{
    width:30px;
    height:30px;
    border:0;
    background:transparent;
    font-size:16px;
    font-weight:500;
    color:#111827;
    display:flex;
    align-items:center;
    justify-content:center;
    cursor:pointer;
}

.qty-btn:disabled{
    opacity:.4;
    cursor:not-allowed;
}

.qty-value{
    flex:1;
    text-align:center;
    font-size:12px;
    font-weight:600;
}

@media (max-width: 768px) {
    .cart-section {
        padding-bottom: 96px !important;
    }

    .cart-row {
        display: grid !important;
        grid-template-columns: 82px minmax(0, 1fr) auto !important;
        gap: 10px !important;
        padding: 6px 0 !important;
        align-items: start !important;
    }

    .cart-thumb {
        width: 82px !important;
        max-width: 82px !important;
    }

    .cart-meta {
        min-width: 0 !important;
        gap: 5px !important;
    }

    .cart-side {
        grid-column: 3 !important;
        grid-row: 1 !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-start !important;
        align-items: flex-end !important;
        min-width: 92px !important;
        width: auto !important;
        gap: 8px !important;
        padding-top: 0 !important;
        border-top: 0 !important;
    }

    .cart-side-top {
        display: flex !important;
        justify-content: flex-end !important;
    }

    .cart-side-bottom {
        margin-top: 2px !important;
        font-size: .9rem !important;
        text-align: right !important;
    }

    .cart-side .qty-control {
        width: 90px !important;
    }

    .cart-action-btn-bar--checkout,
    .cart-action-btn-bar--update {
        display: none !important;
    }

    .cart-summary-cta {
        position: fixed !important;
        left: 12px !important;
        right: 12px !important;
        bottom: 12px !important;
        z-index: 1050 !important;
        margin-top: 0 !important;
        box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18) !important;
    }
}
