/* Modern Light Theme - Mobile Optimized */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Safe Area Insets (will be set by JavaScript) */
    --safe-area-inset-top: 0px;
    --safe-area-inset-bottom: 0px;
    --safe-area-inset-left: 0px;
    --safe-area-inset-right: 0px;
    --viewport-height: 100vh;
    
    /* Light Theme Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #f1f3f5;
    --bg-card: #ffffff;
    --bg-hover: #e9ecef;
    --bg-glass: rgba(255, 255, 255, 0.95);
    
    --text-primary: #1a1a1a;
    --text-secondary: #6c757d;
    --text-tertiary: #adb5bd;
    
    /* Warm Neutral Accent Colors */
    --accent-primary: #495057;
    --accent-secondary: #6c757d;
    --accent-gradient: linear-gradient(135deg, #495057 0%, #6c757d 100%);
    --accent-gradient-hover: linear-gradient(135deg, #6c757d 0%, #868e96 100%);
    
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #3b82f6;
    
    --border-color: rgba(0, 0, 0, 0.08);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-glow: 0 0 16px rgba(73, 80, 87, 0.15);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 12px;
    --spacing-lg: 16px;
    --spacing-xl: 24px;
    
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    font-size: 14px;
    padding-top: 0 !important;
    position: relative;
    margin: 0;
}

/* Fullscreen tweaks */
body.fullscreen {
    height: 100vh;
    overscroll-behavior-y: contain;
    padding-top: calc(60px + env(safe-area-inset-top, 0px));
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
}

/* White background for top safe area - убран на всех устройствах */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 0 !important;
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    background: transparent;
    z-index: -1;
    pointer-events: none;
}

/* System Bar Cart Button - адаптивная позиция */
/* Мобильная версия по умолчанию - между системными кнопками Telegram */
.system-bar-cart {
    position: fixed !important;
    top: 56px !important;
    left: 0 !important;
    right: 0 !important;
    height: 28px !important;
    z-index: 10001 !important;
    pointer-events: none !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    width: 100% !important;
}

/* Скрываем кнопку корзины на странице корзины */
.system-bar-cart.hidden-on-cart-page {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* ПК версия - кнопка центрирована вместе с контентом */
@media (min-width: 768px) {
    .system-bar-cart {
        top: 12px !important;
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%) !important;
        height: auto !important;
        justify-content: center !important;
        width: auto !important;
        max-width: 1400px !important;
        padding-left: 24px !important;
        padding-right: 24px !important;
        box-sizing: border-box !important;
    }
    
    .cart-btn-system {
        height: 40px !important;
        padding: 0 16px !important;
        font-size: 14px !important;
        border-radius: 12px !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
    }
    
    .cart-btn-system svg {
        width: 18px !important;
        height: 18px !important;
    }
    
    .cart-btn-system .cart-btn-text {
        font-size: 14px !important;
    }
    
    .cart-btn-system .cart-btn-count {
        min-width: 22px !important;
        height: 22px !important;
        font-size: 12px !important;
    }
}

