/* ----------------------------------------------------------------------------------------
* Cart Styles - Atelier de Ngoundji
* ---------------------------------------------------------------------------------------- */

/* Header Cart Icon */
.header-cart-wrapper {
    position: relative;
    margin-left: 10px;
}

.header-cart-icon-container {
    position: relative;
    display: inline-block;
}

.header-cart-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: var(--accent-color);
    color: var(--white-color);
    border-radius: 50%;
    font-size: 16px;
    transition: all 0.3s ease;
}

.header-cart-icon:hover {
    background-color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: var(--white-color);
    color: var(--accent-color);
    font-size: 12px;
    font-weight: 700;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--accent-color);
}

/* Mini Cart Dropdown */
.mini-cart-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 360px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 1000;
    overflow: hidden;
    padding: 15px;
}

.mini-cart-dropdown::before {
    content: '';
    position: absolute;
    top: -10px;
    right: 20px;
    width: 20px;
    height: 20px;
    background-color: var(--white-color);
    transform: rotate(45deg);
    z-index: -1;
}

.header-cart-wrapper:hover .mini-cart-dropdown,
.mini-cart-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Mini Cart Header */
.mini-cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--divider-color);
    margin-bottom: 10px;
}

.mini-cart-header h4 {
    font-size: 18px;
    margin: 0;
}

.mini-cart-close {
    cursor: pointer;
    font-size: 16px;
    color: var(--text-color);
    transition: all 0.3s ease;
}

.mini-cart-close:hover {
    color: var(--accent-color);
    transform: rotate(90deg);
}

/* Mini Cart Products */
.mini-cart-products {
    max-height: 250px;
    overflow-y: auto;
    margin-bottom: 10px;
    padding-right: 5px;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-color) var(--secondery-color);
}

.mini-cart-products::-webkit-scrollbar {
    width: 5px;
}

.mini-cart-products::-webkit-scrollbar-track {
    background: var(--secondery-color);
    border-radius: 10px;
}

.mini-cart-products::-webkit-scrollbar-thumb {
    background-color: var(--accent-color);
    border-radius: 10px;
}

.mini-cart-product {
    display: flex;
    align-items: center;
    position: relative;
    padding: 8px 0;
    border-bottom: 1px solid var(--divider-color);
    transition: all 0.3s ease;
}

.mini-cart-product:last-child {
    border-bottom: none;
}

.mini-cart-product-image {
    width: 50px;
    height: 50px;
    border-radius: 4px;
    overflow: hidden;
    margin-right: 12px;
    flex-shrink: 0;
}

.mini-cart-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mini-cart-product-details {
    flex-grow: 1;
    padding-right: 30px;
}

.mini-cart-product-details h5 {
    font-size: 13px;
    margin: 0 0 3px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mini-cart-product-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    margin-bottom: 2px;
    color: var(--text-color);
}

.mini-cart-product-price {
    font-weight: 600;
    color: var(--accent-color);
}

.mini-cart-product-quantity {
    font-size: 12px;
    color: #777;
}

.mini-cart-product-sku {
    font-size: 10px;
    color: #777;
    margin-top: 2px;
    font-style: italic;
}

.mini-cart-product-attributes {
    display: flex;
    gap: 4px;
    margin-top: 3px;
    flex-wrap: wrap;
}

.color-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid #ddd;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.attribute-badge {
    display: inline-block;
    font-size: 9px;
    padding: 1px 5px;
    border-radius: 8px;
    background-color: var(--secondery-color);
    color: var(--text-color);
    white-space: nowrap;
}

.mini-cart-product-remove {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 14px;
    transition: all 0.3s ease;
}

.mini-cart-product-remove:hover {
    color: var(--error-color);
}

/* Empty Cart */
.mini-cart-empty {
    text-align: center;
    padding: 30px 0;
    color: #777;
}

.mini-cart-empty i {
    font-size: 40px;
    margin-bottom: 10px;
    color: var(--divider-color);
}

.mini-cart-empty p {
    margin: 0;
    font-size: 14px;
}

