/* Общие настройки */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f9fafb;
    color: #111827;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Шапка сайта */
.site-header {
    background-color: #ffffff;
    border-b: 1px solid #e5e7eb;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 20px;
    font-weight: 700;
    color: #4f46e5;
    text-decoration: none;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

.admin-link {
    font-size: 14px;
    color: #6b7280;
    text-decoration: none;
}

.admin-link:hover {
    color: #374151;
}

.cart-button {
    position: relative;
    background-color: #e0e7ff;
    color: #4338ca;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.2s;
}

.cart-button:hover {
    background-color: #c7d2fe;
}

.cart-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #ef4444;
    color: #ffffff;
    font-size: 12px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 700;
}

/* Основной контент */
.main-content {
    flex-grow: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 32px 20px;
}

.page-title {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 32px;
}

/* Сетка товаров */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 24px;
}

.products-grid .product-card {
    height: 340px; /* Фиксируем высоту карточки как в горизонтальной ленте */
    min-height: 340px;
}

.products-grid .product-img-wrapper {
    width: 100%;
    height: 140px; /* Уменьшаем контейнер огромной картинки */
    background: rgba(255, 255, 255, 0.7);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.products-grid .product-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Картинка аккуратно вписывается, не растягиваясь */
    padding: 6px;
}

.products-grid .product-card-title {
    font-size: 14px;
    height: 42px; /* Ограничиваем высоту текста под мелкий размер */
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-bottom: 4px;
}

.product-card a:hover .product-img-wrapper img {
    transform: scale(1.06);
}

.product-card a {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.image-container {
    aspect-ratio: 1 / 1;
    background-color: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-info {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
}

.product-desc {
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 16px;
    flex-grow: 1;
    line-height: 1.4;
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid #f3f4f6;
}

.product-price {
    font-size: 20px;
    font-weight: 700;
}

.buy-btn {
    background-color: #4f46e5;
    color: #ffffff;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.buy-btn:hover {
    background-color: #4338ca;
}

/* Пустой каталог */
.empty-catalog {
    text-align: center;
    padding: 48px 0;
    color: #6b7280;
}

.empty-catalog a {
    color: #4f46e5;
}

/* Подвал */
.site-footer {
    background-color: #ffffff;
    border-top: 1px solid #e5e7eb;
    padding: 24px 0;
    text-align: center;
    font-size: 14px;
    color: #6b7280;
}



/* Стили страницы корзины */
.cart-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 32px;
    align-items: start;
}

@media (max-width: 768px) {
    .cart-layout {
        grid-template-columns: 1fr;
    }
}

.cart-table-container {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.cart-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid #f3f4f6;
}

.cart-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.cart-item:first-child {
    padding-top: 0;
}

.cart-item-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.cart-item-title {
    font-weight: 600;
    font-size: 16px;
}

.cart-item-price {
    color: #6b7280;
    font-size: 14px;
    margin-top: 4px;
}

.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 24px;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f3f4f6;
    padding: 4px 8px;
    border-radius: 6px;
}

.qty-btn {
    background: none;
    border: none;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    color: #4f46e5;
    padding: 0 4px;
}

.qty-val {
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

.item-total-price {
    font-weight: 700;
    font-size: 16px;
    min-width: 80px;
    text-align: right;
}

/* Блок оформления заказа (чекаут) */
.checkout-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 96px;
}

.checkout-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    border-bottom: 1px solid #f3f4f6;
    padding-bottom: 12px;
}

.checkout-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 14px;
    color: #6b7280;
}

.checkout-row.total {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f3f4f6;
}

.checkout-btn {
    width: 100%;
    background-color: #10b981;
    color: #ffffff;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 16px;
    transition: background-color 0.2s;
}

.checkout-btn:hover {
    background-color: #059669;
}


/* Контейнер раздела каталога */
.category-section {
    margin-bottom: 40px;
    position: relative; /* Нужно для позиционирования стрелок */
}

.category-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 12px;
    padding-left: 4px;
}

/* Обертка для ленты и кнопок */
.scroll-container-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

/* Горизонтальная лента скролла */
.products-scroll-row {
    display: flex !important; /* Принудительно включаем flex-ряд */
    flex-direction: row !important;
    gap: 16px;
    overflow-x: auto;
    width: 100%;
    padding: 8px 4px 16px 4px;
    scroll-behavior: smooth;
    
    /* Скрываем скроллбар */
    -ms-overflow-style: none;  
    scrollbar-width: none;  
}

