/* ===== CSS RESET & BASE ===== */
@import url("https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css");

* {
    -webkit-font-smoothing: antialiased;
    box-sizing: border-box;
}

/* Global scaling to make elements look like 80% zoom at 100% */
.element-light {
    transform: scale(0.8);
    transform-origin: top left;
    width: 125%; /* Compensate for scaling */
    height: 125%; /* Compensate for scaling */
}

html, body {
    margin: 0;
    height: 100%;
    font-family: 'Manrope', sans-serif;
    background-color: #ffffff00;
    width: 100%;
    overflow-x: hidden; /* Предотвращаем горизонтальный скролл */
}

/* Main Container */
.element-light {
    position: relative;
    min-height: 100vh;
    background: linear-gradient(0deg, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 1) 100%);
    margin: 0;
    padding: 0;
}

/* ===== CSS VARIABLES ===== */
:root {
    /* Colors */
    --color-primary: #ef233c;
    --color-primary-hover: #d91e3a;
    --color-text: #000000;
    --color-text-light: #666666;
    --color-bg: #ffffff;
    --color-bg-dark: #1b2030;
    --color-border: rgba(255, 255, 255, 0.08);
    --color-border-light: rgba(255, 255, 255, 0.14);
    
    /* Spacing */
    --spacing-xs: 8px;
    --spacing-sm: 12px;
    --spacing-md: 16px;
    --spacing-lg: 20px;
    --spacing-xl: 24px;
    --spacing-2xl: 40px;
    
    /* Border radius */
    --radius-sm: 8px;
    --radius-md: 10px;
    --radius-lg: 14px;
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 15px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 15px rgba(0, 0, 0, 0.2);
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ===== HEADER MODULE ===== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 67px;
    background: #f4f4f4;
    backdrop-filter: blur(5px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    z-index: 1000;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    width: 61px;
    height: 51px;
    object-fit: contain;
}

.nav {
    display: flex;
    gap: 20px;
}

.nav-link {
    color: #000;
    font-size: 16px;
    font-weight: 400;
    transition: color 0.2s;
    text-decoration: none;
}

.nav-link.active {
    color: #ef233c;
    font-weight: 600;
}

.nav-link:hover {
    color: #ef233c;
}

.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.language-switcher {
    display: flex;
    background: white;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
    margin-right: 10px;
}

.lang-btn {
    padding: 8px 12px;
    border: none;
    background: transparent;
    color: #a9b0c3;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 40px;
}

.lang-btn:hover {
    background: rgba(239, 35, 60, 0.1);
    color: #ef233c;
}

.lang-btn.active {
    background: #ef233c;
    color: white;
}

.lang-btn.active:hover {
    background: #d11a2b;
}

.cart-btn, .login-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.cart-btn {
    background: #ef233c;
    color: white;
    text-decoration: none;
    display: inline-block;
}

.cart-btn:hover {
    color: white;
}

.login-btn {
    background: white;
    color: #000;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 30px;
    height: 30px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.hamburger-line {
    width: 20px;
    height: 2px;
    background: #000;
    margin: 2px 0;
    transition: all 0.3s ease;
    border-radius: 1px;
}

.mobile-menu-btn.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-btn.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    transform: none; /* Override global scaling for mobile menu */
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-menu {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100vh;
    background: white;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.mobile-menu-overlay.active .mobile-menu {
    transform: translateX(0);
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    position: relative;
}

.mobile-logo {
    width: 50px;
    height: 42px;
    object-fit: contain;
}

.mobile-nav {
    padding: 20px 0;
}

.mobile-nav-link {
    display: block;
    padding: 15px 20px;
    color: #000;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.2s;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
    background: rgba(239, 35, 60, 0.1);
    color: #ef233c;
}

.mobile-menu-actions {
    padding: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    margin-top: auto;
}

.mobile-language-switcher {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.mobile-language-label {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.mobile-language-buttons {
    display: flex;
    background: #f5f5f5;
    border-radius: 8px;
    overflow: hidden;
}

.mobile-lang-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: #666;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.mobile-lang-btn.active {
    background: #ef233c;
    color: white;
}

.mobile-cart-btn,
.mobile-login-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 10px;
}

.mobile-cart-btn {
    background: #ef233c;
    color: white;
    text-decoration: none;
    display: block;
    text-align: center;
}

.mobile-cart-btn:hover {
    background: #d11a2b;
    color: white;
}

.mobile-login-btn {
    background: white;
    color: #000;
    border: 1px solid #ddd;
}

/* ===== MAIN CONTENT ===== */
.main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 70px 20px 0;
    min-height: calc(100vh - 67px);
}

/* ===== INDEX BANNER MODULE ===== */
.index-banner {
    width: 100%;
    max-width: 100%;
    height: 210px;
    border-radius: 20px;
    overflow: hidden;
    margin: 60px 0 40px 0;
    position: relative;
}

/* Banner Container - Slider */
.index-banner__container {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
}

/* Individual Banner Slide */
.index-banner__slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
}

.index-banner__slide--active {
    opacity: 1;
}

/* Background Image Container - Easy to add photos */
.index-banner__background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 1;
}

/* Static gradient fallback - only apply if no background image */
.index-banner__background:not([style*="background-image"]) {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}


/* Navigation Buttons */
.index-banner__button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 3;
}

.index-banner__button--prev {
    left: 20px;
}

.index-banner__button--next {
    right: 20px;
}

.index-banner__button:hover {
    background-color: rgba(0, 0, 0, 0.6);
    border-color: rgba(0, 0, 0, 0.8);
    transform: translateY(-50%) scale(1.1);
}

.index-banner__arrow {
    width: 20px;
    height: 20px;
    color: white;
    transition: color 0.3s ease;
}

.index-banner__button:hover .index-banner__arrow {
    color: #ef233c;
}

/* Content Overlay */
.index-banner__content {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    padding: 0 40px 32px 40px;
}

.index-banner__text-container {
    max-width: 555.25px;
    height: 46px;
    display: flex;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 0 20px;
}

.index-banner__text {
    font-family: "Manrope-Regular", Helvetica;
    font-weight: 400;
    color: #ffffff;
    font-size: 16px;
    letter-spacing: 0;
    line-height: 1.2;
    margin: 0;
    text-align: left;
}

