/* assets/css/panier.css */

.cart-page-section {
    padding-top: 8rem;
    padding-bottom: 5rem;
    min-height: 70vh;
}

/* État vide */
.empty-cart-state {
    padding: 4rem 2rem;
    text-align: center;
    border-radius: 2rem;
    max-width: 600px;
    margin: 0 auto;
}
.empty-cart-icon {
    font-size: 4rem;
    color: var(--cpw-muted);
    opacity: 0.5;
    margin-bottom: 1.5rem;
}
.empty-cart-state h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--cpw-text);
    margin-bottom: 0.5rem;
}
.empty-cart-state p {
    color: var(--cpw-text);
    opacity: 0.7;
}

/* Disposition */
.cart-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    align-items: start;
}

/* Liste des articles */
.cart-items-list {
    border-radius: 1.5rem;
    overflow: hidden;
    padding: 1rem;
}
.cart-list-header {
    display: none; /* Masqué sur mobile, affiché en grid sur desktop */
    padding: 1rem;
    border-bottom: 1px solid var(--glass-border);
    font-size: 0.8125rem;
    font-weight: 800;
    color: var(--cpw-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.cart-item {
    display: flex;
    flex-direction: column;
    padding: 1.5rem 1rem;
    border-bottom: 1px solid var(--glass-border);
    gap: 1rem;
    position: relative;
}
.cart-item:last-child {
    border-bottom: none;
}

/* Colonnes internes */
.col-produit {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.item-image-wrapper {
    width: 80px;
    height: 80px;
    border-radius: 1rem;
    overflow: hidden;
    background-color: var(--hover-bg);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.item-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.item-img-placeholder {
    font-size: 2rem;
    color: var(--cpw-muted);
    opacity: 0.3;
}
.item-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--cpw-text);
    margin: 0;
    line-height: 1.4;
}

/* Affichage Mobile des labels (Prix:, Qté:, etc.) */
.mobile-label {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--cpw-muted);
    width: 60px;
    margin-right: 0.5rem;
}
.col-prix, .col-total {
    font-size: 0.9375rem;
    color: var(--cpw-text);
    display: flex;
    align-items: center;
}
.font-bold {
    font-weight: 800;
}

/* Contrôle de quantité */
.qty-controls {
    display: inline-flex;
    align-items: center;
    background-color: var(--hover-bg);
    border: 1px solid var(--glass-border);
    border-radius: 99px;
    overflow: hidden;
    height: 36px;
}
.btn-qty-update {
    width: 36px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--cpw-text);
    cursor: pointer;
    font-size: 0.75rem;
    transition: background-color 0.2s;
}
.btn-qty-update:hover {
    background-color: rgba(0, 123, 255, 0.1);
    color: var(--cpw-primary);
}
.qty-input {
    width: 40px;
    height: 100%;
    text-align: center;
    border: none;
    background: transparent;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--cpw-text);
    padding: 0;
    -moz-appearance: textfield;
}
.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Bouton suppression */
.col-action {
    position: absolute;
    top: 1.5rem;
    right: 1rem;
}
.btn-remove-item {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid transparent;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}
.btn-remove-item:hover {
    background: #ef4444;
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.3);
}

/* Colonne Résumé */
.cart-summary-box {
    padding: 2rem;
    border-radius: 1.5rem;
    position: sticky;
    top: 6rem;
}
.summary-title {
    font-size: 1.125rem;
    font-weight: 800;
    color: var(--cpw-text);
    margin-bottom: 1.5rem;
}
.summary-line {
    display: flex;
    justify-content: space-between;
    font-size: 0.9375rem;
    color: var(--cpw-text);
    margin-bottom: 1rem;
}
.summary-divider {
    height: 1px;
    background: var(--glass-border);
    margin: 1.5rem 0;
}
.summary-total {
    font-size: 1.125rem;
    font-weight: 800;
    margin-bottom: 0;
}
.text-primary {
    color: var(--cpw-primary);
}
.text-muted {
    color: var(--cpw-muted);
}

/* Loader Overlay */
.cart-overlay-loader {
    position: fixed;
    inset: 0;
    background: var(--glass-bg);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}
.cart-overlay-loader.active {
    display: flex;
}
.spinner-border {
    width: 3rem;
    height: 3rem;
    border: 4px solid rgba(0, 123, 255, 0.2);
    border-right-color: var(--cpw-primary);
    border-radius: 50%;
    animation: spinner-border .75s linear infinite;
}
@keyframes spinner-border {
    to { transform: rotate(360deg); }
}

/* RESPONSIVE DESKTOP */
@media (min-width: 992px) {
    .cart-layout {
        grid-template-columns: 2fr 1fr;
    }
    .cart-list-header {
        display: grid;
        grid-template-columns: 3fr 1.5fr 1.5fr 1.5fr 0.5fr;
        align-items: center;
    }
    .cart-item {
        flex-direction: row;
        display: grid;
        grid-template-columns: 3fr 1.5fr 1.5fr 1.5fr 0.5fr;
        align-items: center;
    }
    .mobile-label {
        display: none;
    }
    .col-action {
        position: static;
        display: flex;
        justify-content: flex-end;
    }
}