.cart-btn-system {
    background: #e3e3e3;
    border: none;
    border-radius: 10px;
    height: 28px;
    padding: 0 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    transition: all var(--transition-base);
    font-size: 13px;
    font-weight: 500;
    color: rgba(0, 0, 0, 0.7);
    min-width: auto;
    white-space: nowrap;
    pointer-events: all;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Display', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: -0.08px;
    margin: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Зеленый стиль когда в корзине есть товары - цвет матчи */
.cart-btn-system.has-items {
    background: #4a7c59;
    color: white;
}

.cart-btn-system svg {
    stroke: currentColor;
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    transition: all var(--transition-base);
    stroke-width: 2;
}

.cart-btn-system .cart-btn-text {
    font-size: 13px;
    font-weight: 400;
    letter-spacing: -0.08px;
    color: inherit;
    line-height: 1.2;
}

.cart-btn-system .cart-btn-count {
    background: rgba(255, 255, 255, 0.3);
    color: white;
    border-radius: 10px;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    padding: 0 5px;
    margin-left: 3px;
    transition: all var(--transition-base);
    line-height: 1;
}

.cart-btn-system.has-items .cart-btn-count {
    background: rgba(255, 255, 255, 0.25);
}

.cart-btn-system[data-count="0"] .cart-btn-count {
    display: none;
}

.cart-btn-system:hover {
    background: #d4d4d4;
}

.cart-btn-system.has-items:hover {
    background: #5a8c5a;
}

.cart-btn-system:active {
    background: #c5c5c5;
    transform: scale(0.98);
}

.cart-btn-system.has-items:active {
    background: #3a6c49;
    opacity: 0.9;
}

/* Header - Clean & Minimal (скрыт) */
.header {
    display: none;
    position: sticky;
    top: 80px !important;
    z-index: 100;
    background: var(--bg-glass);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    margin-top: 0 !important;
    height: 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    max-width: 100%;
}

.logo {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.3px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.logo-icon {
    stroke: var(--text-primary);
    fill: none;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
}

.header-actions {
    display: flex;
    gap: var(--spacing-xs);
}

.icon-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
}

.icon-btn svg {
    stroke: var(--text-primary);
    width: 18px;
    height: 18px;
    transition: all var(--transition-base);
}

.icon-btn:hover svg {
    stroke: var(--accent-primary);
    transform: scale(1.1);
}

.icon-btn:hover {
    background: var(--bg-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
    border-color: var(--accent-primary);
}

.icon-btn:active {
    transform: translateY(0);
}

.icon-btn {
    position: relative;
}

.icon-btn[data-count]:not([data-count="0"])::after {
    content: attr(data-count);
    position: absolute;
    top: -10px;
    right: -10px;
    background: var(--accent-primary);
    color: white;
    border-radius: 10px;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    padding: 0 4px;
    box-shadow: var(--shadow-sm);
    border: 2px solid var(--bg-primary);
    z-index: 1;
    pointer-events: none;
}

/* Cart Button - System Button Style */
.cart-btn-header {
    background: rgba(0, 0, 0, 0.05);
    border: none;
    border-radius: 18px;
    height: 36px;
    padding: 0 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    transition: all var(--transition-base);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    min-width: auto;
    white-space: nowrap;
}

.cart-btn-header svg {
    stroke: currentColor;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    transition: all var(--transition-base);
}

.cart-btn-text {
    font-size: 14px;
    font-weight: 500;
    letter-spacing: -0.1px;
}

.cart-btn-count {
    background: var(--accent-primary);
    color: white;
    border-radius: 10px;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    padding: 0 6px;
    margin-left: 2px;
    transition: all var(--transition-base);
}

.cart-btn-header[data-count="0"] .cart-btn-count {
    display: none;
}

.cart-btn-header:hover {
    background: rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.cart-btn-header:active {
    transform: translateY(0);
    background: rgba(0, 0, 0, 0.1);
}

.cart-btn-header:hover .cart-btn-count {
    background: var(--accent-secondary);
    transform: scale(1.05);
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 70px);
    padding-bottom: 70px;
    padding-top: 84px; /* Отступ для системной панели + кнопка корзины (будет обновлено динамически) */
    margin-top: 0;
    margin-left: 0;
    margin-right: 0;
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* На ПК контент центрирован с ограниченной шириной (как приложение) */
@media (min-width: 768px) {
    .main-content {
        max-width: 1400px !important;
        margin-left: auto !important;
        margin-right: auto !important;
        padding-left: 24px !important;
        padding-right: 24px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
}

/* На ПК отступ сверху достаточный, чтобы товары были под кнопкой корзины */
/* Контент центрирован с ограниченной шириной (как приложение) */
@media (min-width: 768px) {
    .main-content {
        padding-top: 60px !important; /* 12px (отступ сверху) + 40px (высота кнопки) + 8px (зазор) */
        margin-top: 0 !important;
        max-width: 1400px !important;
        margin-left: auto !important;
        margin-right: auto !important;
        padding-left: 24px !important;
        padding-right: 24px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
}

.page {
    display: block;
    animation: fadeInUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

#productPage {
    position: relative;
    margin: 0;
    padding: 0;
    width: 100%;
}

.page.hidden {
    display: none;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading - Compact Spinner */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 50vh;
    gap: var(--spacing-md);
}

.loading.hidden {
    display: none;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--bg-tertiary);
    border-top-color: var(--accent-primary);
    border-right-color: var(--accent-secondary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading p {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
}

/* Catalog - Compact Grid */
.catalog-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 12px 12px 12px 12px;
    max-width: 100%;
    position: relative;
    justify-items: stretch;
    align-items: stretch;
}

/* Логотип и товары в мобильной версии */
@media (max-width: 767px) {
    /* Все товары - 3:4 в две колонки */
    .catalog-grid .product-card .product-image,
    #catalogGrid .product-card .product-image {
        aspect-ratio: 3 / 4 !important;
    }
}

/* Категории полностью скрыты */
.categories-filter,
.catalog-grid > .categories-filter,
.catalog-grid .categories-filter {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
}

.category-filter-btn {
    display: none !important;
    visibility: hidden !important;
}

/* ПК версия - адаптивная сетка для лучшей заполняемости */
@media (min-width: 768px) {
    .catalog-grid {
        gap: 20px !important;
        padding: 32px !important;
        width: 100% !important;
        justify-items: stretch !important;
        justify-content: center !important;
        place-items: stretch !important;
    }
    
    /* На средних экранах (планшеты) - 3 товара в ряд (если не задано inline) */
    @media (min-width: 768px) and (max-width: 1023px) {
        .catalog-grid:not([style*="grid-template-columns"]) {
            grid-template-columns: repeat(3, 1fr) !important;
            gap: 20px !important;
        }
    }
    
    /* На больших экранах - адаптивная сетка (если не задано inline) */
    @media (min-width: 1024px) {
        .catalog-grid:not([style*="grid-template-columns"]) {
            grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)) !important;
            gap: 24px !important;
            max-width: 1400px !important;
        }
    }
}

/* Categories Filter - скрыты */
.categories-filter {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

@media (min-width: 768px) {
    .categories-filter,
    .catalog-grid > .categories-filter,
    .catalog-grid .categories-filter {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        height: 0 !important;
        width: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
    }
    
    .category-filter-btn {
        display: none !important;
        visibility: hidden !important;
    }
}

.category-filter-btn {
    padding: 10px 20px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: var(--bg-card);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    box-shadow: var(--shadow-sm);
}

.category-filter-btn:hover {
    background: var(--bg-secondary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.category-filter-btn.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-md);
}

.category-filter-btn.active:hover {
    background: var(--accent-primary);
    opacity: 0.9;
}

.product-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--transition-base);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: var(--shadow-sm);
    width: 100%;
    max-width: 100%;
    min-height: 100%;
}

/* Логотип карточка */
.logo-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    width: 100%;
    max-width: 100%;
    min-height: 100%;
}