/* Indicators */
.index-banner__indicators {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    z-index: 3;
}

.index-banner__dot {
    width: 8px;
    height: 8px;
    border-radius: 4px;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.index-banner__dot--active {
    background-color: #ef233c;
    transform: scale(1.2);
}

.index-banner__dot:hover {
    background-color: rgba(255, 255, 255, 0.8);
    transform: scale(1.1);
}


/* ===== ASSORTMENT MODULE ===== */
.assortment {
    padding: 40px 0;
}

.assortment__container {
    width: 100%;
    max-width: 100%;
}

.assortment__grid {
    display: grid;
    grid-template-areas: 
        "products categories"
        "products advantages"
        "products contacts"
        "products delivery";
    grid-template-columns: 300px 1fr;
    gap: var(--spacing-2xl);
}

/* ===== PRODUCTS MODULE ===== */
.assortment__products {
    grid-area: products;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
    border-right: 1px dashed var(--color-border-light);
    padding-right: 0;
}

/* КРИТИЧЕСКИ ВАЖНО: Стили для изображений в карточках товаров */
.product-card img,
.product-card__image img,
.product-card .product-card__image img,
.product-card__image-link img {
    object-fit: contain !important;
    object-position: center !important;
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
}

.products-grid {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

/* Показываем только 3 карточки на больших экранах */
.products-grid .product-card:nth-child(n+4) {
    display: none;
}

.product-card {
    background: var(--color-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border-light);
    overflow: hidden;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
    height: 335px;
    width: 100%;
    max-width: 252px;
    position: relative;
}

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

/* Product Card Link */
.product-card__link {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

.product-card__link:hover {
    text-decoration: none;
    color: inherit;
}

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

/* Product Card Image Link */
.product-card__image-link {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

.product-card__image-link:hover {
    text-decoration: none;
    color: inherit;
}

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

.product-card__image {
    position: relative;
    width: 100%;
    height: 218px;
    overflow: visible;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-card__img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: center;
}

/* Стили для всех изображений в карточках товаров */
.product-card img {
    object-fit: contain !important;
    object-position: center !important;
}

/* Более специфичный селектор для изображений в карточках товаров */
.product-card__image img {
    object-fit: contain !important;
    object-position: center !important;
}

/* Дополнительные селекторы для гарантии применения стилей */
.product-card .product-card__image img {
    object-fit: contain !important;
    object-position: center !important;
}

.product-card__image-link img {
    object-fit: contain !important;
    object-position: center !important;
}

.product-card__badges {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.product-card__stock {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(34, 197, 94, 0.9);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
}

.product-card__discount {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(239, 68, 68, 0.9);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.product-card__content {
    padding: var(--spacing-md);
    display: grid;
    grid-template-columns: 1fr 100px; /* Информация слева, кнопка справа (уменьшена ширина) */
    grid-template-rows: auto; /* Одна строка */
    gap: var(--spacing-sm);
    flex-grow: 1;
    min-height: 0;
    align-items: start; /* Выравниваем по верху */
    overflow: hidden; /* Скрываем переполнение */
    box-sizing: border-box; /* Включаем padding в размер */
    max-width: 100%; /* Ограничиваем ширину */
}

.product-card__info {
    display: grid;
    grid-template-columns: 1fr; /* Одна колонка */
    grid-template-rows: auto auto; /* Две строки - заголовок и цена */
    gap: var(--spacing-xs); /* Отступ между заголовком и ценой */
    min-width: 0;
    overflow: hidden;
    flex: 1; /* Занимаем доступное место */
}

.product-card__controls {
    display: grid;
    grid-template-columns: 1fr; /* Одна колонка */
    grid-template-rows: auto auto; /* Две строки - кнопка и селектор */
    gap: var(--spacing-xs); /* Отступ между кнопкой и селектором */
    width: 100%;
    max-width: 100px; /* Ограничиваем максимальную ширину */
    flex-shrink: 0;
    flex-grow: 0;
    box-sizing: border-box; /* Включаем padding в размер */
    overflow: hidden; /* Скрываем переполнение */
    align-items: center; /* Выравниваем по центру по вертикали */
    justify-items: end; /* Выравниваем к правому краю по горизонтали */
    align-self: center; /* Выравниваем весь контейнер по центру */
}

.product-card__actions {
    display: none; /* Скрываем по умолчанию */
    grid-template-columns: 1fr; /* Одна колонка */
    grid-template-rows: auto; /* Одна строка */
    gap: var(--spacing-xs);
    margin-top: 0; /* Убираем margin */
    width: 100px; /* Фиксированная ширина как у кнопки */
    max-width: 100px; /* Ограничиваем максимальную ширину */
    flex-shrink: 0;
    flex-grow: 0;
    align-self: center; /* Выравниваем по центру */
    box-sizing: border-box; /* Включаем padding в размер */
    overflow: hidden; /* Скрываем переполнение */
}

/* Когда actions активен, скрываем кнопку и показываем actions */
.product-card__actions.show {
    display: flex;
}

.product-card__actions.show .product-card__add-btn {
    display: none;
}

.product-card__actions.show .product-card__quantity {
    display: flex;
}

.product-card__name {
    font-weight: 500;
    color: var(--color-text);
    font-size: 16px;
    line-height: 1.3;
    margin: 0; /* Убираем margin */
    word-wrap: break-word;
    /* Ограничиваем длину названия для двух строк */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: 2.6em; /* Две строки */
    min-height: 1.3em; /* Минимальная высота для одной строки */
    width: 100%; /* Занимаем всю ширину */
    min-width: 0; /* Позволяем сжиматься */
}

.product-card__price {
    font-weight: 700;
    color: var(--color-primary);
    font-size: 18px;
    margin: 0;
    line-height: 1.2;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0; /* Не сжимаемся */
    white-space: nowrap; /* Не переносим на новую строку */
    width: 100%; /* Занимаем всю ширину */
}

.product-card__old-price {
    font-weight: 400;
    color: #999;
    font-size: 14px;
    text-decoration: line-through;
}

.product-card__current-price {
    font-weight: 700;
    color: var(--color-primary);
    font-size: 18px;
}

.product-card__add-btn {
    width: 100px; /* Фиксированная ширина */
    height: 40px;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    padding: 0;
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex; /* Используем flexbox для лучшего выравнивания */
    align-items: center; /* Выравниваем по центру по вертикали */
    justify-content: center; /* Выравниваем по центру по горизонтали */
    gap: 6px;
    transition: all var(--transition-normal);
    flex-shrink: 0;
    flex-grow: 0;
    align-self: center; /* Выравниваем по центру */
    min-width: 100px;
    max-width: 100px; /* Ограничиваем максимальную ширину */
    white-space: nowrap;
    text-align: center;
    box-sizing: border-box; /* Включаем padding в размер */
}

.product-card__add-btn:hover {
    background: var(--color-primary-hover);
    transform: translateY(-1px);
}

.product-card__quantity {
    display: none;
    grid-template-columns: auto 1fr auto; /* Кнопка минус, количество, кнопка плюс */
    grid-template-rows: 1fr; /* Одна строка */
    align-items: center;
    justify-content: space-between;
    gap: 0;
    width: 100px; /* Фиксированная ширина как у кнопки */
    height: 40px;
    background: white;
    border: 2px solid var(--color-primary);
    border-radius: var(--radius-md);
    padding: 4px;
    margin-top: 0; /* Убираем margin */
    flex-shrink: 0; /* Запрещаем сжатие */
    flex-grow: 0; /* Запрещаем растягивание */
    min-width: 100px; /* Фиксированная ширина */
    max-width: 100px; /* Фиксированная ширина */
    box-sizing: border-box; /* Включаем padding и border в размер */
}

.product-card__qty-btn {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: var(--color-primary);
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    flex-shrink: 0;
    flex-grow: 0; /* Запрещаем растягивание */
    margin: 0;
    padding: 0;
    line-height: 1;
    min-width: 28px; /* Минимальная ширина */
    max-width: 28px; /* Максимальная ширина */
}

.product-card__qty-btn:hover {
    background: var(--color-primary-hover);
    transform: scale(1.05);
}

.product-card__qty-display {
    flex: 1;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    color: var(--color-primary);
    min-width: 20px;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== CATEGORIES MODULE ===== */
.assortment__categories {
    grid-area: categories;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--spacing-lg);
}

/* Скрываем карточки, которые переносятся на 3-ю строку */
.categories-grid .category-card:nth-child(n+11) {
    display: none;
}

.category-card {
    position: relative;
    width: 100%;
    height: 142px;
    background-color: var(--color-bg-dark);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--color-border-light);
    cursor: pointer;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

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

.category-card__image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.category-card__img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

.category-card__content {
    position: absolute;
    width: calc(100% - 22px);
    left: 11px;
    bottom: 11px;
    height: 62px;
    display: flex;
    gap: 17.2px;
    border-radius: 12px;
    border: 1px solid var(--color-border-light);
    background: linear-gradient(
        180deg,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 0.55) 100%
    );
    align-items: center;
    padding: 0 var(--spacing-sm);
}

.category-card__name {
    flex: 1;
    font-weight: 400;
    color: white;
    font-size: 16px;
    line-height: 1.2;
    margin: 0;
}


.categories__more-btn {
    width: 99px;
    max-width: 100%;
    height: 40px;
    background: #ef233c;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    align-self: center;
    box-shadow: 0 4px 12px rgba(239, 35, 60, 0.4);
    font-weight: 500;
}

.categories__more-btn:hover {
    background: #d91e3a;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 35, 60, 0.5);
}

.categories__more-text {
    font-weight: 400;
    color: white;
    font-size: 16px;
}


.additional-categories {
    display: none;
}

/* Показываем все карточки при развернутом состоянии */
.categories-grid.expanded .category-card {
    display: block !important;
}

/* ===== ADVANTAGES MODULE ===== */
.assortment__advantages {
    grid-area: advantages;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.advantages-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-lg);
}

.advantage-card {
    background-color: var(--color-bg);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    border: 1px solid var(--color-border-light);
    display: flex;
    flex-direction: row;
    align-items: center;
    text-align: left;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
    gap: var(--spacing-md);
}

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

.advantage-card__icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.advantage-card__icon img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.advantage-card__icon-placeholder {
    font-size: 24px;
    opacity: 0.8;
}

.advantage-card__text {
    font-weight: 400;
    color: var(--color-text);
    font-size: 16px;
    line-height: 1.4;
    text-align: left;
    flex: 1;
}

/* ===== CONTACTS MODULE ===== */
.assortment__contacts {
    grid-area: contacts;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

/* ===== 2GIS MAP CONTAINERS ===== */
.map-container-2gis {
    width: 100%;
    height: 300px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.map-container-2gis-modal {
    width: 100%;
    height: 400px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.contacts-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: start;
}

.contacts-info {
    background-color: var(--color-bg);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    border: 1px solid var(--color-border-light);
}

.contacts-info__header {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.contacts-info__icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.contacts-info__icon img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.contacts-info__text {
    flex: 1;
}

.contacts-info__title {
    font-weight: 700;
    color: var(--color-text);
    font-size: 20px;
    margin: 0 0 var(--spacing-xs) 0;
}

.contacts-info__schedule {
    font-weight: 400;
    color: var(--color-text-light);
    font-size: 14px;
    margin: 0;
}

.contacts-info__details {
    margin-bottom: var(--spacing-xl);
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}

.contact-item__icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px; /* Небольшой отступ для выравнивания с текстом */
}

.contact-item__icon img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.contact-item__icon-placeholder {
    font-size: 16px;
}

.contact-item__text {
    font-weight: 400;
    color: var(--color-text);
    font-size: 16px;
    flex: 1;
    margin-top: 2px; /* Выравниваем с иконками */
}

.contacts-info__actions {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.contact-action {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-lg);
    background-color: #f5f5f5;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-normal);
    border: none;
    min-height: 44px;
}

.contact-action:hover {
    background-color: var(--color-primary);
}

.contact-action:hover .contact-action__text {
    color: white;
}

.contact-action--primary {
    background-color: var(--color-primary);
    color: white;
}

.contact-action--primary .contact-action__text {
    color: white;
}

.contact-action--primary:hover {
    background-color: var(--color-primary-hover);
}

.contact-action__icon {
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0; /* Предотвращаем сжатие иконки */
}

.contact-action__icon img {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

.contact-action__text {
    font-weight: 400;
    font-size: 14px;
    color: var(--color-text);
}

.contacts-map {
    background-color: var(--color-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border-light);
    overflow: hidden;
}

.contacts-yandex-map {
    width: 100%;
    height: 300px;
    border: none;
    border-radius: var(--radius-lg);
}

/* ===== DELIVERY MODULE ===== */
.assortment__delivery {
    grid-area: delivery;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.delivery-content {
    background-color: var(--color-bg);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    border: 1px solid var(--color-border-light);
}

.delivery-text {
    font-weight: 400;
    color: var(--color-text);
    font-size: 16px;
    line-height: 1.6;
    margin: 0;
}

/* ===== SECTION HEADERS ===== */
.assortment__section-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
}

.assortment__section-title {
    font-weight: 700;
    color: var(--color-text);
    font-size: 24px;
    line-height: normal;
    margin: 0;
}

.assortment__divider {
    height: 2px;
    flex: 1;
    border-radius: 2px;
    background: linear-gradient(
        90deg,
        var(--color-primary) 0%,
        rgba(239, 35, 60, 0) 100%
    );
    opacity: 0.6;
}

/* ===== FOOTER MODULE ===== */
.footer {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    padding: 60px 0 30px;
    margin-top: 80px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 60px;
    margin-bottom: 40px;
}

.footer-main {
    display: flex;
    flex-direction: column;
    gap: 24px;
    align-items: center;
    text-align: center;
    flex-wrap: wrap;
}

.footer-description {
    font-size: 18px;
    color: #334155;
    margin: 0;
    line-height: 1.6;
    max-width: 400px;
    flex: auto;
}

.social-links {
    display: flex;
    gap: 12px;
}

.social-link {
    width: 44px;
    height: 44px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    text-decoration: none;
}

.social-link:hover {
    background: #ef233c;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(239, 35, 60, 0.3);
}

.social-icon {
    font-size: 18px;
}

.footer-columns {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
    justify-items: center;
}

.footer-column {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
    text-align: center;
}

.footer-heading {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-links a {
    color: #64748b;
    font-size: 16px;
    text-decoration: none;
    transition: all 0.2s ease;
    line-height: 1.5;
}

.footer-links a:hover {
    color: #ef233c;
    transform: translateX(4px);
}

.footer-copyright {
    text-align: center;
    font-size: 14px;
    color: #64748b;
    margin: 0;
    padding-top: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

/* ===== WHATSAPP BUTTON ===== */
.whatsapp-button {
    position: fixed !important;
    bottom: 18px !important;
    right: 20px !important;
    width: 136px !important;
    height: 46px !important;
    background: #ef233c !important;
    border-radius: 999px !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 0 16px !important;
    cursor: pointer !important;
    box-shadow: 0px 10px 30px rgba(0, 0, 0, 0.12) !important;
    transition: all 0.3s ease !important;
    z-index: 1000 !important;
    transform: none !important; /* Override global scaling */
    overflow: hidden !important;
}

.whatsapp-button:hover {
    transform: translateY(-2px) !important;
}

.whatsapp-icon {
    width: 16px !important;
    height: 16px !important;
    font-size: 16px !important;
}

.whatsapp-button span {
    color: white !important;
    font-size: 16px !important;
    font-weight: 400 !important;
}

/* Tablet styles - промежуточный размер */
@media (max-width: 1024px) and (min-width: 769px) {
    .whatsapp-button {
        width: 120px !important;
        height: 44px !important;
        gap: 6px !important;
    }
    
    .whatsapp-button span {
        font-size: 14px !important;
    }
}

/* Mobile styles */
@media (max-width: 768px) {
    .element-light {
        margin: 0;
        padding: 0;
        top: 0;
    }
    
    .whatsapp-button {
        width: 50px !important;
        height: 50px !important;
        border-radius: 50% !important;
        padding: 0 !important;
        justify-content: center !important;
        gap: 0 !important;
        transition: all 0.3s ease !important;
    }
    
    .whatsapp-button span {
        display: none !important;
    }
    
    .whatsapp-icon {
        font-size: 20px !important;
    }
}

/* Very small screens */
@media (max-width: 480px) {
    .whatsapp-button {
        width: 44px !important;
        height: 44px !important;
        bottom: 15px !important;
        right: 15px !important;
    }
    
    .whatsapp-icon {
        font-size: 18px !important;
    }
}

/* Specific fix for screens 768px-481px */
@media (max-width: 768px) and (min-width: 481px) {
    .element-light {
        margin: 0 !important;
        padding: 0 !important;
        top: 0 !important;
        position: relative;
        transform: none !important;
        width: 100% !important;
        height: 100% !important;
    }
    
    body {
        margin: 0 !important;
        padding: 75px 0 0 0 !important;
    }
    
    .product-card__qty-display {
        margin: 0 !important;
    }
}

/* Specific fix for screens 480px-325px */
@media (max-width: 480px) and (min-width: 325px) {
    .element-light {
        transform: none !important;
        width: 100% !important;
        height: 100% !important;
    }
    
    body {
        padding-top: 75px !important;
    }
}

/* Specific fix for screens 324px and less */
@media (max-width: 325px) {
    .element-light {
        transform: none !important;
        width: auto !important;
        height: auto !important;
    }
    
    .main {
        width: auto !important;
        overflow-x: visible !important;
    }
    
    body {
        overflow-x: visible !important;
        padding-top: 75px !important;
    }
}

/* ===== MAP MODAL ===== */
.map-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
    transform: none; /* Override global scaling for map modal */
}

.map-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.map-modal-content {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    max-width: 90vw;
    max-height: 90vh;
    width: 800px;
    overflow: hidden;
    animation: slideIn 0.3s ease;
    position: relative;
}

.map-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--color-border);
    background: var(--color-background);
}

.map-modal-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--color-text);
}

.map-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--color-text-secondary);
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.map-modal-close:hover {
    background: var(--color-background-hover);
    color: var(--color-text);
}

.map-modal-body {
    padding: 0;
}

.map-container {
    width: 100%;
    height: 400px;
    border-radius: 0;
    overflow: hidden;
    position: relative;
}

.yandex-map {
    width: 100%;
    height: 100%;
    border: none;
}

.map-info {
    padding: var(--spacing-lg);
    background: var(--color-background);
}

.map-address {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text);
    margin: 0 0 var(--spacing-sm) 0;
}

.map-description {
    font-size: 14px;
    color: var(--color-text-secondary);
    margin: 0 0 var(--spacing-md) 0;
}

.map-actions {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.map-action-btn {
    background: var(--color-background);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    border-radius: var(--radius-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    transition: all var(--transition-fast);
    flex: 1;
    min-width: 0;
}

.map-action-btn:hover {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
    transform: translateY(-1px);
}

.map-action-icon {
    font-size: 16px;
}

/* Notification animations */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Map Button in Footer */
.map-btn {
    background: none;
    border: none;
    color: var(--color-text-secondary);
    font-size: 14px;
    cursor: pointer;
    padding: 0;
    text-align: left;
    transition: color var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 4px;
}

.map-btn:hover {
    color: var(--color-primary);
}

.footer-address {
    font-size: 14px;
    color: var(--color-text-secondary);
    font-style: italic;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { 
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to { 
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .map-modal-content {
        width: 95vw;
        max-height: 85vh;
        margin: var(--spacing-md);
    }
    
    .map-container {
        height: 300px;
    }
    
    .yandex-map {
        height: 300px;
    }
    
    .map-modal-header {
        padding: var(--spacing-md);
    }
    
    .map-modal-title {
        font-size: 18px;
    }
    
    .map-info {
        padding: var(--spacing-md);
    }
    
    .map-actions {
        flex-direction: column;
    }
    
    .map-action-btn {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .map-modal-content {
        width: 100vw;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        margin: 0;
    }
    
    .map-container {
        height: 250px;
    }
    
    .yandex-map {
        height: 250px;
    }
    
    
    .map-actions {
        gap: var(--spacing-xs);
    }
    
    .map-action-btn {
        padding: var(--spacing-xs) var(--spacing-sm);
        font-size: 13px;
    }
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1180px) {
    .main {
        width: 100%;
        padding: 91px 20px 0;
    }
}

@media (max-width: 1200px) {
    .nav {
        display: none;
    }
    
    .language-switcher {
        display: none;
    }
    
    .login-btn {
        display: none;
    }
    
    .mobile-menu-btn {
        display: flex;
        margin-left: 10px;
    }
    
    .header-actions {
        gap: 0;
        margin-left: auto;
    }
}

/* Убираем ограничение ширины для маленьких экранов */
@media (max-width: 480px) {
    .main {
        max-width: none;
        /* width: 100%; - отключено */
        overflow-x: hidden; /* Предотвращаем горизонтальный скролл */
    }
    
    .assortment__container {
        /* width: 100%; - отключено */
        max-width: none;
    }
    
    /* Предотвращаем выход за границы */
    * {
        /* width: 100%; - отключено */
        box-sizing: border-box;
    }
    
    .product-card {
        /* width: 100%; - отключено */
    }
    
    .category-card {
        /* width: 100%; - отключено */
    }
    
    .advantage-card {
        /* width: 100%; - отключено */
    }
    
    .product-card__qty-display {
        margin: 0 !important;
    }
}

@media (max-width: 1024px) {
    .nav {
        display: none;
    }
    
    .language-switcher {
        display: none;
    }
    
    .login-btn {
        display: none;
    }
    
    .mobile-menu-btn {
        display: flex;
        margin-left: 10px;
    }
    
    .header-actions {
        gap: 0;
        margin-left: auto;
    }
    
    .assortment__grid {
        grid-template-areas: 
            "products categories"
            "products advantages"
            "products contacts"
            "products delivery";
        grid-template-columns: 250px 1fr;
        gap: var(--spacing-lg);
    }
    
    .categories-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: var(--spacing-md);
    }
    
    /* Скрываем карточки, которые переносятся на 3-ю строку (9-я и далее) */
    .categories-grid .category-card:nth-child(n+9) {
        display: none;
    }
    
    .advantages-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-md);
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .footer-columns {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
    
    .footer-main {
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: 20px;
        flex-wrap: wrap;
    }
    
    .footer-description {
        flex: auto;
        margin-right: 20px;
    }
    
    .social-links {
        flex-shrink: 0;
    }
    
    .footer-columns {
        justify-items: center;
    }
    
    .footer-column {
        align-items: center;
        text-align: center;
    }
}

@media (max-width: 768px) {
    .nav {
        display: none;
    }
    
    .language-switcher {
        display: none;
    }
    
    .login-btn {
        display: none;
    }
    
    .mobile-menu-btn {
        display: flex;
        margin-left: 10px;
    }
    
    .header-actions {
        gap: 0;
        margin-left: auto;
    }
    
    .main {
        padding: 0 15px;
        margin-top: 0;
    }
    
    .index-banner {
        margin: 60px 0 20px 0;
    }
    
    .index-banner__container {
        width: 100%;
    }
    
    .index-banner__content {
        padding: 0 20px 20px 20px;
    }
    
    .index-banner__overlay {
        width: calc(100% - 40px);
    }
    
    .index-banner__text {
        font-size: 14px;
        padding: 0 10px;
    }
    
    .index-banner__button {
        width: 32px;
        height: 32px;
    }
    
    .index-banner__arrow {
        width: 16px;
        height: 16px;
    }
    
    .assortment__grid {
        grid-template-areas: 
            "categories"
            "advantages"
            "contacts"
            "delivery"
            "products";
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    .assortment__products {
        border-right: none;
        border-bottom: 1px dashed var(--color-border-light);
        padding-right: 0;
        padding-bottom: var(--spacing-lg);
    }
    
    /* Товары в две колонки на экранах 768px и меньше */
    .products-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-sm);
        justify-items: center; /* Центрируем карточки */
    }
    
    /* Показываем 6 карточек на экранах 768px и меньше */
    .products-grid .product-card:nth-child(n+4) {
        display: block; /* Показываем 4-ю, 5-ю и 6-ю карточки */
    }
    
    .products-grid .product-card:nth-child(n+7) {
        display: none; /* Скрываем 7-ю и далее */
    }
    
    .categories-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--spacing-sm);
    }
    
    /* Скрываем карточки, которые переносятся на 3-ю строку (7-я и далее) */
    .categories-grid .category-card:nth-child(n+7) {
        display: none;
    }
    
    /* Уменьшаем отступы у заголовка категорий */
    .assortment__categories .assortment__section-header {
        margin-bottom: var(--spacing-md);
    }
    
    .categories__more-btn {
        position: static;
        transform: none;
        margin: var(--spacing-lg) 0;
        align-self: flex-start;
    }
    
    .categories__more-btn:hover {
        transform: translateY(-2px);
    }
    
    .additional-categories {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--spacing-md);
    }
    
    .advantages-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-sm);
    }
    
    .contacts-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    .contacts-map {
        order: -1;
    }
    
    .contacts-yandex-map {
        height: 250px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .footer-columns {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .footer-main {
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: 15px;
        flex-wrap: wrap;
    }
    
    .footer-description {
        flex: auto;
        margin-right: 15px;
        font-size: 16px;
    }
    
    .social-links {
        flex-shrink: 0;
    }
    
    .footer-columns {
        justify-items: center;
    }
    
    .footer-column {
        align-items: center;
        text-align: center;
    }
    
    /* Адаптивность для кнопки "Позвонить" на планшетах */
    .contacts-info__actions {
        gap: var(--spacing-sm);
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .contact-action {
        flex: 1;
        min-width: 120px;
        justify-content: center;
    }
    
    .contact-action--primary {
        flex: 1.2; /* Кнопка "Позвонить" немного больше */
    }
}

@media (max-width: 480px) {
    .element-light {
        margin: 0;
        padding: 0;
        top: 0;
    }
    
    .main {
        padding: 0 10px;
        margin-top: 0;
    }
    
    .index-banner {
        margin: 40px 0 10px 0;
        height: 180px;
    }
    
    .index-banner__container {
        height: 180px;
    }
    
    .index-banner__content {
        padding: 0 10px 15px 10px;
    }
    
    .index-banner__overlay {
        width: calc(100% - 20px);
        height: 40px;
    }
    
    .index-banner__text {
        font-size: 12px;
        padding: 0 8px;
    }
    
    .index-banner__indicators {
        padding: 12px 0;
    }
    
    .additional-categories {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-sm);
    }
    
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-xs);
    }
    
    /* Скрываем карточки, которые переносятся на 4-ю строку (7-я и далее) - показываем 3 строки */
    .categories-grid .category-card:nth-child(n+7) {
        display: none;
    }
    
    .advantages-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-xs);
    }
    
    /* Скрываем теги br в преимуществах на маленьких экранах */
    .advantage-card br {
        display: none;
    }
    
    .advantage-card {
        padding: 0;
    }
    
    .contacts-info {
        padding: var(--spacing-lg);
    }
    
    .contacts-info__actions {
        gap: var(--spacing-xs);
        flex-direction: column;
    }
    
    .contact-action {
        padding: var(--spacing-sm) var(--spacing-md);
        min-height: 48px;
        justify-content: center;
    }
    
    /* Адаптивность для кнопки "Позвонить" - скрываем текст на очень маленьких экранах */
    .contact-action--primary {
        min-width: 48px;
        width: auto;
    }
    
    .contact-action--primary .contact-action__text {
        display: block;
    }
    
    /* Промежуточный размер - компактная кнопка */
    @media (max-width: 400px) {
        .contact-action--primary {
            padding: var(--spacing-xs) var(--spacing-sm);
            min-width: 60px;
        }
        
        .contact-action--primary .contact-action__text {
            font-size: 12px;
        }
        
        .contact-action--primary .contact-action__icon img {
            width: 14px;
            height: 14px;
        }
    }
    
    /* На очень маленьких экранах скрываем текст и оставляем только иконку */
    @media (max-width: 360px) {
        .contact-action--primary {
            width: 48px;
            height: 48px;
            padding: 0;
            border-radius: 50%;
            justify-content: center;
            align-items: center;
        }
        
        .contact-action--primary .contact-action__text {
            display: none;
        }
        
        .contact-action--primary .contact-action__icon {
            margin: 0;
        }
        
        .contact-action--primary .contact-action__icon img {
            width: 20px;
            height: 20px;
        }
    }
    
    .map-placeholder {
        height: 250px;
    }
    
    .map-info {
        bottom: var(--spacing-md);
        left: var(--spacing-md);
        right: var(--spacing-md);
        padding: var(--spacing-xs);
    }
    
    .map-footer {
        padding: var(--spacing-xs);
        font-size: 9px;
    }
}

