/* assets/css/cart.css - Shopping Cart Page avec responsive mobile first comme women.css */

:root {
    --mauve: #B79AC5;
    --mauve-dark: #9B7BAA;
    --mauve-light: #E6D9F2;
    --noir: #1A1A1A;
    --or: #D4AF8C;
    --blanc-casse: #F9F7F5;
    --gris: #3E3E3E;
    --gris-light: #F5F5F5;
    --rose-pale: #FCE4EC;
    --charcoal: #2C2C2C;
    --success: #4CAF50;
    --danger: #F44336;
    --warning: #FFC107;
    --font-titre: 'Playfair Display', serif;
    --font-texte: 'Montserrat', sans-serif;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 25px rgba(0,0,0,0.15);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

/* ----- RESET SUPPLEMENTAIRE POUR MOBILE (comme women.css) ----- */
html, body {
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* ----- PAGE CART ----- */
.cart-page {
    padding: 40px 0 0;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    width: 100%;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
    box-sizing: border-box;
}

/* ----- PAGE HEADER ----- */
.page-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px 0;
}

.page-header h1 {
    font-family: var(--font-titre);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--noir);
    margin-bottom: 10px;
    position: relative;
    display: inline-block;
}

.page-header h1::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, var(--mauve), var(--mauve-dark));
    border-radius: 2px;
}

