/**
 * Mini Cart Styles
 */

/* Cart count badge */
.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--color-accent-4);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}

.cart-toggle {
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 24px;
    padding: 8px;
}

/* Cart Modal */
.cart-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
}

.cart-modal.active {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.cart-modal__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s;
}

.cart-modal__content {
    position: relative;
    width: 100%;
    max-width: 500px;
    height: 100%;
    background: white;
    display: flex;
    flex-direction: column;
    animation: slideInRight 0.3s;
}

.cart-modal__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.cart-modal__header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--color-text);
}

.cart-modal__close {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--color-text);
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.cart-modal__close:hover {
    color: var(--color-accent-4);
}

.cart-modal__body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.cart-empty {
    text-align: center;
    padding: 3rem 1rem;
}

.cart-empty p {
    color: #6b7280;
    margin-bottom: 1.5rem;
    font-size: 1.125rem;
}

.cart-items {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cart-item {
    display: grid;
    grid-template-columns: 60px 1fr auto auto auto;
    gap: 1rem;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 8px;
    align-items: center;
    transition: opacity 0.2s ease;
}

.cart-item__image {
    width: 60px;
    height: 60px;
    overflow: hidden;
    border-radius: 4px;
    background: white;
    border: 1px solid #e5e7eb;
}

.cart-item__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cart-item__info h4 {
    margin: 0 0 0.25rem 0;
    font-size: 1rem;
    color: var(--color-text);
}

.cart-item__variation {
    font-size: 0.8125rem;
    color: #6b7280;
    margin: 0 0 0.25rem 0;
    font-style: italic;
}

.cart-item__price {
    color: #6b7280;
    font-size: 0.875rem;
    margin: 0;
}

.cart-item__actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.qty-btn {
    width: 32px;
    height: 32px;
    /* border: 1px solid #d1d5db; */
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.qty-btn:hover {
    background: var(--color-accent-4);
    border-color: var(--color-accent-4);
    color: white;
}

.qty-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f3f4f6;
}

.cart-item__qty {
    min-width: 24px;
    text-align: center;
    font-weight: 600;
    transition: opacity 0.2s ease;
}

.cart-item__total {
    font-weight: 600;
    color: var(--color-text);
}

.cart-item__remove {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    color: #9ca3af;
    transition: color 0.2s;
    line-height: 1;
}

.cart-item__remove:hover {
    color: #ef4444;
}

.cart-item__remove:hover {
    opacity: 1;
}

.cart-modal__footer {
    padding: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text);
}

/* Boutons du footer - utilise maintenant .btn--primary et .btn--outline */
.cart-modal__footer .btn {
    width: 100% !important; /* Force pour éviter les conflits */
    text-align: center;
    padding: 14px 28px;
    font-size: 0.875rem;
    margin: 0;
}

.cart-modal__footer .btn--outline {
    margin-bottom: 0.75rem;
}

/* Bouton dans l'état vide */
.cart-empty .btn {
    margin-top: 1.5rem;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .cart-modal__content {
        max-width: 100%;
    }

    .cart-item {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .cart-item__actions {
        justify-content: center;
    }

    .cart-item__total {
        text-align: center;
    }
}
/* Responsive Mobile Improvements */
@media (max-width: 768px) {
    .cart-modal__content {
        max-width: 100%;
    }

    .cart-item {
        grid-template-columns: 60px 1fr auto;
        grid-template-areas:
            "image info remove"
            "image actions total";
        gap: 0.75rem 1rem;
    }

    .cart-item__image {
        grid-area: image;
    }

    .cart-item__info {
        grid-area: info;
    }

    .cart-item__remove {
        grid-area: remove;
        align-self: start;
    }

    .cart-item__actions {
        grid-area: actions;
        justify-content: flex-start;
    }

    .cart-item__total {
        grid-area: total;
        text-align: right;
    }

    .cart-modal__header h2 {
        font-size: 1.25rem;
    }

    .cart-modal__body {
        padding: 1rem;
    }

    .cart-modal__footer {
        padding: 1rem;
    }
}