.products-scroll-row::-webkit-scrollbar {
    display: none; 
}

/* Стилизация внутренних элементов карточки под новый размер */
.products-scroll-row .image-container {
    height: 160px;
}
.products-scroll-row .product-title {
    font-size: 15px;
}
.products-scroll-row .product-desc {
    font-size: 12px;
}

/* Компактные кнопки-стрелочки */
.scroll-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: #ffffff;
    color: #111827;
    border: 1px solid #e5e7eb;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    
    /* ИСПРАВЛЕНО: прячем стрелки по умолчанию и готовим к плавному проявлению */
    display: none; /* JS включит flex, если скролл нужен */
    opacity: 0;
    transition: background-color 0.2s, transform 0.2s, opacity 0.3s ease;
    
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

/* Класс, который JS добавит только тем стрелкам, где ширина превышена */
.scroll-arrow.should-show {
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
}

.scroll-arrow:hover {
    background-color: #f3f4f6;
    transform: translateY(-50%) scale(1.05);
}

.scroll-arrow.left { left: -18px; }
.scroll-arrow.right { right: -18px; }

@media (max-width: 768px) {
    .scroll-arrow { display: none !important; }
}

/* Кнопка удаления в корзине */
.remove-btn {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background-color 0.2s, transform 0.1s;
}

.remove-btn:hover {
    background-color: #fee2e2; /* Легкий красный фон при наведении */
    transform: scale(1.1);
}

/* Стили поисковой строки */
/* .search-container {
    max-width: 600px;
    margin: 0 auto 32px auto;
}

.search-input {
    width: 100%;
    padding: 14px 20px;
    font-size: 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    background-color: #ffffff;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
} */


.search-container {
    max-width: 600px;
    margin: 0 auto 40px auto;
    padding: 0 10px;
}

/* Обертка для позиционирования лупы внутри поля */
.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

/* Иконка лупы */
.search-icon {
    position: absolute;
    left: 18px;
    font-size: 18px;
    color: #9ca3af;
    pointer-events: none; /* Чтобы клик сквозь лупу активировал инпут */
    z-index: 5;
}

/* Новое жёлтое поле поиска */
.yellow-search {
    width: 100%;
    padding: 14px 20px 14px 48px !important; /* Увеличили левый отступ под лупу */
    font-size: 16px;
    font-weight: 500;
    border: 2px solid #f3f4f6;
    border-radius: 16px; /* Округлые углы в стиле Самоката */
    background-color: #f9fafb; /* Слегка сероватый в спокойном состоянии */
    outline: none;
    box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.02);
    /* Плавный переход цвета и тени при клике */
    transition: border-color 0.3s cubic-bezier(0.16, 1, 0.3, 1), 
                background-color 0.3s cubic-bezier(0.16, 1, 0.3, 1), 
                box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Эффект фокуса — поле заливается тёплым светом */
.yellow-search:focus {
    border-color: #feda1d;      /* Сочный жёлтый бордюр */
    background-color: #ffffff;   /* Поле становится чисто белым */
    /* Тёплое солнечное свечение вокруг поисковой строки */
    box-shadow: 0 10px 15px -3px rgba(254, 212, 45, 0.15), 
                0 4px 6px -2px rgba(254, 212, 45, 0.05);
}

/* Красивая анимация лупы при активации поля */
.search-input-wrapper:focus-within .search-icon {
    transform: scale(1.1);
    color: #111827;
}

/* Строго фиксируем размеры карточек товара в ленте */
.products-scroll-row .product-card {
    flex-shrink: 0 !important; /* Запрещаем карточкам сжиматься */
    width: 220px !important;   /* Компактная фиксированная ширина */
    max-width: 220px !important;
    height: 340px;            /* Ограничиваем высоту, чтобы они не были огромными */
}

.product-card {
    position: relative;
    /* ИСПРАВЛЕНО: Мягкий пастельный градиент от чисто-белого сверху к нежно-голубому снизу */
    background: linear-gradient(180deg, #ffffff 0%, #f0f9ff 100%);
    padding: 16px;
    border-radius: 16px;
    border: 1px solid #e0f2fe; /* Нежный голубоватый бордюр */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 350px;
    box-sizing: border-box;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), 
                box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1), 
                border-color 0.3s ease;
    overflow: hidden;
}