/* ----- ALERTS ----- */
.alert {
    padding: 16px 24px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-weight: 500;
    font-family: var(--font-texte);
    animation: slideIn 0.3s ease;
    transition: opacity 0.3s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.alert.success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.alert.error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

/* ----- EMPTY CART ----- */
.empty-cart {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    max-width: 500px;
    margin: 0 auto 50px;
}

.empty-cart-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.empty-cart h2 {
    font-family: var(--font-titre);
    font-size: 1.8rem;
    color: var(--noir);
    margin-bottom: 10px;
}

.empty-cart p {
    color: var(--gris);
    margin-bottom: 25px;
    font-family: var(--font-texte);
}

.btn-shop {
    display: inline-block;
    padding: 12px 30px;
    background: var(--mauve);
    color: white;
    text-decoration: none;
    border-radius: 40px;
    font-weight: 600;
    transition: all 0.3s ease;
    font-family: var(--font-texte);
}

.btn-shop:hover {
    background: var(--mauve-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* ----- CART TABLE ----- */
.cart-table {
    background: white;
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-md);
    margin-bottom: 30px;
    overflow-x: auto;
}

.cart-table table {
    width: 100%;
    border-collapse: collapse;
}

.cart-table th {
    text-align: left;
    padding: 15px 10px;
    border-bottom: 2px solid var(--gris-light);
    font-family: var(--font-texte);
    font-weight: 600;
    color: var(--gris);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.cart-table td {
    padding: 20px 10px;
    border-bottom: 1px solid var(--gris-light);
    vertical-align: middle;
}

.product-col {
    min-width: 300px;
}

.product-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.product-info img {
    width: 80px;
    height: 100px;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

.product-info h3 {
    font-family: var(--font-titre);
    font-size: 1rem;
    color: var(--noir);
    margin-bottom: 5px;
}

.price-col {
    font-family: var(--font-texte);
    font-weight: 600;
    color: var(--noir);
}

.quantity-col {
    width: 150px;
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 5px;
}

.qty-btn {
    width: 30px;
    height: 30px;
    border: 1px solid var(--gris-light);
    background: white;
    border-radius: var(--radius-sm);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.qty-btn:hover {
    background: var(--mauve);
    color: white;
    border-color: var(--mauve);
}

.qty-display {
    width: 50px;
    text-align: center;
    font-weight: 600;
    font-family: var(--font-texte);
}

.total-col {
    font-family: var(--font-texte);
    font-weight: 700;
    color: var(--mauve-dark);
}

.btn-remove {
    background: none;
    border: none;
    color: var(--gris);
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.btn-remove:hover {
    color: var(--danger);
    transform: scale(1.1);
}

/* ----- CART ACTIONS ----- */
.cart-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--gris-light);
}

.btn-clear {
    background: none;
    border: 1px solid var(--danger);
    color: var(--danger);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-texte);
}

.btn-clear:hover {
    background: var(--danger);
    color: white;
}

.btn-continue {
    color: var(--mauve);
    text-decoration: none;
    font-family: var(--font-texte);
    transition: all 0.3s ease;
}

.btn-continue:hover {
    color: var(--mauve-dark);
    transform: translateX(-3px);
}

/* ----- CART SUMMARY ----- */
.cart-summary {
    background: white;
    border-radius: var(--radius-lg);
    padding: 25px;
    box-shadow: var(--shadow-md);
    max-width: 400px;
    margin-left: auto;
}

.cart-summary h2 {
    font-family: var(--font-titre);
    font-size: 1.3rem;
    color: var(--noir);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--mauve-light);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--gris-light);
    font-family: var(--font-texte);
    color: var(--gris);
}

.summary-row.total {
    border-bottom: none;
    font-weight: 700;
    color: var(--noir);
    font-size: 1.1rem;
    padding-top: 15px;
    border-top: 2px solid var(--mauve-light);
}

.login-note {
    background: var(--mauve-light);
    padding: 15px;
    border-radius: var(--radius-md);
    margin: 20px 0;
}

.login-note p {
    color: var(--noir);
    margin-bottom: 10px;
    font-size: 0.9rem;
    font-family: var(--font-texte);
}

.btn-login {
    display: block;
    text-align: center;
    background: var(--noir);
    color: white;
    text-decoration: none;
    padding: 10px;
    border-radius: var(--radius-sm);
    font-family: var(--font-texte);
    transition: all 0.3s ease;
}

.btn-login:hover {
    background: var(--mauve-dark);
}

.btn-checkout {
    display: block;
    width: 100%;
    background: var(--success);
    color: white;
    text-decoration: none;
    padding: 15px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-family: var(--font-texte);
    text-align: center;
    transition: all 0.3s ease;
}

.btn-checkout:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* ----- FOOTER (IDENTIQUE À WOMEN.CSS) ----- */
.site-footer {
    background-color: var(--noir);
    color: var(--blanc-casse);
    padding: 60px 0 30px;
    font-family: var(--font-texte);
    margin-top: 60px;
    width: 100%;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col h4 {
    font-family: var(--font-titre);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: white;
    letter-spacing: 1px;
}

.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-col li {
    margin-bottom: 12px;
}

.footer-col a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: color 0.2s;
    font-size: 0.95rem;
    font-family: var(--font-texte);
}

.footer-col a:hover {
    color: var(--mauve);
}

.footer-logo {
    font-family: var(--font-titre);
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 15px;
    display: inline-block;
    color: white;
}

.footer-contact p {
    margin: 5px 0;
    color: rgba(255,255,255,0.7);
    font-size: 0.95rem;
    font-family: var(--font-texte);
}

.payment-icons {
    margin-top: 20px;
    display: flex;
    gap: 15px;
    font-size: 2rem;
    color: rgba(255,255,255,0.6);
}

.payment-icons i {
    transition: color 0.2s;
}

.payment-icons i:hover {
    color: var(--mauve);
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 30px;
    text-align: center;
    color: rgba(255,255,255,0.6);
    font-size: 0.9rem;
    font-family: var(--font-texte);
}

/* =========================================== */
/* ===== RESPONSIVE MOBILE FIRST (comme women.css) ===== */
/* =========================================== */

@media (max-width: 1024px) {
    .cart-summary {
        max-width: 100%;
        margin-top: 30px;
    }
}

@media (max-width: 768px) {
    /* Conteneur principal – mêmes règles que women.css */
    .container {
        padding-left: 15px !important;
        padding-right: 15px !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }

    .page-header h1 {
        font-size: 2rem;
    }

    .cart-table {
        padding: 15px;
    }

    .cart-table table,
    .cart-table thead,
    .cart-table tbody,
    .cart-table tr,
    .cart-table td {
        display: block;
    }

    .cart-table thead {
        display: none;
    }

    .cart-table tr {
        margin-bottom: 20px;
        padding: 15px;
        border: 1px solid var(--gris-light);
        border-radius: var(--radius-md);
        position: relative;
    }

    .cart-table td {
        padding: 10px 0;
        border: none;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .product-col {
        min-width: auto;
    }

    .product-info {
        width: 100%;
    }

    .product-info img {
        width: 60px;
        height: 80px;
    }

    .price-col::before {
        content: "Price:";
        font-weight: 600;
        margin-right: 10px;
        color: var(--gris);
    }

    .quantity-col::before {
        content: "Quantity:";
        font-weight: 600;
        margin-right: 10px;
        color: var(--gris);
    }

    .total-col::before {
        content: "Total:";
        font-weight: 600;
        margin-right: 10px;
        color: var(--gris);
    }

    .actions-col {
        position: absolute;
        top: 10px;
        right: 10px;
    }

    .actions-col::before {
        display: none;
    }

    .cart-actions {
        flex-direction: column;
        gap: 15px;
    }

    .btn-clear, .btn-continue {
        width: 100%;
        text-align: center;
    }

    /* ----- FOOTER (identique à women.css 768px) ----- */
    .site-footer .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .payment-icons {
        font-size: 1.8rem;
        gap: 12px;
        flex-wrap: wrap;
    }
    
    .footer-col ul {
        margin-bottom: 10px;
    }
    
    .footer-col h4 {
        margin-bottom: 15px;
    }
}

@media (max-width: 576px) {
    .page-header h1 {
        font-size: 1.8rem;
    }

    .empty-cart {
        padding: 40px 15px;
    }

    .empty-cart h2 {
        font-size: 1.5rem;
    }

    .product-info {
        flex-direction: column;
        text-align: center;
    }

    .product-info img {
        width: 100px;
        height: 130px;
    }

    .cart-table tr {
        padding: 20px 15px;
    }

    .cart-table td {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .price-col::before,
    .quantity-col::before,
    .total-col::before {
        width: 100%;
        margin-bottom: 5px;
    }

    .quantity-control {
        width: 100%;
        justify-content: center;
    }

    .btn-clear, .btn-continue {
        padding: 12px;
    }

    /* ----- FOOTER (identique à women.css 576px) ----- */
    .payment-icons {
        font-size: 1.6rem;
        gap: 10px;
    }
    
    .footer-contact p {
        font-size: 0.8rem;
    }
}

@media (max-width: 400px) {
    .container {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    .page-header h1 {
        font-size: 1.5rem;
    }

    .product-info img {
        width: 80px;
        height: 100px;
    }

    .cart-summary {
        padding: 20px;
    }

    .summary-row {
        flex-direction: column;
        gap: 5px;
        align-items: flex-start;
    }

    .btn-checkout {
        padding: 12px;
        font-size: 0.9rem;
    }

    /* ----- FOOTER – très petits écrans (identique à women.css) ----- */
    .payment-icons {
        font-size: 1.4rem;
    }
}

/* Animations pour les toasts */
@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

.cart-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 12px 24px;
    border-radius: 40px;
    font-size: 0.9rem;
    z-index: 10000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    animation: slideInRight 0.3s ease, fadeOut 2s ease 1.5s forwards;
    max-width: 300px;
}