@media (max-width: 360px) {
    .main {
        margin-top: 0;
        padding: 0 5px; /* Уменьшаем боковые падинги */
    }
    
    .assortment__container {
        padding: 0 5px; /* Уменьшаем падинги контейнера */
    }
    
    .index-banner {
        margin: 20px -5px; /* Компенсируем падинги main */
    }
    
    .index-banner__container {
        padding: var(--spacing-sm); /* Уменьшаем падинги баннера */
    }
    
    .footer-main {
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: 10px;
        flex-wrap: wrap;
    }
    
    .footer-description {
        flex: auto;
        margin-right: 10px;
        font-size: 14px;
        line-height: 1.4;
    }
    
    .social-links {
        flex-shrink: 0;
    }
    
    .footer-columns {
        justify-items: center;
    }
    
    .footer-column {
        align-items: center;
        text-align: center;
    }
}

/* Стили для очень маленьких экранов - одна колонка */
@media (max-width: 320px) {
    .footer-columns {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

/* Стили для экранов менее 475px */
@media (max-width: 475px) {
    /* Уменьшаем верхний падинг секции assortment */
    .assortment {
        padding: 20px 0;
    }
    
    .assortment__container {
        padding-top: 20px;
    }
    
    /* Убираем верхний падинг у текста доставки */
    .delivery-section .assortment__section-header {
        margin-top: 0;
    }
    
    /* Убираем верхний падинг у контента доставки */
    .delivery-content {
        padding-top: 0;
    }
    
    /* Делаем карточки категорий меньше */
    .category-card {
        padding: var(--spacing-sm);
        min-height: 80px;
    }
    
    .category-card__image {
        height: 100%;
        background: #ffffff;
    }
    
    .category-card__title {
        font-size: 12px;
        line-height: 1.2;
    }
    
    /* Показываем 3 строки категорий по умолчанию (6 карточек) */
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-xs);
    }
    
    /* Скрываем карточки после 6-й (7-я и далее) - показываем 3 строки по 2 карточки */
    .categories-grid .category-card:nth-child(n+7) {
        display: none;
    }
    
    /* Текст преимуществ занимает все доступное пространство */
    .advantage-card {
        flex-direction: row;
        align-items: flex-start;
        text-align: left;
    }
    
    .advantage-card__text {
        flex: 1;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* Стили для экранов 501px-768px - товары в две колонки */
@media (max-width: 768px) and (min-width: 501px) {
    .products-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-sm);
        justify-items: center;
    }
    
    .products-grid .product-card:nth-child(n+4) {
        display: block; /* Показываем 4-ю, 5-ю и 6-ю карточки */
    }
    
    .products-grid .product-card:nth-child(n+7) {
        display: none; /* Скрываем 7-ю и далее */
    }
}