/* ================================================
   AMÉLIORATIONS VISUELLES PANIER
   ================================================ */

/* En-tête de section plus compact et épuré */
.cart-page-section .section-header {
    margin-bottom: 2rem;
}
.cart-page-section .section-title {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}
.cart-page-section .section-subtitle {
    font-size: 0.875rem;
    color: var(--cpw-muted);
    margin-top: 0.25rem;
}

/* Compteur d'articles dans le sous-titre */
.cart-page-section .section-subtitle::before {
    content: attr(data-count);
}

/* En-tête de colonnes visible et soigné */
.cart-list-header {
    background: var(--hover-bg);
    border-radius: 0.75rem;
    margin-bottom: 0.5rem;
    border-bottom: none;
    padding: 0.75rem 1.25rem;
}

/* Chaque ligne article */
.cart-item {
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    border: 1px solid transparent;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    margin-bottom: 0.25rem;
}
.cart-item:hover {
    background-color: var(--hover-bg);
    border-color: var(--glass-border);
}
.cart-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

/* Image produit plus soignée */
.item-image-wrapper {
    width: 68px;
    height: 68px;
    border-radius: 0.75rem;
    border: 1px solid var(--glass-border);
    background: var(--hover-bg);
}

/* Nom du produit */
.item-name {
    font-size: 0.9375rem;
    font-weight: 700;
    line-height: 1.4;
    color: var(--cpw-text);
}

/* Prix en muted pour moins d'encombrement visuel */
.col-prix {
    color: var(--cpw-muted);
    font-size: 0.875rem;
}

/* Contrôle quantité plus compact */
.qty-controls {
    height: 34px;
    border-radius: 99px;
}
.btn-qty-update {
    width: 32px;
    font-size: 0.6875rem;
}
.qty-input {
    width: 36px;
    font-size: 0.875rem;
}

/* Sous-total mis en valeur */
.col-total {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--cpw-text);
}

/* Bouton supprimer plus discret */
.btn-remove-item {
    width: 30px;
    height: 30px;
    background: transparent;
    border: 1px solid var(--glass-border);
    font-size: 0.6875rem;
    opacity: 0.6;
    transition: all 0.25s ease;
}
.cart-item:hover .btn-remove-item {
    opacity: 1;
}
.btn-remove-item:hover {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
    box-shadow: none;
}

/* Boite résumé */
.cart-summary-box {
    padding: 1.75rem;
}
.summary-title {
    font-size: 1rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--glass-border);
}
.summary-line {
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
}
.summary-line.text-muted span:last-child {
    font-size: 0.8125rem;
    text-align: right;
    max-width: 130px;
    line-height: 1.4;
}
.summary-total {
    font-size: 1.0625rem;
}

/* Champ code promo */
.promo-field {
    display: flex;
    gap: 0.5rem;
    margin: 1.25rem 0;
}
.promo-input {
    flex: 1;
    padding: 0.625rem 1rem;
    border-radius: 99px;
    border: 1px solid var(--glass-border);
    background: var(--hover-bg);
    color: var(--cpw-text);
    font-size: 0.875rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}
.promo-input:focus {
    border-color: var(--cpw-primary);
}
.promo-input::placeholder {
    color: var(--cpw-muted);
    opacity: 0.7;
}
.btn-promo {
    padding: 0.625rem 1.125rem;
    border-radius: 99px;
    background: var(--hover-bg);
    border: 1px solid var(--glass-border);
    color: var(--cpw-text);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}
.btn-promo:hover {
    background: rgba(26, 111, 255, 0.08);
    border-color: rgba(26, 111, 255, 0.25);
    color: var(--cpw-primary);
}

/* Badges paiement sécurisé */
.secure-checkout-badges {
    padding-top: 1rem;
    border-top: 1px solid var(--glass-border);
    margin-top: 1rem !important;
}
.secure-checkout-badges .flex-center {
    justify-content: center;
    font-size: 1.375rem !important;
    gap: 0.875rem !important;
    opacity: 0.6;
}

/* Lien continuer les achats */
.back-to-shop {
    display: block;
    text-align: center;
    font-size: 0.8125rem;
    color: var(--cpw-muted);
    margin-top: 1rem;
    transition: color 0.2s;
}
.back-to-shop:hover {
    color: var(--cpw-primary);
}
.back-to-shop i {
    margin-right: 0.3rem;
    font-size: 0.75rem;
}

/* Desktop : ajustement grille header/items */
@media (min-width: 992px) {
    .cart-list-header {
        display: grid;
        grid-template-columns: 3fr 1.2fr 1.5fr 1.2fr 0.5fr;
        border-bottom: none;
    }
    .cart-item {
        grid-template-columns: 3fr 1.2fr 1.5fr 1.2fr 0.5fr;
        border-bottom: none;
    }
}