.logo-image {
    width: 100%;
    max-width: 200px;
    height: auto;
    object-fit: contain;
    margin-bottom: 12px;
}

.logo-text {
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
    margin: 0;
    font-weight: 400;
    line-height: 1.4;
}

@media (max-width: 767px) {
    .logo-card {
        padding: 16px;
    }
    
    .logo-image {
        max-width: 120px;
    }
    
    .logo-text {
        font-size: 10px;
    }
}

/* На ПК карточки товаров занимают всю доступную ширину в ячейке сетки */
@media (min-width: 768px) {
    .product-card {
        max-width: 100%;
        width: 100%;
        min-height: 100%;
        border-radius: 16px;
        box-shadow: var(--shadow-md);
    }
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent-primary);
}

.product-image {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background: transparent;
    transition: transform var(--transition-slow);
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
}

/* Стили для первого товара уже определены выше в @media (max-width: 767px) */

@media (min-width: 768px) {
    .product-image {
        aspect-ratio: 3 / 4;
    }
}

.product-card:hover .product-image {
    transform: scale(1.05);
}

.product-info {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    justify-content: space-between;
}

@media (min-width: 768px) {
    .product-info {
        padding: 16px;
        gap: 12px;
    }
}

.product-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    letter-spacing: -0.2px;
    min-height: 2.8em;
    transition: color 0.2s ease;
}

@media (min-width: 768px) {
    .product-name {
        font-size: 16px;
        min-height: 3em;
        line-height: 1.5;
    }
}

.product-card:hover .product-name {
    color: var(--accent-primary);
}

.product-description {
    display: none;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 6px;
    border-top: 1px solid var(--border-color);
    gap: 6px;
}

.product-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--accent-primary);
    letter-spacing: -0.3px;
    white-space: nowrap;
    background: linear-gradient(135deg, var(--accent-primary) 0%, #495057 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
    position: relative;
}

@media (min-width: 768px) {
    .product-price {
        font-size: 20px;
        letter-spacing: -0.4px;
    }
}

.product-price::after {
    content: ' ₽';
    -webkit-text-fill-color: var(--accent-primary);
    background: none;
}

/* Fallback для браузеров без поддержки background-clip */
@supports not (-webkit-background-clip: text) {
    .product-price {
        color: var(--accent-primary);
        background: none;
    }
}

/* Unified Cart Control Button */
.cart-control-btn {
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 5px 10px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
    white-space: nowrap;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 80px;
    height: 28px;
}

