/* ============================================
   styles.css - ГЛАВНАЯ СТРАНИЦА
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ============================================
   БАЗОВЫЕ СТИЛИ - ИСПРАВЛЕНО ДЛЯ ТЕЛЕФОНОВ
   ============================================ */

html, body {
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, 'Helvetica Neue', Arial, sans-serif;
    color: #1a1a1a;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    
    /* ===== ФОН ТОЛЬКО ДЛЯ ДЕСКТОПА ===== */
    background-image: url('/photo/background.webp');
    background-attachment: fixed;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}

/* ===== НА ТЕЛЕФОНАХ ФОН ПОЛНОСТЬЮ УБИРАЕМ ===== */
@media (max-width: 768px) {
    body {
        background-image: none !important;
        background-color: #f5f7fa !important;
    }
    
    /* Убираем фон у контейнера, если есть */
    .main-content {
        background: transparent !important;
    }
    
    .header {
        background: #ffffff !important;
        border-bottom: 1px solid #f0f0f0;
    }
    
    .footer {
        background: #ffffff !important;
        border-top: 1px solid #f0f0f0;
    }
}

@media (max-width: 480px) {
    body {
        background-color: #f5f7fa !important;
    }
}

/* ============================================
   ХЕДЕР
   ============================================ */

.header {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 16px 20px 10px 20px;  /* ← УМЕНЬШИЛ СВЕРХУ */
    background: transparent;
    transform: translateY(0);
    transition: transform 0.3s ease;
}

.header.hidden {
    transform: translateY(-100%);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;  /* ← ОДИНАКОВЫЙ ОТСТУП МЕЖДУ ЛОГО И ВСЕМ */
}

.header-top {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    position: relative;
    padding-top: 0;  /* ← УБРАЛ padding-top */
}

/* ЛОГОТИП ПО ЦЕНТРУ */
.header-logo {
    flex-shrink: 0;
    text-decoration: none;
    transition: opacity 0.3s;
    display: flex;
    align-items: center;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 0;  /* ← УБРАЛ margin-top */
}

.header-logo:hover {
    opacity: 0.7;
}

.header-logo img {
    height: 40px;
    width: auto;
    display: block;
}

/* КОРЗИНА СПРАВА */
.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
    margin-left: auto;
}

.header-actions .cart-link {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #1a1a1a;
    opacity: 0.6;
    transition: opacity 0.3s;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

.header-actions .cart-link:hover {
    opacity: 1;
}

.header-actions .cart-link .cart-badge {
    background: #1a1a1a;
    color: white;
    font-size: 0.55rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* ===== НАВИГАЦИЯ — ПО ЦЕНТРУ ===== */
.header-nav {
    display: flex;
    gap: 28px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    padding: 4px 0;
    width: 100%;
}

.header-nav a {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #1a1a1a;
    opacity: 0.35;
    transition: opacity 0.3s;
    white-space: nowrap;
    padding: 4px 0;
    border-bottom: 2px solid transparent;
    text-decoration: none;
}

.header-nav a:hover,
.header-nav a.active {
    opacity: 1;
    border-bottom-color: #1a1a1a;
}

/* ===== АДАПТИВ ===== */
@media (max-width: 768px) {
    .header-top {
        flex-direction: column;
        gap: 8px;
    }
    
    .header-actions {
        margin-left: auto;
    }
    
    .header-nav {
        gap: 16px;
    }
    
    .header-nav a {
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    .header-logo img {
        height: 30px;
    }
    
    .header-nav {
        gap: 10px;
    }
    
    .header-nav a {
        font-size: 0.6rem;
        padding: 0 8px;
        letter-spacing: 0.3px;
    }
    
    .header-actions .cart-link {
        font-size: 0.65rem;
    }
}

/* ============================================
   ОСНОВНОЙ КОНТЕНТ
   ============================================ */

.main-content {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 40px;
    width: 100%;
    position: relative;
    z-index: 1;
}

/* ============================================
   СЕТКА ТОВАРОВ
   ============================================ */

.product-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px 16px;
    padding: 10px 0;
}

@media (max-width: 1200px) {
    .product-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 18px 14px;
    }
}

@media (max-width: 900px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px 12px;
    }
}

