/* assets/css/cart.css */
/* Styles extracted from style.css for Cart/Toast/Floating Icon */

/* Toast styles are in style.css */

/* Floating Cart Icon */
.cart-icon-homepage {
    position: fixed;
    top: 33%;
    right: 20px;
    z-index: 1000;
}

.cart-icon-homepage.empty-cart {
    display: none;
}

.cart-icon-homepage a {
    color: #333;
    text-decoration: none;
    font-size: 3rem;
    position: relative;
    background: #fff;
    border-radius: 50%;
    padding: 15px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    transition: transform 0.2s;
}

.cart-icon-homepage a:hover {
    color: #4CAF50;
    transform: scale(1.1);
}

.cart-item-count {
    background-color: #e74c3c;
    /* Red */
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    /* Adjust padding */
    font-size: 0.8rem;
    position: absolute;
    top: -5px;
    right: -5px;
    display: inline;
    z-index: 1001;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-item-count.updated {
    animation: bounce 0.5s;
}

@keyframes bounce {
    0% {
        transform: scale(1);
    }

    30% {
        transform: scale(1.3);
    }

    50% {
        transform: scale(0.9);
    }

    70% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

/* Panier Container (Popup/Page) */
.panier-container {
    position: fixed;
    top: 80px;
    right: 20px;
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    width: 380px;
    z-index: 1002;
    display: none;
    border: 1px solid #ddd;
    max-height: 80vh;
    overflow-y: auto;
}

.panier-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.panier-header h3 {
    font-size: 1.6rem;
    color: #4CAF50;
    margin: 0;
}

.btn-clear-cart {
    background: #fdf2f2;
    color: #e74c3c;
    border: 1px solid #fabfbf;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-clear-cart:hover {
    background: #e74c3c;
    color: white;
}

.panier-items {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.panier-items li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.panier-items li span {
    font-size: 1.1rem;
    flex-grow: 1;
    margin-right: 10px;
}

.panier-items li input[type="number"] {
    width: 60px;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-right: 10px;
    text-align: center;
}

.panier-items li button {
    background-color: #f44336;
    color: white;
    border: none;
    padding: 5px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.panier-items li button:hover {
    background-color: #e53935;
}

.panier-total {
    font-size: 1.3rem;
    margin-top: 20px;
    text-align: right;
    font-weight: bold;
}

.panier-actions {
    margin-top: 25px;
    text-align: center;
}

.panier-actions button {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: background-color 0.3s ease;
}

.panier-actions button:hover {
    background-color: #45a049;
}

/* Mobile Responsive - Fix panier coupé */
@media screen and (max-width: 768px) {
    .panier-container {
        position: fixed;
        top: 60px;
        left: 10px;
        right: 10px;
        width: auto;
        max-height: calc(100vh - 80px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .panier-header h3 {
        font-size: 1.3rem;
    }

    .panier-items li {
        flex-wrap: wrap;
        gap: 10px;
    }

    .panier-items li span {
        width: 100%;
        margin-right: 0;
    }
}