/**
 * Header Cart Dropdown - Enhanced styling for cart dropdown with items
 */

/* Cart dropdown container */
.block-header-middle .block-orders .item-cart .nav-dropdown {
    min-width: 350px;
    max-width: 420px;
    max-height: 0;
    overflow: hidden;
    padding: 0;
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    margin-top: 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    border-radius: 8px;
}

.block-header-middle .block-orders .item-cart:hover .nav-dropdown,
.block-header-middle .block-orders .item-cart .nav-dropdown:hover {
    max-height: 600px;
    overflow-y: auto;
    padding: 0;
    opacity: 1;
    visibility: visible;
}

/* Custom scrollbar for cart dropdown */
.block-header-middle .block-orders .item-cart .nav-dropdown::-webkit-scrollbar {
    width: 6px;
}

.block-header-middle .block-orders .item-cart .nav-dropdown::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.block-header-middle .block-orders .item-cart .nav-dropdown::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.block-header-middle .block-orders .item-cart .nav-dropdown::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Vendor Group Header - Enhanced */
.nav-dropdown .vendor-group-header {
    padding: 10px 16px;
    background: #1b74e4;
    border-bottom: none;
    margin: 0;
    position: sticky;
    top: 0;
    z-index: 10;
}

.nav-dropdown .vendor-group-header .vendor-info {
    display: flex;
    align-items: center;
    color: white;
    font-size: 13px;
    font-weight: 500;
}

.nav-dropdown .vendor-group-header .vendor-info i {
    font-size: 14px;
    margin-right: 6px;
}

.nav-dropdown .vendor-group-header .vendor-info strong {
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.nav-dropdown .vendor-group-header .vendor-info .item-count {
    font-size: 11px;
    opacity: 0.9;
    margin-left: 4px;
}

/* Vendor Subtotal - NEW */
.nav-dropdown .vendor-subtotal {
    padding: 10px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

.nav-dropdown .vendor-subtotal .subtotal-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.nav-dropdown .vendor-subtotal .subtotal-row span {
    color: #666;
}

.nav-dropdown .vendor-subtotal .subtotal-row strong {
    color: #333;
    font-weight: 600;
}

/* Vendor Checkout Button - NEW */
.nav-dropdown .vendor-checkout {
    padding: 12px 16px;
    background: white;
    border: none;
    margin: 0;
}

.nav-dropdown .vendor-checkout .btn-vendor-checkout {
    width: 100%;
    padding: 10px 16px;
    background: #1877f2;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.nav-dropdown .vendor-checkout .btn-vendor-checkout:hover {
    background: #0d6efd;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(24, 119, 242, 0.3);
}

.nav-dropdown .vendor-checkout .btn-vendor-checkout i {
    font-size: 14px;
}

/* Vendor Divider (thick line between vendors) - NEW */
.nav-dropdown .vendor-divider {
    padding: 0;
    margin: 12px 0;
}

.nav-dropdown .vendor-divider .thick-divider {
    border: 0;
    border-top: 3px solid #e9ecef;
    margin: 0;
}

/* Cart item styling */
.widget_shopping_cart_item {
    padding: 10px 16px;
    border: none;
    background: white;
    transition: background 0.2s ease;
}

.widget_shopping_cart_item:hover {
    background: #f8f9fa;
}

.cart-item-info {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

.item-thumbnail {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 6px;
    overflow: hidden;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e9ecef;
}

.cart-item-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.no-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
    font-size: 18px;
}

.item-details {
    flex: 1;
    min-width: 0;
}

.item-name {
    font-size: 13px;
    font-weight: 500;
    color: #333;
    margin: 0 0 4px 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.item-meta {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #666;
    margin-bottom: 0;
}

.item-quantity {
    font-weight: 500;
}

.item-price {
    font-weight: 600;
    color: #1877f2;
    font-size: 13px;
}

.item-note {
    font-size: 12px;
    color: #888;
    margin: 4px 0 0 0;
    font-style: italic;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Remove button */
/* .remove-cart-item {
    position: absolute;
    top: 0;
    right: 0;
    width: 20px;
    height: 20px;
    border: none;
    background: #1b74e4;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.8;
}

.remove-cart-item:hover {
    opacity: 1;
    transform: scale(1.1);
    background: #c82333;
} */

/* Cart item divider */
.cart-item-divider {
    padding: 0 20px;
    margin: 8px 0;
}

.cart-item-divider hr {
    margin: 0;
    border: none;
    border-top: 1px solid #eee;
}

/* Cart summary - Hidden (vì mỗi vendor đã có button riêng) */
.cart-summary {
    padding: 16px;
    border-top: 3px solid #e9ecef;
    background: white;
    position: sticky;
    bottom: 0;
    z-index: 10;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.05);
}

.cart-total {
    text-align: center;
    margin-bottom: 12px;
    font-size: 16px;
    color: #333;
    font-weight: 700;
}

.cart-actions {
    display: flex;
    gap: 8px;
}

.cart-actions .btn {
    flex: 1;
    font-size: 13px;
    padding: 10px 16px;
    border-radius: 6px;
    text-decoration: none;
    text-align: center;
    transition: all 0.2s ease;
    font-weight: 600;
    border: none;
}

.cart-actions .btn-outline-primary {
    color: #1877f2;
    border: 2px solid #1877f2;
    background: transparent;
}

.cart-actions .btn-outline-primary:hover {
    background: #1877f2;
    color: white;
}

.cart-actions .btn-primary {
    background: #ff6b00;
    color: white;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.cart-actions .btn-primary:hover {
    background: #e85d00;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 107, 0, 0.3);
}

.cart-actions .btn-primary i {
    font-size: 14px;
}

/* Empty cart message */
.empty-cart-message {
    text-align: center;
    padding: 30px 20px;
    color: #666;
}

.empty-cart-message .fas {
    color: #ddd;
    margin-bottom: 15px;
}

.woocommerce-mini-cart__empty-message {
    margin: 0 0 15px 0;
    font-size: 14px;
    color: #888;
}

.empty-cart-message .btn {
    font-size: 13px;
    padding: 8px 16px;
    background: #1b74e4;
    color: white;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    transition: background 0.2s ease;
}

.empty-cart-message .btn:hover {
    background: #155bb5;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .block-header-middle .block-orders .item-cart .nav-dropdown {
        min-width: 280px;
        max-width: 300px;
        right: 0;
        left: auto;
    }
    
    .cart-item-info {
        gap: 10px;
    }
    
    .item-thumbnail {
        width: 40px;
        height: 40px;
    }
    
    .item-name {
        font-size: 13px;
    }
    
    .item-meta {
        font-size: 12px;
    }
    
    .cart-actions {
        flex-direction: column;
        gap: 6px;
    }
}

/* Loading state */
.cart-dropdown-loading {
    padding: 20px;
    text-align: center;
    color: #666;
}

.cart-dropdown-loading .spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #1b74e4;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Hover effects */
.widget_shopping_cart_item:hover {
    background: rgba(27, 116, 228, 0.02);
}

/* Scrollbar styling for dropdown */
.block-header-middle .block-orders .item-cart:hover .nav-dropdown::-webkit-scrollbar {
    width: 6px;
}

.block-header-middle .block-orders .item-cart:hover .nav-dropdown::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.block-header-middle .block-orders .item-cart:hover .nav-dropdown::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.block-header-middle .block-orders .item-cart:hover .nav-dropdown::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}
