/* ===================================
   Enhanced E-commerce Products CSS
   =================================== */

/* Product Container */
.products-list {
    display: grid;
    gap: 20px;
    margin-top: 20px;
}

.product {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.product:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-color: #007bff;
}

.product.featured {
    border-color: #ffc107;
    background: linear-gradient(135deg, #fff 0%, #fffbf0 100%);
}

.product.out-of-stock {
    opacity: 0.7;
    background: #f8f9fa;
}

/* Product Badges */
.product-badges {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.badge {
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.badge-featured {
    background: linear-gradient(45deg, #ffc107, #ffb300);
    color: #fff;
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.3);
}

.badge-sale {
    background: linear-gradient(45deg, #dc3545, #c82333);
    color: #fff;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

.badge-low-stock {
    background: linear-gradient(45deg, #fd7e14, #e55a00);
    color: #fff;
    box-shadow: 0 2px 8px rgba(253, 126, 20, 0.3);
}

/* Product Header */
.product-header {
    align-items: flex-start;
}

/* Product Image */
.product-image {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: #f8f9fa;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product:hover .product-image img {
    transform: scale(1.05);
}

.stock-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
}

.out-of-stock-badge {
    background: #dc3545;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

/* Product Details */
.product-details {
    padding-left: 15px;
}

.product-brand {
    margin-bottom: 5px;
}

.product-brand i {
    color: #6c757d;
    margin-right: 5px;
}

.product-name {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    line-height: 1.3;
}

.product-sku {
    margin-bottom: 8px;
}

.product-description {
    color: #6c757d;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 12px;
}

/* Product Tags */
.product-tags {
    margin-bottom: 12px;
}

.tag {
    background: #e9ecef;
    color: #495057;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    margin-right: 5px;
    margin-bottom: 3px;
    display: inline-block;
}

/* Product Meta */
.product-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px;
    color: #6c757d;
}

.product-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.product-meta i {
    font-size: 11px;
}

.product-stock.low-stock {
    color: #fd7e14;
    font-weight: 600;
}

.product-season {
    color: #28a745;
}

.product-certifications {
    color: #17a2b8;
}

/* Product Purchase */
.product-purchase {
    text-align: center;
    padding-left: 15px;
}

.product-price {
    margin-bottom: 15px;
}

.price-label {
    display: block;
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.price-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

.price-amount, .price-sale {
    font-size: 24px;
    font-weight: 700;
    color: #28a745;
}

.price-original {
    font-size: 16px;
    color: #6c757d;
    text-decoration: line-through;
}

.wholesale-info {
    margin-bottom: 15px;
    padding: 8px;
    background: #e7f3ff;
    border-radius: 6px;
    border-left: 3px solid #17a2b8;
}

/* Quantity Controls */
.quantity-controls {
    margin-bottom: 15px;
}

.quantity-controls label {
    display: block;
    font-size: 12px;
    color: #495057;
    margin-bottom: 8px;
    font-weight: 600;
}

.quantity-input {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 5px;
}

.qty-btn {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
}

.qty-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.qty-btn.minus {
    border-radius: 6px 0 0 6px;
}

.qty-btn.plus {
    border-radius: 0 6px 6px 0;
}

.qty-input {
    width: 60px;
    height: 32px;
    text-align: center;
    border: 1px solid #dee2e6;
    border-left: none;
    border-right: none;
    outline: none;
    font-weight: 600;
}

/* Buttons */
.btn-add-to-cart {
    background: linear-gradient(45deg, #28a745, #20c997);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-add-to-cart:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.btn-out-of-stock {
    background: #6c757d;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    width: 100%;
    cursor: not-allowed;
}

.btn-notify-stock {
    background: #17a2b8;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-notify-stock:hover {
    background: #138496;
    transform: translateY(-1px);
}

/* Category Filter Buttons */
.sidebar-menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.button-product-menu {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    color: #495057;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    font-weight: 500;
}

.button-product-menu:hover,
.button-product-menu.is-checked {
    background: #007bff;
    color: white;
    border-color: #007bff;
    transform: translateX(5px);
}

/* Enhanced Category Display */
.category-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.category-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.category-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.category-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-size: 20px;
    color: white;
}

.category-info h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #2c3e50;
}

.category-info p {
    margin: 5px 0 0 0;
    color: #6c757d;
    font-size: 14px;
}

.category-stats {
    display: flex;
    gap: 20px;
    margin-top: 10px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: #6c757d;
}

/* Responsive Design */
@media (max-width: 768px) {
    .product-header {
        flex-direction: column;
    }
    
    .product-details,
    .product-purchase {
        padding-left: 0;
        margin-top: 15px;
    }
    
    .product-image {
        height: 200px;
        margin-bottom: 15px;
    }
    
    .sidebar-menu-buttons {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .button-product-menu {
        flex: 1;
        min-width: 120px;
    }
    
    .product-meta {
        flex-direction: column;
        gap: 8px;
    }
}

@media (max-width: 576px) {
    .product {
        padding: 15px;
    }
    
    .product-name {
        font-size: 16px;
    }
    
    .price-amount, .price-sale {
        font-size: 20px;
    }
    
    .quantity-input {
        width: 100%;
        max-width: 150px;
    }
}

/* Loading States */
.product.loading {
    opacity: 0.6;
    pointer-events: none;
}

.product.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Success/Error Messages */
.product-message {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    z-index: 20;
    animation: slideDown 0.3s ease;
}

.product-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.product-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
