/**
 * ============================================
 * PROFESSIONAL CART DROPDOWN - FIXED POSITION
 * ============================================
 * Cart dropdown that doesn't affect page scroll
 * Uses fixed positioning to prevent header scrolling
 */

/* Cart Icon Container */
.has-cart-data {
    position: static !important;
}

/* Cart Popup - Fixed Position to prevent scroll issues */
.has-cart-data .cart-popup {
    position: fixed !important;
    top: 120px !important;
    right: 180px !important;
    width: 380px;
    max-height: 600px;
    background: #ffffff;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    overflow: visible;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999999 !important;
    pointer-events: none;
    transform: translateY(-10px);
}

/* Show cart on hover */
.has-cart-data:hover .cart-popup {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

/* RTL positioning */
[dir="rtl"] .has-cart-data .cart-popup {
    right: auto !important;
    left: 150px !important;
}

/* Cart List - Scrollable Container */
.cart-popup .cart_list,
.cart-popup .product_list_widget {
    max-height: 350px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding: 15px;
    margin: 0;
    list-style: none;
    -webkit-overflow-scrolling: touch;
}

/* Custom Scrollbar for Cart List */
.cart_list::-webkit-scrollbar,
.product_list_widget::-webkit-scrollbar {
    width: 8px;
}

.cart_list::-webkit-scrollbar-track,
.product_list_widget::-webkit-scrollbar-track {
    background: #f7fafc;
    border-radius: 10px;
}

.cart_list::-webkit-scrollbar-thumb,
.product_list_widget::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 10px;
}

.cart_list::-webkit-scrollbar-thumb:hover,
.product_list_widget::-webkit-scrollbar-thumb:hover {
    background: #7caa53;
}

/* Individual Cart Item */
.mini-cart-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
}

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

/* Product Image */
.mini-cart-item .product-image {
    flex-shrink: 0;
}

.mini-cart-item .product-image img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #eee;
}

/* Product Info */
.mini-cart-item .product-name {
    flex: 1;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
    margin-bottom: 5px;
    display: block;
    text-decoration: none;
    transition: color 0.3s;
}

.mini-cart-item .product-name:hover {
    color: #667eea;
}

.mini-cart-item .cart-item-quantity {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

.mini-cart-item .cart-product-qty {
    font-weight: 600;
    color: #333;
}

/* Remove Button - Simple and Clean */
.mini-cart-item .cart-remove {
    position: absolute;
    top: 10px;
    right: 0;
    width: 20px;
    height: 20px;
    background: transparent;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    border: none;
    padding: 0;
    line-height: 1;
}

.mini-cart-item .cart-remove:hover {
    color: #dc3545;
    transform: scale(1.15);
}

/* Cart Total Section */
.cart-popup .total-cart {
    padding: 15px;
    background: #f9f9f9;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
    font-weight: 700;
}

.cart-popup .total-cart .title {
    color: #666;
}

.cart-popup .total-cart .price {
    color: #28a745;
}

/* Cart Action Buttons - Simple and Clean Design */
.cart-popup .view-cart,
.cart-popup .checkout {
    display: block;
    width: calc(100% - 30px);
    margin: 0 15px 12px 15px;
    padding: 14px 20px;
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

/* View Cart - Green Background */
.cart-popup .view-cart {
    background: #28a745;
    color: white;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.2);
}

.cart-popup .view-cart:hover {
    background: #218838;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.35);
}

/* Checkout - Dark Background */
.cart-popup .checkout {
    background: #2d3748;
    color: white;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(45, 55, 72, 0.2);
}

.cart-popup .checkout:hover {
    background: #1a202c;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(45, 55, 72, 0.35);
}

/* Empty Cart State */
.cart-popup .card {
    margin: 20px 15px;
    padding: 30px 20px;
    text-align: center;
    border: 2px dashed #ddd;
    border-radius: 8px;
    background: #f9f9f9;
}

.cart-popup .card h4 {
    color: #999;
    font-size: 14px;
    margin: 0;
}

/* Mobile Responsive */
@media (max-width: 767px) {
    .has-cart-data .cart-popup {
        width: 320px;
    }

    .cart-popup .cart_list {
        max-height: 300px;
    }

    .mini-cart-item .product-image img {
        width: 50px;
        height: 50px;
    }

    .mini-cart-item .product-name {
        font-size: 12px;
    }
}

/* Tablet */
@media (min-width: 768px) and (max-width: 991px) {
    .has-cart-data .cart-popup {
        width: 360px;
    }
}

/* Ensure cart is completely hidden when not hovered */
.has-cart-data .cart-popup {
    display: none !important;
}

.has-cart-data:hover .cart-popup {
    display: block !important;
}

/* Mobile positioning */
@media (max-width: 767px) {
    .has-cart-data .cart-popup {
        width: 320px !important;
        right: 10px !important;
        top: 60px !important;
    }

    [dir="rtl"] .has-cart-data .cart-popup {
        left: 10px !important;
        right: auto !important;
    }
}

/* Tablet positioning */
@media (min-width: 768px) and (max-width: 991px) {
    .has-cart-data .cart-popup {
        width: 360px !important;
        right: 80px !important;
    }

    [dir="rtl"] .has-cart-data .cart-popup {
        left: 80px !important;
        right: auto !important;
    }
}

/* Small desktop positioning */
@media (min-width: 992px) and (max-width: 1199px) {
    .has-cart-data .cart-popup {
        right: 120px !important;
    }

    [dir="rtl"] .has-cart-data .cart-popup {
        left: 120px !important;
        right: auto !important;
    }
}

/* RTL Support */
[dir="rtl"] .mini-cart-item .cart-remove {
    right: auto;
    left: 0;
}

/* Prevent any overflow from cart */
body {
    overflow-x: hidden;
}

.ecommerce-header,
header,
.main-nav,
.container-fluid {
    overflow: visible !important;
}