/* Стили для экранов 530px и меньше - карточки товаров с кнопкой под заголовком */
@media (max-width: 530px) {
    .product-card {
        height: auto;
        min-height: 320px;
        display: flex;
        flex-direction: column;
    }
    
    .product-card__image {
        height: 140px;
        flex-shrink: 0;
        background: #ffffff;
    }
    
    .product-card__img {
        object-fit: contain;
        object-position: center;
    }
    
    .product-card img {
        object-fit: contain !important;
        object-position: center !important;
        max-width: 100% !important;
        max-height: 100% !important;
        width: auto !important;
        height: auto !important;
    }
    
    .product-card__image img {
        object-fit: contain !important;
        object-position: center !important;
        max-width: 100% !important;
        max-height: 100% !important;
        width: auto !important;
        height: auto !important;
    }
    
    .product-card img {
        object-fit: contain !important;
        object-position: center !important;
        max-width: 100% !important;
        max-height: 100% !important;
        width: auto !important;
        height: auto !important;
    }
    
    .product-card__image img {
        object-fit: contain !important;
        object-position: center !important;
        max-width: 100% !important;
        max-height: 100% !important;
        width: auto !important;
        height: auto !important;
    }
    
    .product-card__content {
        flex: 1;
        display: flex;
        flex-direction: column;
        padding: var(--spacing-md);
        gap: var(--spacing-sm);
    }
    
    .product-card__info {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: var(--spacing-xs);
        margin-bottom: var(--spacing-sm);
    }
    
    .product-card__controls {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: var(--spacing-sm);
        margin-top: auto;
    }
    
    .product-card__name {
        width: 100%;
        text-align: left;
        font-size: 15px;
        line-height: 1.3;
        margin: 0;
        color: var(--color-text);
        font-weight: 500;
    }
    
    .product-card__price {
        width: 100%;
        text-align: left;
        font-size: 17px;
        margin: 0;
        min-height: 22px;
        display: flex;
        flex-direction: column;
        gap: 2px;
    }
    
    .product-card__add-btn {
        width: 100%;
        height: 44px;
        font-size: 14px;
        font-weight: 600;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        background: var(--color-primary);
        color: white;
        border: none;
        border-radius: var(--radius-sm);
        cursor: pointer;
        transition: all var(--transition-normal);
        margin-top: auto;
        flex-shrink: 0;
        box-sizing: border-box;
    }
    
    .product-card__add-btn:hover {
        background: var(--color-primary-hover);
        transform: translateY(-1px);
    }
    
    .product-card__actions {
        width: 100%;
        display: none;
        margin-top: var(--spacing-sm);
    }
    
    .product-card__actions.show {
        display: flex;
    }
    
    .product-card__quantity {
        width: 100%;
        height: 44px;
        display: none;
        align-items: center;
        justify-content: space-between;
        background: var(--color-bg);
        border: 2px solid var(--color-primary);
        border-radius: var(--radius-sm);
        padding: 0 var(--spacing-sm);
        flex-shrink: 0;
        box-sizing: border-box;
    }
    
    .product-card__quantity[style*="display: flex"] {
        display: flex !important;
    }
    
    .product-card__qty-btn {
        width: 32px;
        height: 32px;
        border: none;
        border-radius: 50%;
        background: var(--color-primary);
        color: white;
        font-size: 16px;
        font-weight: 600;
        cursor: pointer;
        transition: all var(--transition-normal);
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .product-card__qty-btn:hover {
        background: var(--color-primary-hover);
        transform: scale(1.05);
    }
    
    .product-card__qty-value {
        flex: 1;
        text-align: center;
        font-size: 16px;
        font-weight: 600;
        color: var(--color-primary);
    }
}

/* Стили для экранов 500px и меньше - карточки товаров */
@media (max-width: 500px) {
    .product-card {
        height: auto; /* Автоматическая высота */
        min-height: 280px;
        display: flex;
        flex-direction: column;
    }
    
    .product-card__image {
        height: 120px; /* Уменьшаем высоту изображения */
        flex-shrink: 0;
        background: #ffffff;
    }
    
    .product-card__img {
        object-fit: contain;
        object-position: center;
    }
    
    .product-card img {
        object-fit: contain !important;
        object-position: center !important;
        max-width: 100% !important;
        max-height: 100% !important;
        width: auto !important;
        height: auto !important;
    }
    
    .product-card__image img {
        object-fit: contain !important;
        object-position: center !important;
        max-width: 100% !important;
        max-height: 100% !important;
        width: auto !important;
        height: auto !important;
    }
    
    .product-card__content {
        flex: 1;
        display: flex;
        flex-direction: column;
        padding: var(--spacing-sm);
        gap: var(--spacing-xs);
        justify-content: flex-start;
        align-items: stretch; /* Растягиваем элементы на всю ширину */
        overflow: hidden; /* Скрываем переполнение */
        box-sizing: border-box; /* Включаем padding в размер */
        width: 100%; /* Ограничиваем ширину */
    }
    
    .product-card__info {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: var(--spacing-xs); /* Отступ между заголовком и ценой */
        min-width: 0;
        overflow: hidden; /* Скрываем переполнение */
        flex: 1; /* Занимаем доступное место */
    }
    
    .product-card__controls {
        display: flex;
        flex-direction: column;
        gap: var(--spacing-xs); /* Отступ между кнопкой и селектором */
        width: 100%;
        flex-shrink: 0;
        flex-grow: 0;
        box-sizing: border-box; /* Включаем padding в размер */
        overflow: hidden; /* Скрываем переполнение */
        align-items: stretch; /* Растягиваем элементы на всю ширину */
        justify-content: flex-end; /* Выравниваем к нижнему краю */
        margin-top: auto; /* Прижимаем к низу */
    }

    .product-card__actions {
        display: none; /* Скрываем по умолчанию */
        flex-direction: column;
        gap: var(--spacing-xs);
        margin-top: 0; /* Убираем margin */
        width: 100%; /* Полноширинный */
        flex-shrink: 0;
        flex-grow: 0;
        align-self: stretch; /* Растягиваем на всю ширину */
        box-sizing: border-box; /* Включаем padding в размер */
        overflow: hidden; /* Скрываем переполнение */
    }
    
    /* Когда actions активен, скрываем кнопку и показываем actions */
    .product-card__controls:has(.product-card__actions .product-card__quantity[style*="display: flex"]) .product-card__add-btn {
        display: none;
    }
    
    .product-card__controls:has(.product-card__actions .product-card__quantity[style*="display: flex"]) .product-card__actions {
        display: flex;
    }
    
    .product-card__name {
        width: 100%;
        text-align: left;
        font-size: 14px;
        line-height: 1.3;
        margin: 0; /* Убираем margin */
        word-wrap: break-word;
        font-weight: 500;
        /* Ограничиваем длину названия для двух строк */
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
        max-height: 2.6em; /* Две строки */
        min-height: 1.3em; /* Минимальная высота для одной строки */
        width: 100%; /* Занимаем всю ширину */
        min-width: 0; /* Позволяем сжиматься */
    }
    
    .product-card__price {
        width: 100%;
        text-align: left;
        font-size: 16px;
        margin: 0;
        min-height: 20px;
        display: flex;
        align-items: center;
        gap: 6px;
        line-height: 1.2;
        flex-shrink: 0; /* Не сжимаемся */
        white-space: nowrap; /* Не переносим на новую строку */
        width: 100%; /* Занимаем всю ширину */
    }
    
    .product-card__old-price {
        font-weight: 400;
        color: #999;
        font-size: 12px;
        text-decoration: line-through;
    }
    
    .product-card__current-price {
        font-weight: 700;
        color: var(--color-primary);
        font-size: 16px;
    }
    
    .product-card__add-btn {
        width: 100%;
        height: 44px;
        font-size: 14px;
        font-weight: 600;
        display: flex; /* Используем flexbox для лучшего выравнивания */
        align-items: center; /* Выравниваем по центру по вертикали */
        justify-content: center; /* Выравниваем по центру по горизонтали */
        gap: 8px;
        flex-shrink: 0;
        flex-grow: 0;
        align-self: stretch; /* Растягиваем на всю ширину */
        min-width: 100%;
        white-space: nowrap;
        text-align: center;
        box-sizing: border-box; /* Включаем padding в размер */
        background: var(--color-primary);
        color: white;
        border: none;
        border-radius: var(--radius-sm);
        cursor: pointer;
        transition: all var(--transition-normal);
    }
    
    .product-card__quantity {
        width: 100%; /* Полноширинный */
        height: 44px;
        margin-top: 0; /* Убираем auto margin */
        flex-shrink: 0;
        flex-grow: 0; /* Запрещаем растягивание */
        display: flex;
        align-items: center;
        justify-content: space-between;
        min-width: 100%;
        box-sizing: border-box; /* Включаем padding и border в размер */
        background: var(--color-bg);
        border: 2px solid var(--color-primary);
        border-radius: var(--radius-sm);
        padding: 0 var(--spacing-sm);
    }
    
    .product-card__qty-btn {
        width: 28px;
        height: 28px;
        flex-shrink: 0;
        flex-grow: 0; /* Запрещаем растягивание */
        min-width: 28px; /* Минимальная ширина */
        max-width: 28px; /* Максимальная ширина */
    }
    
    .product-card__qty-display {
        flex: 1;
        text-align: center;
        font-size: 14px;
    }
    
    /* Товары в две колонки на экранах 500px и меньше */
    .products-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-md);
        justify-items: stretch;
        align-items: stretch; /* Равная высота карточек */
    }
    
    .products-grid .product-card:nth-child(n+4) {
        display: block; /* Показываем 4-ю, 5-ю и 6-ю карточки */
    }
    
    .products-grid .product-card:nth-child(n+7) {
        display: none; /* Скрываем 7-ю и далее */
    }
}

/* Стили для очень маленьких экранов (325px и меньше) */
@media (max-width: 325px) {
    .main {
        padding: 0 2px; /* Минимальные падинги */
    }
    
    .assortment__container {
        padding: 0 2px; /* Минимальные падинги */
    }
    
    .index-banner {
        margin: 20px -2px; /* Компенсируем падинги */
    }
    
    .index-banner__container {
        padding: var(--spacing-xs); /* Минимальные падинги */
    }
    
    .index-banner__content h1 {
        font-size: 20px; /* Уменьшаем размер заголовка */
    }
    
    .index-banner__content p {
        font-size: 12px; /* Уменьшаем размер текста */
    }
    
    /* Уменьшаем падинги карточек */
    .product-card {
        padding: var(--spacing-xs);
        width: 100%;
    }
    
    .product-card__content {
        padding: var(--spacing-xs);
    }
    
    .category-card {
        padding: var(--spacing-xs);
        width: 100%;
    }
    
    .advantage-card {
        padding: var(--spacing-xs);
        width: 100%;
    }
    
    .contacts-info {
        padding: var(--spacing-xs);
    }
    
    /* Принудительно ограничиваем все элементы */
    * {
        overflow-x: hidden;
    }
}