@media (max-width: 600px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px 10px;
    }
}

@media (max-width: 480px) {
    .product-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px 6px;
    }
}

/* ============================================
   КАРТОЧКА ТОВАРА
   ============================================ */

.product-card {
    display: block;
    text-decoration: none;
    color: inherit;
    background: transparent;
    transition: transform 0.12s ease;
    border-radius: 0;
    overflow: hidden;
}

.product-card:hover {
    transform: translateY(-2px);
}

.product-image-container {
    width: 100%;
    aspect-ratio: 3 / 4;
    background: rgba(245, 245, 245, 0.8);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.no-image-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #ccc;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(248, 248, 248, 0.8);
}

.no-image-placeholder .icon {
    font-size: 2.5rem;
    margin-bottom: 6px;
    opacity: 0.3;
}

.discount-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: #dc3545;
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 3px;
    z-index: 2;
}

.product-info {
    padding: 8px 4px 4px 4px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    background: transparent;
    width: 100%;
}

.product-title {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.2px;
    color: #1a1a1a;
    line-height: 1.3;
    order: 2;
}

/* ============================================
   ЦЕНЫ В КАРТОЧКАХ ТОВАРОВ
   ============================================ */

.product-price-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    order: 1;
}

/* ОБЫЧНАЯ ЦЕНА — ЧЁРНЫЙ ФОН */
.product-price {
    color: #ffffff !important;
    background: #1a1a1a !important;
    padding: 3px 12px !important;
    border-radius: 3px !important;
    display: inline-block !important;
    font-size: 0.8rem !important;
    font-weight: 700 !important;
}

/* ЦЕНА СО СКИДКОЙ — КРАСНЫЙ ФОН */
.product-price.discounted {
    color: #ffffff !important;
    background: #dc3545 !important;
    padding: 3px 12px !important;
    border-radius: 3px !important;
    display: inline-block !important;
    font-size: 0.8rem !important;
    font-weight: 700 !important;
}

/* СТАРАЯ ЦЕНА */
.product-old-price {
    font-size: 0.85rem !important;
    color: #999 !important;
    text-decoration: line-through !important;
    font-weight: 600 !important;
}

/* ПРОЦЕНТ СКИДКИ — ЗЕЛЁНЫЙ ТЕКСТ, БЕЗ ФОНА */
.product-discount-percent {
    font-size: 0.9rem !important;
    font-weight: 800 !important;
    color: #28a745 !important;
    background: transparent !important;
    padding: 0 !important;
    border-radius: 0 !important;
    display: inline-block !important;
}

.product-sizes {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 6px 0 4px 0;
    order: 3;
}

.product-sizes .size-badge {
    display: inline-block;
    padding: 2px 8px;
    border: 1px solid #1a1a1a;
    border-radius: 3px;
    font-size: 0.55rem;
    font-weight: 600;
    color: #1a1a1a;
    background: transparent;
    letter-spacing: 0.3px;
}

.product-sizes .size-badge.out-of-stock {
    border-color: #e0e0e0;
    color: #ccc;
    opacity: 0.6;
}

.product-sizes .no-sizes {
    font-size: 0.6rem;
    color: #999;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.empty-catalog {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
}

.empty-catalog .icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.3;
}

.empty-catalog h3 {
    font-size: 1.5rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 10px;
    color: #1a1a1a;
}

.empty-catalog p {
    font-size: 0.9rem;
    color: #888;
}

/* ============================================
   ПОДВАЛ
   ============================================ */

.footer {
    background: transparent;
    padding: 2rem 20px 1.5rem;
    text-align: center;
    flex-shrink: 0;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 24px;
}

.footer-nav a {
    color: #1a1a1a;
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: opacity 0.2s;
    padding: 4px 0;
}

.footer-nav a:hover {
    opacity: 0.6;
}

.footer-bottom {
    font-size: 0.7rem;
    letter-spacing: 0.3px;
    color: #1a1a1a;
    opacity: 0.7;
}

/* ============================================
   АДАПТИВ
   ============================================ */

