/* Mini Cart Sidebar Styles - FIXED VERSION */

/* Overlay backdrop */
.mini-cart::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: -1;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
}

.mini-cart.active::before {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Main cart container */
.mini-cart {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 420px;
    height: 100%;
    z-index: 9999;
    transition: right 0.3s ease-in-out;
    pointer-events: none;
}

.mini-cart.active {
    right: 0;
    pointer-events: auto;
}

/* Cart wrapper - the white box */
.mini-cart-wrapper {
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    background: #fff;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

/* Close button */
.mini-cart .btn-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border: none;
    background: #f8f8f8;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 20;
}

.mini-cart .btn-close:hover {
    background: #e74c3c;
    color: #fff;
    transform: rotate(90deg);
}

.mini-cart .btn-close i {
    font-size: 14px;
}

/* Cart inner content */
.mini-cart-inner {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
    background: #fff;
}

.mini-cart__heading {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 30px;
    padding-right: 50px;
    color: #333;
}

.mini-cart__content {
    display: flex;
    flex-direction: column;
    height: calc(100% - 70px);
}

/* Cart items list */
.mini-cart__list {
    list-style: none;
    padding: 0;
    margin: 0;
    flex: 1;
    overflow-y: auto;
    margin-bottom: 20px;
}

/* Individual cart item */
.mini-cart__product {
    display: flex;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

/* Remove button */
.mini-cart__product .remove-from-cart {
    position: absolute;
    top: 15px;
    right: 0;
    width: 24px;
    height: 24px;
    background: #f8f8f8;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #999;
    transition: all 0.3s ease;
    text-decoration: none;
    cursor: pointer;
}

.mini-cart__product .remove-from-cart:hover {
    background: #e74c3c;
    color: #fff;
}

/* Product image */
.mini-cart__product__image {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    margin-right: 15px;
    overflow: hidden;
    border-radius: 8px;
    background: #f8f8f8;
}

.mini-cart__product__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Product content */
.mini-cart__product__content {
    flex: 1;
    padding-right: 30px;
}

.mini-cart__product__title {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 5px;
    text-decoration: none;
    line-height: 1.4;
}

.mini-cart__product__title:hover {
    color: #e74c3c;
}

.mini-cart__product__quantity {
    font-size: 13px;
    color: #999;
}

/* Cart footer */
.mini-cart__footer {
    margin-top: auto;
    padding-top: 20px;
    border-top: 2px solid #f0f0f0;
    background: #fff;
}

.mini-cart__total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
}

.mini-cart__total .ammount {
    color: #e74c3c;
}

/* Cart buttons */
.mini-cart__buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mini-cart__buttons .btn {
    width: 100%;
    text-align: center;
    padding: 12px 20px;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-weight: 500;
}

/* Empty cart state */
.mini-cart__empty {
    text-align: center;
    padding: 60px 20px;
}

.mini-cart__empty i {
    font-size: 64px;
    color: #ddd;
    margin-bottom: 20px;
    display: block;
}

.mini-cart__empty p {
    font-size: 16px;
    color: #999;
    margin: 0;
}

/* Cart badge on header icon */
.mini-cart-count,
.cart-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #e74c3c;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    line-height: 1.2;
}

/* Toast Notification */
.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99999;
    opacity: 0;
    transition: opacity 0.3s ease;
    display: none;
}

.toast-content {
    background: #28a745;
    color: #fff;
    padding: 15px 25px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 250px;
}

.toast-content i {
    font-size: 20px;
}

.toast-message {
    font-size: 14px;
    font-weight: 500;
}

/* Loading Spinner */
.btn-loader {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-loader .fa-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Utility classes */
.d-none {
    display: none !important;
}

/* Prevent body scroll when cart is open */
body.cart-open {
    overflow: hidden;
}

/* Responsive Design */
@media (max-width: 480px) {
    .mini-cart {
        max-width: 100%;
    }

    .mini-cart-inner {
        padding: 20px;
    }

    .mini-cart__heading {
        font-size: 20px;
        margin-bottom: 20px;
    }

    .mini-cart__product__image {
        width: 60px;
        height: 60px;
    }

    .mini-cart__product__content {
        padding-right: 25px;
    }

    .toast-notification {
        right: 10px;
        left: 10px;
        top: 10px;
    }

    .toast-content {
        min-width: auto;
    }
}

/* Fix for z-index issues */
.mini-cart {
    z-index: 99999 !important;
}

/* Smooth scrollbar for cart items */
.mini-cart__list::-webkit-scrollbar {
    width: 6px;
}

.mini-cart__list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.mini-cart__list::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.mini-cart__list::-webkit-scrollbar-thumb:hover {
    background: #555;
}