.cart-control-btn:hover {
    background: var(--accent-secondary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.cart-control-btn:active {
    transform: translateY(0);
}

/* Active state - when item is in cart */
.cart-control-btn-active {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    padding: 2px;
    gap: 4px;
    min-width: 90px;
}

.cart-control-btn-active:hover {
    background: var(--bg-hover);
    transform: translateY(-1px);
}

.cart-control-minus,
.cart-control-plus {
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all var(--transition-base);
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.cart-control-minus:hover,
.cart-control-plus:hover {
    background: var(--bg-hover);
}

.cart-control-minus:active,
.cart-control-plus:active {
    transform: scale(0.95);
}

.cart-control-minus svg,
.cart-control-plus svg {
    stroke: var(--text-primary);
    width: 14px;
    height: 14px;
}

.cart-control-quantity {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
    min-width: 20px;
    text-align: center;
    flex-shrink: 0;
}

/* Legacy support */
.add-to-cart-btn {
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 5px 10px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
    white-space: nowrap;
    flex-shrink: 0;
}

.add-to-cart-btn:hover {
    background: var(--accent-secondary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.add-to-cart-btn:active {
    transform: translateY(0);
}

@media (min-width: 768px) {
    .add-to-cart-btn {
        padding: 8px 16px;
        font-size: 13px;
        border-radius: 10px;
        font-weight: 700;
    }
}

/* Product Category Path */
.product-category-path {
    margin-bottom: 12px;
    font-size: 13px;
    color: var(--text-secondary);
    padding: 0 12px;
    font-weight: 500;
    opacity: 0.8;
}

@media (min-width: 768px) {
    .product-category-path {
        padding: 0 24px;
        font-size: 14px;
        margin-bottom: 16px;
    }
}

/* Product Details */
.product-details {
    padding: 0;
    padding-bottom: 12px;
    max-width: 100%;
    width: 100%;
    position: relative;
    margin: 0;
    display: flex;
    flex-direction: column;
}

/* На ПК страница товара с такими же отступами как каталог */
/* Компоновка: фото слева, информация справа */
@media (min-width: 768px) {
    .main-content .product-details,
    #productDetails.product-details,
    .product-details {
        padding: 24px !important;
        padding-bottom: 12px !important;
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 auto !important;
        display: flex !important;
        flex-direction: row !important;
        gap: 32px !important;
        align-items: flex-start !important;
        box-sizing: border-box !important;
    }
}

/* Контейнер для изображений товара */
.product-details-images {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    width: 100% !important;
    align-items: stretch !important;
    background: transparent !important;
    margin-bottom: 6px !important;
}

.product-details-image {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border-radius: 20px;
    margin: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
    border: none;
    display: block;
    position: relative;
    touch-action: pan-y pan-x pinch-zoom; /* Разрешаем прокрутку в любом направлении */
    user-select: none;
    -webkit-user-select: none;
}

/* Контейнер для изображения с поддержкой свайпа на мобильных */
.product-details-image-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    touch-action: pan-y pan-x; /* Разрешаем и вертикальную, и горизонтальную прокрутку */
    background: transparent !important;
}

/* На ПК контейнер изображения должен быть справа от миниатюр */
@media (min-width: 768px) {
    .product-details-image-container {
        order: 2 !important;
        background: transparent !important;
    }
}

/* Индикаторы точек для свайпа (мобильная версия) */
.product-image-indicators {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 12px 0;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.4), transparent);
    pointer-events: none;
    z-index: 5;
}

.product-image-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
    pointer-events: none;
}

.product-image-indicator.active {
    background: rgba(255, 255, 255, 1);
    width: 24px;
    border-radius: 4px;
}

/* Подсказка о свайпе (показывается только если есть несколько фото) */
.product-swipe-hint {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    pointer-events: none;
    animation: swipeHintPulse 2s ease-in-out infinite;
    z-index: 10;
}

@keyframes swipeHintPulse {
    0%, 100% { opacity: 0.7; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
}

.product-swipe-hint svg {
    width: 14px;
    height: 14px;
}

/* Стрелки навигации по изображениям (мобильная версия) */
.product-image-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.3);
    color: white;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 15;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.product-image-nav:hover {
    background: rgba(0, 0, 0, 0.5);
    transform: translateY(-50%) scale(1.1);
}

.product-image-nav:active {
    transform: translateY(-50%) scale(0.95);
}

.product-image-nav svg {
    width: 20px;
    height: 20px;
    stroke: white;
}

.product-image-nav-prev {
    left: 12px;
}

.product-image-nav-next {
    right: 12px;
}

/* Улучшенные индикаторы - делаем их более заметными */
.product-image-indicators {
    background: transparent !important;
    padding: 16px 0 !important;
}

.product-image-indicator {
    width: 10px !important;
    height: 10px !important;
    background: rgba(255, 255, 255, 0.6) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3) !important;
}

.product-image-indicator.active {
    background: rgba(255, 255, 255, 1) !important;
    width: 32px !important;
    height: 10px !important;
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.5) !important;
}