@media (max-width: 768px) {
    .header-top {
        flex-direction: column;
        gap: 8px;
    }
    
    .header-actions {
        margin-left: auto;
    }
    
    .header-nav {
        gap: 16px;
    }
    
    .header-nav a {
        font-size: 0.7rem;
    }
    
    .footer-nav {
        gap: 6px 18px;
    }
    .footer-nav a {
        font-size: 0.65rem;
    }
    .footer-bottom {
        font-size: 0.6rem;
    }
}

@media (max-width: 480px) {
    .header-logo img {
        height: 30px;
    }
    
    .header-nav {
        gap: 10px;
    }
    
    .header-nav a {
        font-size: 0.6rem;
        padding: 0 8px;
        letter-spacing: 0.3px;
    }
    
    .header-actions .cart-link {
        font-size: 0.65rem;
    }
    
    .footer {
        padding: 1.5rem 16px 1rem;
    }
    .footer-nav {
        flex-direction: column;
        gap: 4px;
        align-items: center;
    }
    .footer-nav a {
        font-size: 0.6rem;
        padding: 3px 0;
    }
    .footer-bottom {
        font-size: 0.55rem;
    }
}

/* ============================================
   ФИКСЫ ДЛЯ ОТОБРАЖЕНИЯ
   ============================================ */

.product-grid {
    display: grid !important;
    min-height: 200px !important;
}

.product-card {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.product-image {
    display: block !important;
}

.product-info {
    display: flex !important;
}

.product-title {
    display: block !important;
}

.product-price {
    display: inline-block !important;
} 

/* ============================================
   МОБИЛЬНАЯ АДАПТАЦИЯ - ДОПОЛНИТЕЛЬНЫЕ СТИЛИ
   ============================================ */

/* ===== ОБЩИЕ УЛУЧШЕНИЯ ДЛЯ ТЕЛЕФОНОВ ===== */
@media (max-width: 768px) {
    /* Увеличиваем отступы для удобства */
    .main-content {
        padding: 0 12px 30px;
    }
    
    /* Улучшаем скролл */
    body {
        -webkit-overflow-scrolling: touch;
        overflow-x: hidden;
    }
    
    /* Убираем эффект нажатия на телефонах */
    * {
        -webkit-tap-highlight-color: transparent;
    }
    
    /* Кнопки больше для пальцев */
    .btn,
    button,
    .qty-btn,
    .size-btn,
    .add-to-cart-btn,
    .checkout-btn,
    .sbp-btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Улучшаем читаемость */
    .product-title {
        font-size: 0.8rem;
    }
    
    .product-price {
        font-size: 0.75rem !important;
        padding: 2px 10px !important;
    }
    
    /* Карточки товаров */
    .product-grid {
        gap: 10px 6px;
    }
    
    .product-image-container {
        aspect-ratio: 3 / 4;
    }
    
    /* Размеры в карточках */
    .product-sizes .size-badge {
        font-size: 0.5rem;
        padding: 1px 6px;
    }
}

/* ===== ДЛЯ МАЛЕНЬКИХ ТЕЛЕФОНОВ (до 480px) ===== */
@media (max-width: 480px) {
    .main-content {
        padding: 0 8px 20px;
    }
    
    .product-grid {
        gap: 8px 4px;
    }
    
    .product-title {
        font-size: 0.7rem;
    }
    
    .product-price {
        font-size: 0.65rem !important;
        padding: 2px 8px !important;
    }
    
    .product-old-price {
        font-size: 0.7rem !important;
    }
    
    .product-discount-percent {
        font-size: 0.75rem !important;
    }
    
    .product-sizes .size-badge {
        font-size: 0.45rem;
        padding: 1px 4px;
    }
    
    .discount-badge {
        font-size: 0.5rem;
        padding: 2px 6px;
    }
}

/* ===== УЛУЧШЕНИЯ ДЛЯ СЕНСОРНЫХ ЭКРАНОВ ===== */
@media (hover: none) and (pointer: coarse) {
    /* Убираем hover-эффекты на телефонах (они не работают) */
    .product-card:hover {
        transform: none;
    }
    
    .stat-card:hover {
        transform: none;
    }
    
    .gallery-thumb:hover {
        border-color: transparent;
    }
    
    /* Делаем кнопки более заметными при нажатии */
    .btn:active,
    button:active,
    .product-card:active {
        transform: scale(0.97);
        transition: transform 0.1s ease;
    }
}