/* =====================================================
   COMMON COMPONENTS - Reusable across all pages
   ===================================================== */

/* Buttons */
.btn-primary-custom {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: var(--font-sm);
    cursor: pointer;
    transition: opacity var(--transition-fast);
}

.btn-primary-custom:hover:not(:disabled) {
    opacity: 0.9;
}

.btn-primary-custom:disabled {
    background: var(--border);
    color: var(--text-muted);
    cursor: not-allowed;
}

.btn-danger-custom {
    background: linear-gradient(135deg, var(--danger) 0%, #c82333 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: var(--font-sm);
    cursor: pointer;
}

/* Product Cards */
.product-card {
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
    overflow: hidden;
    background: var(--bg-white);
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.product-card .card-img-top {
    height: 200px;
    object-fit: cover;
}

.product-card-body {
    padding: var(--spacing-md);
}

.product-card-title {
    font-size: var(--font-md);
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: var(--spacing-sm);
    min-height: 40px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card-price {
    font-size: var(--font-lg);
    font-weight: 700;
    color: var(--primary);
    margin-bottom: var(--spacing-sm);
}

.product-card-rating {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-bottom: var(--spacing-sm);
}

.product-card-rating i {
    color: var(--accent);
    font-size: var(--font-sm);
}

/* Rating Stars */
.rating-stars {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.rating-stars i {
    color: var(--accent);
    font-size: var(--font-sm);
}

.rating-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    background: #fffbeb;
    border-radius: 16px;
    border: 1px solid rgba(255, 193, 7, 0.2);
}

/* Price Display */
.price-display {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    padding: 8px 14px;
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(40, 167, 69, 0.15);
}

.price-current {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
}

.price-original {
    font-size: 0.95rem;
    color: var(--text-muted);
    text-decoration: line-through;
}

/* Quantity Selector */
.quantity-selector {
    display: inline-flex;
    align-items: center;
    background: var(--bg-light);
    border-radius: 5px;
    border: 1px solid var(--border);
    overflow: hidden;
}

.quantity-selector .qty-btn {
    width: 30px;
    height: 30px;
    border: none;
    background: transparent;
    color: var(--text-dark);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity-selector .qty-btn:hover {
    background: var(--primary);
    color: white;
}

.quantity-selector .qty-input {
    width: 40px;
    height: 30px;
    border: none;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    text-align: center;
    font-size: var(--font-sm);
    font-weight: 600;
    background: white;
}

.quantity-selector .qty-input:focus {
    outline: none;
}

/* Badges */
.badge-stock-in {
    background: #d4edda;
    color: #155724;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: var(--font-xs);
    font-weight: 600;
}

.badge-stock-low {
    background: #fff3cd;
    color: #856404;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: var(--font-xs);
    font-weight: 600;
}

.badge-stock-out {
    background: #f8d7da;
    color: #721c24;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: var(--font-xs);
    font-weight: 600;
}

/* Section Titles */
.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: var(--spacing-lg);
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 50px;
    height: 3px;
    background: var(--primary);
    border-radius: 2px;
}

/* Toast Notifications */
.toast-container-custom {
    position: fixed;
    bottom: 0;
    right: 0;
    padding: var(--spacing-md);
    z-index: 11000;
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 48px;
    color: var(--text-muted);
    margin-bottom: var(--spacing-md);
}

/* Responsive utilities */
@media (max-width: 767px) {
    .hide-mobile {
        display: none !important;
    }
}

@media (min-width: 768px) {
    .hide-desktop {
        display: none !important;
    }
}