/* Миниатюры - скрыты на мобильных, показываются только на ПК */
.product-thumbnails {
    display: none !important; /* Скрыты по умолчанию на мобильных */
    flex-direction: row !important;
    gap: 8px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    padding: 4px 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none !important; /* Firefox - скрыть scrollbar */
    -ms-overflow-style: none !important; /* IE и Edge - скрыть scrollbar */
    flex-shrink: 0 !important;
}

/* Скрыть scrollbar для Chrome, Safari и Opera */
.product-thumbnails::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

.product-thumbnails::-webkit-scrollbar-thumb {
    display: none !important;
}

.product-thumbnail {
    width: 60px !important;
    height: 60px !important;
    min-width: 60px !important;
    min-height: 60px !important;
    max-width: 60px !important;
    max-height: 60px !important;
    object-fit: cover !important;
    border-radius: var(--radius-sm) !important;
    border: 2px solid transparent !important;
    cursor: pointer !important;
    transition: all var(--transition-base) !important;
    flex-shrink: 0 !important;
    background: var(--bg-tertiary) !important;
    display: block !important;
}

.product-thumbnail:hover {
    border-color: var(--accent-primary);
    transform: scale(1.05);
}

.product-thumbnail.active {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

/* На ПК фото слева, фиксированная ширина, миниатюры сбоку */
@media (min-width: 768px) {
    .product-details-images {
        flex-direction: row !important;
        width: 700px !important;
        min-width: 700px !important;
        max-width: 700px !important;
        flex-shrink: 0 !important;
        gap: 16px !important;
        align-items: flex-start !important;
        background: transparent !important;
        margin-bottom: 6px !important;
    }
    
    .product-details-image {
        width: 600px !important;
        min-width: 600px !important;
        max-width: 600px !important;
        flex-shrink: 0 !important;
        margin-bottom: 0 !important;
        border-radius: 24px !important;
        box-shadow: var(--shadow-md) !important;
        order: 2 !important;
        background: transparent !important;
    }
    
    /* На ПК показываем миниатюры */
    .product-thumbnails {
        display: flex !important;
        flex-direction: column !important;
        width: 80px !important;
        min-width: 80px !important;
        max-width: 80px !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        gap: 12px !important;
        padding: 0 !important;
        margin-top: 0 !important;
        order: 1 !important;
        max-height: 600px !important;
        scrollbar-width: none !important; /* Firefox - скрыть scrollbar */
        -ms-overflow-style: none !important; /* IE и Edge - скрыть scrollbar */
        background: transparent !important;
    }
    
    /* Скрыть scrollbar для Chrome, Safari и Opera на ПК */
    .product-thumbnails::-webkit-scrollbar {
        display: none !important;
        width: 0 !important;
        height: 0 !important;
    }
    
    .product-thumbnails::-webkit-scrollbar-thumb {
        display: none !important;
    }
    
    .product-thumbnail {
        width: 80px !important;
        height: 80px !important;
        min-width: 80px !important;
        min-height: 80px !important;
        max-width: 80px !important;
        max-height: 80px !important;
        object-fit: cover !important;
        flex-shrink: 0 !important;
        background: transparent !important;
    }
    
    /* На ПК скрываем индикаторы, подсказку о свайпе и стрелки навигации */
    .product-image-indicators,
    .product-swipe-hint,
    .product-image-nav {
        display: none !important;
    }
}

.product-details-name {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 6px;
    margin-top: 6px;
    color: var(--text-primary);
    letter-spacing: -0.4px;
    line-height: 1.3;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-color);
}

.product-details-price {
    font-size: 28px;
    font-weight: 800;
    color: var(--accent-primary);
    margin-bottom: 16px;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--accent-primary) 0%, #495057 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
    position: relative;
    padding: 8px 0;
}

.product-details-price::after {
    content: ' ₽';
    -webkit-text-fill-color: var(--accent-primary);
    background: none;
    font-size: 24px;
}

/* Fallback для браузеров без поддержки background-clip */
@supports not (-webkit-background-clip: text) {
    .product-details-price {
        color: var(--accent-primary);
        background: none;
    }
}

.product-details-description {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 12px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Контейнер с информацией о товаре */
.product-details-info {
    padding: 0 12px;
    padding-bottom: 80px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}

/* На ПК информация справа, без дополнительных отступов */
@media (min-width: 768px) {
    .product-details-info {
        padding: 0 !important;
        padding-bottom: 80px !important;
        flex: 1 !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-start !important;
    }
    
    .product-details-name {
        font-size: 24px !important;
        margin-bottom: 12px !important;
    }
    
    .product-details-price {
        font-size: 28px !important;
        margin-bottom: 16px !important;
    }
    
    .product-details-description {
        font-size: 15px !important;
        line-height: 1.7 !important;
        margin-bottom: 24px !important;
        flex: 1 !important;
    }
    
    .product-cart-control {
        margin-bottom: 0 !important;
        max-width: 100% !important;
    }
}

/* Unified Product Cart Control */
.product-cart-control {
    display: flex !important;
    align-items: center !important;
    gap: 0 !important;
    margin-bottom: 12px;
    background: #ffffff !important;
    border-radius: 12px !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08) !important;
    overflow: hidden !important;
    height: 40px !important;
    width: 100% !important;
    position: sticky !important;
    bottom: 0 !important;
    z-index: 50 !important;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05) !important;
}

