/* Stock Status Styles for Product Cards */

/* Base stock status styling */
.product-stock-status,
.product-card__stock {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 8px 0 12px 0;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 4px;
    background-color: #f8f9fa;
    transition: all 0.2s ease;
    max-width: fit-content;
}

.product-stock-status i,
.product-card__stock i {
    font-size: 0.9rem;
    flex-shrink: 0;
}

/* In Stock - Green Theme */
.stock-status-in_stock {
    color: #155724 !important;
    background-color: #d4edda !important;
    border-left: 3px solid #28a745;
}

.stock-status-in_stock i {
    color: #28a745;
}

/* Low Stock - Orange/Yellow Theme */
.stock-status-low_stock {
    color: #856404 !important;
    background-color: #fff3cd !important;
    border-left: 3px solid #ffc107;
}

.stock-status-low_stock i {
    color: #ffc107;
}

/* Out of Stock - Red Theme */
.stock-status-out_of_stock {
    color: #721c24 !important;
    background-color: #f8d7da !important;
    border-left: 3px solid #dc3545;
}

.stock-status-out_of_stock i {
    color: #dc3545;
}

/* Component-specific adjustments */

/* Deal Product Component */
.card-product.style-5 .product-stock-status {
    margin: 6px 0 10px 0;
    font-size: 0.8rem;
}

/* Featured Product Component (Mini style) */
.product-style_list-mini .product-stock-status {
    margin: 6px 0 8px 0;
    font-size: 0.75rem;
    padding: 3px 6px;
}

/* List view in shop */
.product-info_list .product-card__stock {
    font-size: 0.9rem;
    margin: 10px 0;
    padding: 6px 10px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .product-stock-status,
    .product-card__stock {
        font-size: 0.75rem;
        padding: 3px 6px;
        margin: 6px 0 8px 0;
    }
    
    .product-stock-status i,
    .product-card__stock i {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .product-stock-status,
    .product-card__stock {
        font-size: 0.7rem;
        padding: 2px 4px;
        gap: 4px;
    }
    
    /* Hide quantity on very small screens for low stock to save space */
    .stock-status-low_stock span {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 120px;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .stock-status-in_stock {
        border-left-width: 4px;
        font-weight: 600;
    }
    
    .stock-status-low_stock {
        border-left-width: 4px;
        font-weight: 600;
    }
    
    .stock-status-out_of_stock {
        border-left-width: 4px;
        font-weight: 600;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .product-stock-status,
    .product-card__stock {
        transition: none;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    /* In Stock - Dark Mode */
    .stock-status-in_stock {
        color: #c3e6cb !important;
        background-color: #1e3e22 !important;
        border-left-color: #20c997;
    }
    
    .stock-status-in_stock i {
        color: #20c997;
    }
    
    /* Low Stock - Dark Mode */
    .stock-status-low_stock {
        color: #ffedb3 !important;
        background-color: #3e3419 !important;
        border-left-color: #ffd700;
    }
    
    .stock-status-low_stock i {
        color: #ffd700;
    }
    
    /* Out of Stock - Dark Mode */
    .stock-status-out_of_stock {
        color: #f5c6cb !important;
        background-color: #3e1e23 !important;
        border-left-color: #e74c3c;
    }
    
    .stock-status-out_of_stock i {
        color: #e74c3c;
    }
}

/* Disabled Button Styles for Out of Stock Products */
.tf-btn:disabled,
.tf-btn[disabled],
.product-card__cta:disabled,
.product-card__cta[disabled],
.product-card__cta--disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
    background-color: #6c757d !important;
    border-color: #6c757d !important;
    color: #ffffff !important;
    pointer-events: none !important;
}

.tf-btn:disabled:hover,
.tf-btn[disabled]:hover,
.product-card__cta:disabled:hover,
.product-card__cta[disabled]:hover,
.product-card__cta--disabled:hover {
    background-color: #6c757d !important;
    border-color: #6c757d !important;
    color: #ffffff !important;
    transform: none !important;
    box-shadow: none !important;
}

/* Specific styling for out of stock buttons */
.tf-btn:disabled span,
.tf-btn[disabled] span,
.product-card__cta:disabled,
.product-card__cta[disabled],
.product-card__cta--disabled {
    font-weight: 500;
    font-size: 0.9rem;
}

/* Override any theme-specific button styles when disabled */
.tf-btn.btn-fill:disabled,
.tf-btn.btn-outline:disabled {
    background-color: #6c757d !important;
    border-color: #6c757d !important;
    color: #ffffff !important;
}

/* Animation disable for out of stock buttons */
.tf-btn:disabled.animate-btn,
.tf-btn[disabled].animate-btn {
    transition: none !important;
    animation: none !important;
}

/* Print Styles */
@media print {
    .product-stock-status,
    .product-card__stock {
        background: transparent !important;
        color: #000 !important;
        border: 1px solid #000 !important;
        border-left-width: 3px !important;
    }
    
    .product-stock-status i,
    .product-card__stock i {
        display: none; /* Hide icons in print */
    }
    
    /* Hide disabled buttons in print */
    .tf-btn:disabled,
    .product-card__cta:disabled {
        display: none !important;
    }
}
