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

/* Cart dropdown container */
.block-header-middle .block-orders .item-cart .nav-dropdown {
    min-width: 320px;
    max-width: 400px;
    max-height: 0;
    overflow: hidden;
    padding: 0;
    transition: all 0.3s ease;
}

.block-header-middle .block-orders .item-cart:hover .nav-dropdown {
    max-height: 500px;
    overflow-y: auto;
    padding: 15px 0;
}

/* Cart item styling */
.widget_shopping_cart_item {
    padding: 12px 20px;
    border: none;
    background: transparent;
}

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

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

.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: 14px;
    font-weight: 600;
    color: #333;
    margin: 0 0 6px 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: 6px;
    font-size: 13px;
    color: #666;
    margin-bottom: 4px;
}

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

.item-price {
    font-weight: 600;
    color: #1b74e4;
}

.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: #dc3545;
    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 */
.cart-summary {
    padding: 15px 20px 10px;
    border-top: 2px solid #f0f0f0;
    background: #fafafa;
}

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

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

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

.cart-actions .btn-outline-primary {
    color: #1b74e4;
    border: 1px solid #1b74e4;
    background: transparent;
}

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

.cart-actions .btn-primary {
    background: #1b74e4;
    color: white;
    border: 1px solid #1b74e4;
}

.cart-actions .btn-primary:hover {
    background: #155bb5;
    border-color: #155bb5;
}

/* 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;
}