.product-cart-minus,
.product-cart-plus {
    background: #f1f3f5 !important;
    border: none !important;
    color: #1a1a1a !important;
    cursor: pointer !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 36px !important;
    height: 40px !important;
    flex-shrink: 0 !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    margin: 0 !important;
    outline: none !important;
}

.product-cart-minus:hover,
.product-cart-plus:hover {
    background: #e9ecef !important;
}

.product-cart-minus:active,
.product-cart-plus:active {
    background: #dee2e6 !important;
    transform: scale(0.95) !important;
}

.product-cart-minus svg,
.product-cart-plus svg {
    stroke: #1a1a1a !important;
    width: 16px !important;
    height: 16px !important;
    display: block !important;
}

.product-cart-quantity {
    font-size: 15px !important;
    font-weight: 700 !important;
    color: #1a1a1a !important;
    min-width: 44px !important;
    text-align: center !important;
    flex-shrink: 0 !important;
    padding: 0 6px !important;
    line-height: 40px !important;
    display: block !important;
}

.product-cart-add {
    flex: 1 !important;
    background: #495057 !important;
    color: white !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 14px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    height: 40px !important;
    white-space: nowrap !important;
    margin: 0 !important;
    outline: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.product-cart-add:hover {
    background: #6c757d !important;
}

.product-cart-add:active {
    background: #495057 !important;
    transform: scale(0.98) !important;
}

/* Legacy quantity selector (for backward compatibility) */
.quantity-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    background: var(--bg-card);
    padding: 8px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.quantity-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-primary);
    transition: all var(--transition-base);
    padding: 0;
    flex-shrink: 0;
}

.quantity-btn svg {
    stroke: var(--text-primary);
    width: 16px;
    height: 16px;
    transition: all var(--transition-base);
}

.quantity-btn:hover svg {
    stroke: var(--accent-primary);
    transform: scale(1.1);
}

.quantity-btn.delete-btn {
    color: var(--error);
}

.quantity-btn.delete-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--error);
}

.quantity-btn.delete-btn svg {
    stroke: var(--error);
}

.quantity-btn:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
    transform: scale(1.05);
}

.quantity-btn:active {
    transform: scale(0.95);
}

.quantity-value {
    font-size: 14px;
    font-weight: 700;
    min-width: 32px;
    text-align: center;
    color: var(--text-primary);
    flex-shrink: 0;
}

.btn-primary {
    width: 100%;
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-base);
    margin-top: 12px;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    background: var(--accent-secondary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Cart */
.cart-content {
    padding: 12px;
}

/* На ПК корзина с такими же отступами как каталог */
@media (min-width: 768px) {
    .cart-content {
        padding: 24px;
        max-width: 100%;
        width: 100%;
        margin: 0 auto;
    }
}

.cart-item {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 10px;
    margin-bottom: 8px;
    display: flex;
    gap: 10px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
}

.cart-item:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--accent-primary);
    transform: translateX(2px);
}

.cart-item-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    background: var(--bg-tertiary);
    flex-shrink: 0;
    border: 1px solid var(--border-color);
}

.cart-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.cart-item-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cart-item-price {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
}

.cart-total {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    margin: 12px 0;
    border: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
}

.cart-total-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.cart-total-price {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.empty-cart {
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--text-secondary);
}

.empty-cart h2 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
}

/* Order Form */
.order-form {
    padding: var(--spacing-md);
}

/* На ПК форма заказа с такими же отступами как каталог */
@media (min-width: 768px) {
    .order-form {
        padding: 24px;
        max-width: 100%;
        width: 100%;
        margin: 0 auto;
    }
}

.form-group {
    margin-bottom: var(--spacing-md);
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    letter-spacing: 0.1px;
}

.form-input,
.form-select {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    font-size: 14px;
    color: var(--text-primary);
    transition: all var(--transition-base);
    font-family: inherit;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(73, 80, 87, 0.1), var(--shadow-sm);
    background: var(--bg-secondary);
}

.form-input::placeholder {
    color: var(--text-tertiary);
}

/* Orders List */
.orders-list {
    padding: var(--spacing-md);
}

