/* critical.css - Критичные стили для мгновенного рендеринга */

/* ========================================
   БАЗОВЫЕ СТИЛИ
   ======================================== */

body {
    font-family: 'Montserrat', sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

* {
    box-sizing: border-box;
}

/* ========================================
   HEADER (видимый сразу)
   ======================================== */

.header,
header {
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 50;
    padding: 1rem 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========================================
   HERO СЕКЦИЯ (первый экран)
   ======================================== */

.hero-section {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
    padding-top: 80px;
}

.hero-section h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero-section p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

/* ========================================
   НАВИГАЦИЯ
   ======================================== */

.desktop-nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 2rem;
}

.nav-item a {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-item a:hover {
    color: #dc2626;
}

/* ========================================
   СЕТКА ПРОДУКТОВ (видимая часть)
   ======================================== */

.product-grid,
#popular-products,
#products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    padding: 40px 0;
}

.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    min-height: 350px;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.product-image {
    height: 200px;
    object-fit: cover;
    width: 100%;
    object-position: center center;
    flex-shrink: 0;
}

.product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1rem;
}

.product-info h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    min-height: 48px;
    display: flex;
    align-items: center;
}

.product-info p {
    color: #666;
    font-size: 0.875rem;
    flex: 1;
    margin-bottom: 0.75rem;
}

/* ========================================
   КНОПКИ
   ======================================== */

.btn-primary {
    background: #dc2626;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    display: inline-block;
    transition: background 0.3s ease;
    border: none;
    cursor: pointer;
    font-weight: 600;
    text-align: center;
}

.btn-primary:hover {
    background: #c01d2b;
}

.btn-secondary {
    background: #6b7280;
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    display: inline-block;
    transition: background 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
}

.btn-secondary:hover {
    background: #4b5563;
}

/* ========================================
   КОРЗИНА (боковая панель)
   ======================================== */

.cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: white;
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    transition: right 0.3s ease;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.cart-sidebar.open {
    right: 0;
}

/* ========================================
   ЗАГОЛОВКИ СЕКЦИЙ
   ======================================== */

.section-header {
    color: #2d3748;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    border-bottom: 3px solid #dc2626;
    padding-bottom: 0.5rem;
    display: inline-block;
}

/* ========================================
   МОБИЛЬНАЯ АДАПТАЦИЯ
   ======================================== */

@media (max-width: 768px) {
    .hero-section {
        min-height: 80vh;
        padding: 60px 20px 20px;
    }
    
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .hero-section p {
        font-size: 1rem;
    }
    
    .product-grid,
    #popular-products,
    #products-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 15px;
        padding: 20px 0;
    }
    
    .product-card {
        min-height: 300px;
    }
    
    .product-image {
        height: 160px;
    }
    
    .container {
        padding: 0 15px;
    }
    
    .cart-sidebar {
        width: 100vw;
        right: -100vw;
    }
    
    .desktop-nav {
        display: none;
    }
}

@media (max-width: 480px) {
    .product-grid,
    #popular-products,
    #products-grid {
        grid-template-columns: 1fr;
    }
    
    .product-card {
        min-height: 280px;
    }
    
    .product-image {
        height: 140px;
    }
    
    .hero-section h1 {
        font-size: 1.75rem;
    }
}

/* ========================================
   LOADING STATES (для плавности)
   ======================================== */

.loading {
    opacity: 0.6;
    pointer-events: none;
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========================================
   СКРЫТИЕ ЭЛЕМЕНТОВ ДО ЗАГРУЗКИ TAILWIND
   ======================================== */

/* Скрываем элементы с Tailwind классами, пока они не загрузились */
.tailwind-ready {
    visibility: visible;
}

.tailwind-loading {
    visibility: hidden;
}