/* Mini Cart Footer */
.mini-cart-footer {
    padding-top: 10px;
    border-top: 1px solid var(--divider-color);
}

.mini-cart-subtotal {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 15px;
    font-weight: 600;
}

/* Indicateur de livraison gratuite */
.free-shipping-indicator {
    margin-bottom: 10px;
    padding: 5px 0;
}

.free-shipping-text {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 13px;
}

.free-shipping-text i {
    font-size: 16px;
    color: var(--primary-color);
    margin-right: 5px;
}

.free-shipping-text .amount-left {
    font-weight: 600;
    color: var(--primary-color);
}

.free-shipping-progress {
    height: 6px;
    background-color: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.free-shipping-progress-bar {
    height: 100%;
    background-color: var(--primary-color);
    border-radius: 10px;
    transition: width 0.5s ease;
    position: relative;
}

.free-shipping-icon {
    position: absolute;
    top: -12px;
    right: -10px;
    font-size: 16px;
    color: var(--primary-color);
    transform: translateX(0);
    transition: transform 0.5s ease;
}

.free-shipping-achieved .free-shipping-text {
    color: var(--primary-color);
    font-weight: 600;
}

.free-shipping-achieved .free-shipping-progress-bar {
    background-color: var(--success-color, #28a745);
}

.mini-cart-buttons {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.mini-cart-buttons .btn-default {
    padding: 10px 15px;
    font-size: 13px;
    flex: 1;
    text-align: center;
}

/* Cart Animation */
@keyframes cartPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.cart-icon-highlight {
    animation: cartPulse 0.8s ease-in-out;
}

/* Cart Animation Element */
.cart-animation {
    position: fixed;
    z-index: 9999;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transition: all 0.8s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

.cart-animation img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Responsive Styles */
@media (max-width: 991px) {
    /* Cacher l'icône panier du header principal sur mobile */
    .header-btn .header-cart-wrapper {
        display: none !important;
    }
    
    /* Styles pour l'icône panier mobile */
    .header-cart-wrapper {
        display: block !important;
        position: relative;
        margin-left: 10px;
    }
    
    .header-cart-icon-container {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Ajustement du mini-cart sur mobile */
    .mini-cart-dropdown {
        width: 340px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        right: auto !important;
        max-width: 90vw;
    }
    
    /* Ajustement pour très petits écrans */
    @media (max-width: 350px) {
        .mini-cart-dropdown {
            width: 280px !important;
        }
    }
    
    /* Ajustement du contenu du mini-cart sur mobile */
    .mini-cart-product {
        padding: 10px !important;
    }
    
    .mini-cart-product-image img {
        width: 40px !important;
        height: 40px !important;
    }
    
    .mini-cart-product-details h5 {
        font-size: 12px !important;
    }
    
    .mini-cart-buttons {
        flex-direction: column !important;
        gap: 8px !important;
    }
    
    .mini-cart-buttons .btn-default {
        width: 100% !important;
        margin: 0 !important;
        padding: 8px !important;
        font-size: 14px !important;
    }
    
    .header-cart-icon {
        width: 35px;
        height: 35px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #fff;
        font-size: 18px;
        position: relative;
    }
    
    .cart-count {
        position: absolute;
        top: -5px;
        right: -5px;
        width: 18px;
        height: 18px;
        font-size: 10px;
        background-color: var(--primary-color);
        color: #fff;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

@media (max-width: 767px) {
    .mini-cart-dropdown {
        width: 280px;
        right: -70px;
    }
    
    .mini-cart-dropdown::before {
        right: 80px;
    }
    
    .mini-cart-buttons {
        flex-direction: column;
        gap: 8px;
    }
    
    .header-cart-wrapper {
        margin-left: 5px;
    }
    
    .header-cart-icon {
        width: 32px;
        height: 32px;
    }
}

@media (max-width: 575px) {
    .mini-cart-dropdown {
        width: 260px;
        right: -50px;
    }
    
    .mini-cart-dropdown::before {
        right: 60px;
    }
}