/* На ПК список заказов с такими же отступами как каталог */
@media (min-width: 768px) {
    .orders-list {
        padding: 24px;
        max-width: 100%;
        width: 100%;
        margin: 0 auto;
    }
}

.order-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 12px;
    margin-bottom: var(--spacing-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.order-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: var(--accent-primary);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.order-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateX(2px);
    border-color: var(--accent-primary);
}

.order-card:hover::before {
    opacity: 1;
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-sm);
}

.order-number {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.2px;
}

.order-status {
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.order-status.pending {
    background: linear-gradient(135deg, var(--warning) 0%, #f97316 100%);
    color: white;
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.2);
}

.order-status.paid {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    color: white;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.2);
}

.order-status.processing {
    background: var(--accent-primary);
    color: white;
    box-shadow: var(--shadow-sm);
}

.order-info {
    display: flex;
    justify-content: space-between;
    margin-top: var(--spacing-xs);
    color: var(--text-secondary);
    font-size: 12px;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 400px;
    background: var(--bg-glass);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-top: 1px solid var(--border-color);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    display: flex;
    justify-content: space-around;
    padding: 6px 0 calc(6px + env(safe-area-inset-bottom, 34px));
    z-index: 100;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
}

.nav-item {
    background: none;
    border: none;
    color: var(--text-tertiary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    cursor: pointer;
    padding: 4px 6px;
    transition: all var(--transition-base);
    flex: 1;
    border-radius: var(--radius-sm);
    position: relative;
}

.nav-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--accent-primary);
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    transition: width var(--transition-base);
}

.nav-item.active {
    color: var(--accent-primary);
    background: var(--bg-tertiary);
    margin: 0 4px;
    border-radius: var(--radius-sm);
}

.nav-item.active::before {
    width: 30%;
}

.nav-item:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.nav-icon {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    transition: all var(--transition-base);
}

.nav-item.active .nav-icon {
    transform: scale(1.1);
    stroke: var(--accent-primary);
}

.nav-item:hover .nav-icon {
    transform: scale(1.05);
}

.nav-label {
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Toast */
.toast-container {
    position: fixed;
    top: 120px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    pointer-events: none;
    width: 90%;
    max-width: 360px;
}

.toast {
    background: var(--bg-glass);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    color: var(--text-primary);
    padding: 10px 14px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    min-width: 240px;
    max-width: 100%;
    animation: slideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
    font-weight: 500;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toast svg {
    flex-shrink: 0;
    stroke: currentColor;
    width: 18px;
    height: 18px;
}

.toast.success svg {
    stroke: var(--success);
}

.toast.error svg {
    stroke: var(--error);
}

.toast.info svg {
    stroke: var(--info);
}

.toast.warning svg {
    stroke: var(--warning);
}

.toast.success {
    border-left: 3px solid var(--success);
}

.toast.error {
    border-left: 3px solid var(--error);
}

.toast.info {
    border-left: 3px solid var(--info);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px) translateX(-50%);
    }
    to {
        opacity: 1;
        transform: translateY(0) translateX(-50%);
    }
}

/* Back Button in Header */
.back-btn-header {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0 10px;
    height: 36px;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0;
    transition: all var(--transition-base);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: -0.1px;
    box-shadow: var(--shadow-sm);
}

.back-btn-header:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.back-btn-header:active {
    transform: translateY(0);
}

.back-btn-header svg {
    stroke: currentColor;
    width: 16px;
    height: 16px;
    transition: all var(--transition-base);
}

.back-btn-header:hover svg {
    transform: translateX(-2px);
}

.back-btn svg {
    stroke: var(--text-primary);
    width: 16px;
    height: 16px;
    transition: all var(--transition-base);
}

.back-btn:hover svg {
    stroke: var(--accent-primary);
    transform: translateX(-2px);
}

.back-btn:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
    transform: translateX(-2px);
    box-shadow: var(--shadow-sm);
}

.back-btn:active {
    transform: translateX(-1px);
}

