/* =============================================
   Глобальные переменные и сбросы
   ============================================= */
:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --dark-color: #212529;
    --light-gray: #f8f9fa;
    --border-radius: 0.5rem;
    --box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --box-shadow-hover: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

body {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    background-color: #f5f7fa;
    color: #1e293b;
    line-height: 1.5;
}

/* =============================================
   Навигация
   ============================================= */
.navbar {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 0.75rem 1rem;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #fff, #cfe2ff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent !important;
}

.nav-link {
    font-weight: 500;
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: #ffc107 !important;
}

/* =============================================
   Карточки товаров (главная)
   ============================================= */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    overflow: hidden;
    background: white;
    height: 100%;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow-hover);
}

.card-img-top {
    object-fit: cover;
    height: 200px;
    width: 100%;
    background-color: #e9ecef;
    transition: transform 0.3s ease;
}

.card:hover .card-img-top {
    transform: scale(1.02);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.card-text {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.btn-sm {
    border-radius: 2rem;
    padding: 0.3rem 0.8rem;
    font-size: 0.85rem;
}

/* =============================================
   Фильтры (боковая панель)
   ============================================= */
#categoryFilter .form-check {
    margin-bottom: 0.5rem;
}

#categoryFilter .form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

#priceRange {
    width: 100%;
    margin: 0.5rem 0;
}

#priceValue {
    font-weight: 600;
    color: var(--primary-color);
}

/* =============================================
   Страница товара (детали)
   ============================================= */
.product-image {
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    width: 100%;
    object-fit: cover;
}

.rating-stars {
    color: var(--warning-color);
    font-size: 1.25rem;
    letter-spacing: 2px;
}

.review-item {
    background: var(--light-gray);
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-bottom: 1rem;
    border-left: 4px solid var(--primary-color);
}

/* =============================================
   Корзина и оформление заказа
   ============================================= */
.table-cart thead th {
    background-color: var(--dark-color);
    color: white;
    font-weight: 500;
}

.qty-input {
    max-width: 80px;
    text-align: center;
}

.cart-total {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--success-color);
}

/* =============================================
   Панель продавца (seller_dashboard)
   ============================================= */
.seller-stats {
    background: linear-gradient(135deg, var(--primary-color), #0a58ca);
    color: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.seller-stats h4 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0;
}

.table-product-actions .btn {
    margin: 0 0.2rem;
}

/* =============================================
   Админ-панель
   ============================================= */
.admin-card {
    border-left: 5px solid var(--primary-color);
    margin-bottom: 1.5rem;
    transition: transform 0.2s;
}

.admin-card:hover {
    transform: translateX(5px);
}

/* =============================================
   Модальные окна и уведомления
   ============================================= */
.modal-content {
    border-radius: var(--border-radius);
    border: none;
}

.alert {
    border-radius: var(--border-radius);
    border-left: 5px solid;
}

/* =============================================
   Адаптивность (медиа-запросы)
   ============================================= */
@media (max-width: 768px) {
    .card-img-top {
        height: 150px;
    }
    .navbar-brand {
        font-size: 1.2rem;
    }
    .seller-stats h4 {
        font-size: 1.5rem;
    }
    .table-responsive {
        font-size: 0.85rem;
    }
    .btn {
        font-size: 0.8rem;
    }
}

/* =============================================
   Анимация загрузки (опционально)
   ============================================= */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

#productsList .col {
    animation: fadeIn 0.3s ease-out;
}

/* =============================================
   Стили для пустых состояний
   ============================================= */
.empty-state {
    text-align: center;
    padding: 3rem;
    background: var(--light-gray);
    border-radius: var(--border-radius);
    color: var(--secondary-color);
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* =============================================
   Кнопка "В корзину" - эффект
   ============================================= */
.add-to-cart {
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.add-to-cart:active {
    transform: scale(0.96);
}

/* =============================================
   Формы (общие)
   ============================================= */
.form-control, .form-select {
    border-radius: 0.375rem;
    border: 1px solid #ced4da;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* =============================================
   Футер (если добавите)
   ============================================= */
footer {
    background-color: var(--dark-color);
    color: white;
    padding: 2rem 0;
    margin-top: 3rem;
}