/* Эффект наведения на карточку */
.product-card:hover {
    transform: translateY(-6px);
    border-color: #bae6fd; /* Чуть более насыщенный пастельный голубой */
    /* ИСПРАВЛЕНО: Красивое прохладное небесно-голубое свечение при наведении */
    box-shadow: 0 20px 25px -5px rgba(125, 211, 252, 0.25), 
                0 10px 10px -5px rgba(125, 211, 252, 0.12);
}

/* Подложка под картинку (сделаем её полупрозрачной белой, чтобы она выделялась на градиенте) */
.product-img-wrapper {
    width: 100%;
    height: 160px;
    overflow: hidden;
    border-radius: 12px;
    margin-bottom: 12px;
    background: rgba(255, 255, 255, 0.7); /* Матовое белое стекло */
    border: 1px solid rgba(224, 242, 254, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Красивая анимация приближения картинки при наведении на карточку */
.product-img-wrapper img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain; /* Картинка аккуратно вписывается целиком, без обрезки краев */
    padding: 8px;        /* Добавляем внутренний отступ, чтобы фото не липло к краям */
    box-sizing: border-box;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.product-card:hover .product-img-wrapper img {
    transform: scale(1.06); /* Картинка плавно увеличивается */
}

.product-placeholder-icon {
    color: #d1d5db;
    font-size: 28px;
    transition: transform 0.3s ease;
}

.product-card:hover .product-placeholder-icon {
    transform: rotate(5deg) scale(1.1);
}

/* Стили цены */
.product-card-price {
    font-weight: 800;
    font-size: 18px;
    color: #111827;
    margin-bottom: 6px;
    flex-shrink: 0;
}

/* Стили заголовка */
.product-card-title {
    font-size: 14px;
    color: #4b5563;
    line-height: 1.4;
    font-weight: 500;
    height: 58px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    margin-bottom: 4px;
}

/* --- КРАСИВАЯ ЖЁЛТАЯ КНОПКА --- */
.yellow-btn {
    background: #feda1d; /* Основной сочный жёлтый цвет */
    color: #111827;
    border: none;
    width: 100%;
    padding: 11px;
    font-weight: 700;
    font-size: 14px;
    border-radius: 12px;
    cursor: pointer;
    flex-shrink: 0;
    box-shadow: 0 4px 6px -1px rgba(254, 212, 45, 0.2);
    transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
}

.yellow-btn:hover {
    background: #e5c212; /* Чуть темнее при наведении */
    box-shadow: 0 6px 12px -2px rgba(229, 194, 18, 0.3);
}

/* Анимация микровспышки/клика при нажатии */
.yellow-btn:active {
    transform: scale(0.97);
    background: #ccad10;
}

/* Начальное состояние категории: скрыта, смещена чуть вниз и уменьшена */
.category-section {
    opacity: 0;
    transform: translateY(30px) scale(0.98);
    transition: opacity 1.8s cubic-bezier(0.16, 1, 0.3, 1), 
                transform 1.8s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform; /* Оптимизация производительности рендеринга */
}

/* Состояние после того, как пользователь доскроллил до ленты */
.category-section.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.detail-buy-btn {
    width: auto !important;    /* Отменяем стопроцентную ширину */
    padding: 14px 36px;        /* Делаем кнопку более пухлой и солидной */
    font-size: 16px;           /* Увеличиваем размер шрифта */
    border-radius: 14px;       /* Чуть сильнее скругляем углы */
    display: inline-flex;
    align-items: center;
    gap: 8px;                  /* Отступ между иконкой корзины и текстом */
}

@media (max-width: 600px) {
    /* 1. Скрываем текстовые надписи "Войти", "Корзина" и имя пользователя */
    .header-nav .nav-text {
        display: none !important;
    }

    /* 2. Делаем иконки-эмодзи чуть крупнее, чтобы по ним было удобно тапать пальцем */
    .header-nav .nav-icon {
        font-size: 18px;
    }

    /* 3. Уменьшаем кнопку корзины до компактного квадрата с кружком */
    .header-nav .cart-button {
        padding: 8px 12px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* 4. Слегка корректируем отступы элементов в шапке, чтобы они стояли плотнее */
    .header-container {
        padding: 0 12px;
        height: 56px; /* Чуть уменьшаем высоту шапки на смартфонах */
    }

    .header-nav {
        gap: 12px;
    }

    .admin-link {
        font-size: 13px;
    }
}

.product-detail-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    background: white;
    padding: 32px;
    border-radius: 16px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    align-items: start;
}

.product-detail-image-box {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    background: #f9fafb;
    border: 1px solid #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

.product-detail-image-box img {
    width: 100%;
    max-height: 500px;
    object-fit: contain;
}

.product-detail-info-box {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.product-detail-name {
    font-size: 28px;
    font-weight: 800;
    color: #111827;
    margin-bottom: 8px;
    line-height: 1.2;
}

.product-detail-price-card {
    background: linear-gradient(180deg, #ffffff 0%, #f0f9ff 100%);
    padding: 20px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid #7dd3fc;
}

.price-label {
    font-size: 14px;
    color: #6b7280;
    display: block;
    margin-bottom: 2px;
}

.price-value {
    font-size: 26px;
    color: #111827;
    font-weight: 800;
}


/* --- СТРАНИЦА ТОВАРА: МОБИЛЬНАЯ АДАПТИВНОСТЬ --- */

@media (max-width: 768px) {
    /* Перестраиваем страницу в одну колонку */
    .product-detail-container {
        grid-template-columns: 1fr;
        gap: 24px;
        padding: 16px;
    }

    /* Уменьшаем высоту контейнера картинки на мобилках */
    .product-detail-image-box {
        min-height: 250px;
    }

    .product-detail-image-box img {
        max-height: 300px;
    }

    /* Уменьшаем размер заголовка, чтобы он влезал на экран */
    .product-detail-name {
        font-size: 22px;
    }

    /* ИСПРАВЛЕНО: Карточка цены перестраивается вертикально */
    .product-detail-price-card {
        flex-direction: column;
        align-items: stretch; /* Растягиваем внутренние элементы по ширине */
        gap: 16px;
        text-align: center;   /* Центрируем текст цены */
        padding: 16px;
    }

    /* Кнопка "В корзину" на мобильном телефоне становится широкой на 100% */
    .product-detail-price-card .detail-buy-btn {
        width: 100% !important;
        padding: 14px;
        box-sizing: border-box;
    }
}

/* --- КРАСИВАЯ ЗЕЛЕНАЯ ШАПКА С ИЗВИЛИСТОЙ ЛИНИЕЙ --- */

.green-gradient-header {
    /* Сочный градиент от изумрудного к глубокому травяному */
    background: linear-gradient(135deg, #10b981 0%, #047857 100%) !important;
    border-bottom: none !important;
    box-shadow: none !important;
    position: relative;
    /* Увеличиваем высоту, чтобы было место для изгиба линии */
    padding-bottom: 20px; 
}

/* Белый контрастный логотип */
.text-white-logo {
    color: #ffffff !important;
    font-weight: 800 !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Светлые ссылки навигации для зеленого фона */
.text-light-link {
    color: rgba(255, 255, 255, 0.9) !important;
    transition: color 0.2s ease;
}

.text-light-link:hover {
    color: #ffffff !important;
}

.font-bold-link {
    background: rgba(255, 255, 255, 0.15);
    padding: 6px 12px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
}

/* Компактная кнопка корзины в стиле шапки */
.green-cart-btn {
    background-color: #ffffff !important;
    color: #047857 !important; /* Зеленый текст */
    border-radius: 20px !important; /* Округлые аккуратные края */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.green-cart-btn:hover {
    background-color: #f3f4f6 !important;
}

/* Контрастный жёлтый кружок счетчика на белой корзине */
.cart-badge.yellow-badge {
    background-color: #feda1d !important;
    color: #111827 !important;
}

/* Обертка для SVG-волны */
.header-wave-wrapper {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    overflow: hidden;
    line-height: 0;
    transform: rotate(180deg); /* Переворачиваем волну вниз */
}

/* Стилизация самой извилистой линии */
.header-wave-wrapper svg {
    position: relative;
    display: block;
    width: calc(100% + 1.3px);
    height: 25px; /* Высота изгиба извилистой линии */
}

/* Окрашиваем волну строго в цвет фонового контента сайта (светло-серый) */
.header-wave-wrapper .wave-path {
    fill: #f9fafb; 
}


/* Корректируем мобильную адаптивность для новой шапки */
@media (max-width: 600px) {
    .green-gradient-header {
        padding-bottom: 15px;
    }
    .header-wave-wrapper svg {
        height: 15px; /* На мобилках делаем линию чуть тоньше */
    }
    .font-bold-link {
        background: none;
        padding: 0;
    }
}


.back-to-home-wrapper {
    margin-bottom: 24px;
    display: flex;
}

.back-to-home-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: #f3f4f6; /* Нейтральный светло-серый фон */
    color: #4b5563; /* Спокойный цвет текста */
    padding: 10px 18px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid #e5e7eb;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.back-to-home-btn:hover {
    background-color: #fed42d; /* Фирменный сочный жёлтый при наведении */
    color: #111827;
    border-color: #fed42d;
    transform: translateX(-4px); /* Лёгкий сдвиг влево, подчеркивающий действие «назад» */
    box-shadow: 0 4px 12px rgba(254, 212, 45, 0.2);
}

.back-to-home-btn .arrow-icon {
    font-size: 16px;
    transition: transform 0.2s ease;
}

.back-to-home-btn:hover .arrow-icon {
    transform: translateX(-2px); /* Стрелочка тоже слегка смещается */
}

/* Контейнер-обертка для позиционирования стрелок */
.carousel-container {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

/* Лента товаров с поддержкой горизонтального скролла */
.carousel-track {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-behavior: smooth;
    width: 100%;
    padding: 10px 0;
    /* Скрываем скроллбар в IE/Edge/Firefox */
    scrollbar-width: none; 
}

/* Скрываем скроллбар в Chrome/Safari/Opera */
.carousel-track::-webkit-scrollbar {
    display: none;
}


/* Общие стили для круглых стрелок */
.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%); /* Выравнивание ровно по центру высоты карточки 🎯 */
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.95);
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    color: #4f46e5;
    z-index: 20; /* Стрелки всегда ПОВЕРХ карточек товаров */
    transition: all 0.2s ease;
}

.carousel-arrow:hover {
    background-color: #ffffff;
    transform: translateY(-50%) scale(1.1); /* Сохраняем центрирование при увеличении */
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.2);
}

/* Позиционирование кнопок поверх краев ленты */
.carousel-arrow.prev {
    left: -22px; /* Выносим кнопку на половину её ширины влево */
}

.carousel-arrow.next {
    right: -22px; /* Выносим вправо */
}

/* На мобильных устройствах скрываем стрелки, там удобнее листать пальцем */
@media (max-width: 768px) {
    .carousel-arrow {
        display: none;
    }
}

.carousel-track .product-card {
    flex-shrink: 0;   /* Запрещает flex-контейнеру сплющивать карточку 🚫 */
    width: 220px;     /* Задайте фиксированную ширину карточки (подберите под ваш дизайн) */
}

.product-card img {
    width: 100%;
    height: 200px;       /* Фиксированная высота для картинок в каталоге */
    object-fit: cover;   /* Картинка заполнит область без искажения пропорций 📐 */
    display: block;
}


/* Скрываем стандартный скроллбар в Chrome/Safari/Opera */
.carousel-track::-webkit-scrollbar {
    display: none;
}
/* Сама плитка категории */
.category-tile {
    position: relative;
    display: block;
    height: 140px;                         /* Фиксированная высота для сохранения формы */
    border-radius: 16px;                   /* Скругленные углы */
    padding: 14px;
    text-decoration: none;
    overflow: hidden;                      /* Чтобы картинка не вылезала за границы */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Эффект при наведении/клике */
.category-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Текст внутри плитки */
.category-title {
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;                        /* Белый текст, как во ВкусВилле */
    line-height: 1.2;
    display: block;
    max-width: 70%;                        /* Текст не должен налегать на картинку справа */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1); /* Легкая тень для читаемости */
}

/* Изображение внутри плитки */
.category-img {
    position: absolute;
    bottom: -5px;                          /* Прижимаем к нижнему краю */
    right: -5px;                           /* Смещаем в правый угол */
    width: 95px;                           /* Размер картинки внутри плитки */
    height: 95px;
    object-fit: contain;                   /* Сохраняем пропорции изображения */
    pointer-events: none;                  /* Картинка не мешает клику по ссылке */
}