/* Stock badge */
.product-stock {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    color: var(--text-primary);
    font-size: 10px;
    font-weight: 600;
    padding: 3px 6px;
    border-radius: 6px;
    z-index: 10;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.product-stock.low {
    background: rgba(239, 68, 68, 0.95);
    color: white;
}

.product-stock.medium {
    background: rgba(245, 158, 11, 0.95);
    color: white;
}

.product-stock.high {
    background: rgba(16, 185, 129, 0.95);
    color: white;
}

/* Responsive - только для мобильных */
@media (max-width: 480px) {
    .catalog-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
        padding: 6px;
    }
    
    /* Первый товар на всю ширину - уже определен выше в @media (max-width: 767px) */
    
    .header-content {
        padding: 8px 10px;
    }
    
    .logo {
        font-size: 16px;
    }
    
    .product-name {
        font-size: 13px;
        min-height: 2.6em;
        line-height: 1.35;
    }
    
    .product-price {
        font-size: 15px;
    }
    
    .product-info {
        padding: 10px;
        gap: 6px;
    }
    
    .product-footer {
        padding-top: 8px;
        gap: 6px;
    }
    
    .add-to-cart-btn {
        font-size: 11px;
        padding: 6px 10px;
    }
    
    .product-details-name {
        font-size: 20px !important;
        margin-bottom: 12px !important;
        padding-bottom: 12px !important;
    }
    
    .product-details-price {
        font-size: 26px !important;
        margin-bottom: 8px !important;
        padding: 8px 0 !important;
    }
    
    .product-details-price::after {
        font-size: 22px !important;
    }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Selection */
::selection {
    background: var(--accent-primary);
    color: white;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

/* Stories */
.stories-container {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    gap: 12px;
    padding: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin-bottom: 4px;
    justify-content: flex-start;
    min-height: 90px;
}

@media (min-width: 768px) {
    .stories-container {
        margin-top: 0 !important;
    }
}

.stories-container::-webkit-scrollbar {
    display: none;
}

.story-circle {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    flex-shrink: 0;
    width: 70px;
}

.story-circle-image {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #495057;
    background: white;
    padding: 2px;
    transition: transform 0.2s ease;
    box-sizing: border-box;
}

.story-circle-text {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 2px solid #495057;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 9px;
    color: #495057;
    background: white;
    padding: 4px;
    box-sizing: border-box;
    transition: transform 0.2s ease;
    text-align: center;
    word-wrap: break-word;
    overflow: hidden;
    line-height: 1.0;
    text-overflow: ellipsis;
}

.story-circle:hover .story-circle-image,
.story-circle:hover .story-circle-text {
    transform: scale(1.05);
}

.story-circle-name {
    display: none !important;
}

/* Stories Viewer */
.stories-viewer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    z-index: 10000;
    display: flex;
    flex-direction: column;
}

.story-header {
    position: absolute;
    top: 94px;
    left: 0;
    right: 0;
    z-index: 10001;
    padding: 12px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.5), transparent);
    pointer-events: none; /* Отключаем клики на весь header */
}

.story-header > * {
    pointer-events: auto; /* Включаем клики только на дочерние элементы */
}

.story-progress-container {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
}

.story-progress-bar {
    flex: 1;
    height: 2px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 1px;
    overflow: hidden;
}

.story-progress-fill {
    height: 100%;
    width: 0%;
    background: #fff;
    transition: width 0.05s linear;
}

.story-progress-fill.active {
    background: #fff;
}

.story-progress-fill.viewed {
    background: rgba(255, 255, 255, 0.5);
}

.story-header-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.story-circle-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.story-circle-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
}

.story-circle-avatar-text {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 12px;
    border: 2px solid #fff;
}

.story-circle-name-header {
    color: #fff;
    font-weight: 600;
    font-size: 14px;
}

.story-sound-btn {
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    padding: 0;
}

.story-sound-btn:hover {
    background: rgba(0, 0, 0, 0.7);
}

.story-sound-btn svg {
    width: 18px;
    height: 18px;
}

.story-close-btn {
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.story-close-btn:hover {
    background: rgba(0, 0, 0, 0.7);
}

.story-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    margin-top: 94px;
    margin-bottom: 80px;
    height: calc(100% - 94px - 80px);
}

.story-media {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.story-text {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 20px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    max-width: 80%;
    word-wrap: break-word;
    z-index: 10002;
}

.story-text-top {
    top: 20%;
}

.story-text-center {
    top: 50%;
    transform: translate(-50%, -50%);
}

.story-text-bottom {
    bottom: 20%;
    top: auto;
}

.story-nav {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 30%;
    z-index: 10003;
    cursor: pointer;
}

.story-nav-prev {
    left: 0;
}

.story-nav-next {
    right: 0;
}

@media (min-width: 768px) {
    .stories-container {
        padding: 16px 24px;
        gap: 16px;
        justify-content: flex-start;
        margin-top: 0 !important;
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .story-circle {
        width: 80px;
    }
    
    .story-circle-image {
        width: 70px;
        height: 70px;
    }
    
    .story-circle-text {
        width: 70px;
        height: 70px;
        font-size: 10px;
        padding: 5px;
    }
    
    .story-circle-name {
        font-size: 12px;
        max-width: 80px;
    }
    
    .story-header {
        top: 90px;
    }
    
    .story-content {
        margin-top: 90px;
        margin-bottom: 80px;
        height: calc(100% - 90px - 80px);
    }
}
