/* ===========================
   CATEGORIES SECTION STYLES
   Секция категорий на главной странице
   =========================== */

.categories-section {
    position: relative;
    padding: 80px 0;
    /* background-color: #fff; */
}

.categories-section .container {
    position: relative;
}

/* ===== ЗАГОЛОВОК СЕКЦИИ ===== */

.categories-header {
    margin-bottom: 50px;
}

/* Зеленая черточка */
.categories-divider {
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #7CB342, #9CCC65);
    margin-bottom: 15px;
    border-radius: 2px;
}

/* Подзаголовок */
.categories-section-title {
    font-size: 14px;
    font-weight: 500;
    color: #666;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 15px;
}

/* Основной заголовок */
.categories-main-title {
    font-size: clamp(28px, 4vw, 42px);
    font-weight: 600;
    line-height: 1.2;
    color: #333;
    margin: 0;
    letter-spacing: -0.5px;
}

/* ===== ОСНОВНАЯ СЕТКА КАТЕГОРИЙ ===== */

.categories-grid-layout {
    display: flex;
    gap: 15px;
    margin-bottom: 50px;
}

/* Левая часть - 4 маленьких карточки (2x2) */
.categories-small-grid {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* Правая часть - 1 большая карточка */
.categories-large-item {
    flex: 1;
}

/* ===== РАЗМЕРЫ КАРТОЧЕК ===== */

/* Маленькие карточки */
.category-small-item .category-card {
    height: 240px;
}

/* Большая карточка */
.categories-large-item .category-card {
    height: 495px;
    /* 240px * 2 + 15px gap */
}

/* ===== АДАПТАЦИЯ ТЕКСТА ДЛЯ МАЛЕНЬКИХ КАРТОЧЕК ===== */

.category-small-item .category-title {
    font-size: 16px;
    margin-bottom: 8px;
}

.category-small-item .category-overlay {
    padding: 15px 12px 12px;
}

.category-small-item .category-divider {
    width: 30px;
    margin-bottom: 8px;
}

.category-small-item .category-count {
    font-size: 13px;
}

.category-small-item .category-price {
    font-size: 14px;
}

.category-small-item .category-arrow {
    width: 36px;
    height: 36px;
}

.category-small-item .category-arrow img {
    width: 18px;
    height: 18px;
}

/* ===== КНОПКА "СМОТРЕТЬ ВСЕ КАТЕГОРИИ" ===== */

.categories-button-wrapper {
    text-align: center;
    margin-top: 40px;
}

.categories-button {
    display: inline-block;
    padding: 15px 40px;
    background: #ffffffc7;
    color: var(--color-button-primary);
    text-decoration: none;
    border: 2px solid var(--color-button-primary);
    border-radius: 6px;
    font-weight: 500;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.categories-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--color-button-primary);
    transition: left 0.3s ease;
    z-index: -1;
}

.categories-button:hover {
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(124, 179, 66, 0.3);
}

.categories-button:hover::before {
    left: 0;
}

/* Фоновое изображение */
.categories-image {
    position: absolute;
    left: 0;
    max-width: 290px;
    height: auto;
    pointer-events: none;
    bottom: -150px;
    z-index: -1;
}

.categories-image img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    filter: grayscale(20%);
}

/* ===== АДАПТИВНОСТЬ ===== */

/* Планшеты и средние экраны (до 1200px) */
@media (max-width: 1200px) {
    .categories-section {
        padding: 60px 0;
    }

    .categories-header {
        margin-bottom: 40px;
    }

    .categories-grid-layout {
        margin-bottom: 40px;
    }
}

/* Планшеты в портретной ориентации (до 992px) */
@media (max-width: 992px) {
    .categories-section {
        padding: 50px 0;
    }

    /* Скрываем большую карточку на средних экранах */
    .categories-large-item {
        display: none;
    }

    /* Растягиваем маленькую сетку на всю ширину */
    .categories-small-grid {
        flex: none;
        width: 100%;
        gap: 20px;
    }

    /* Увеличиваем высоту карточек когда убрали большую */
    .category-small-item .category-card {
        height: 280px;
    }

    .category-small-item .category-title {
        font-size: 18px;
        margin-bottom: 10px;
    }

    .category-small-item .category-overlay {
        padding: 20px 15px 15px;
    }

    .category-small-item .category-count {
        font-size: 14px;
    }

    .category-small-item .category-price {
        font-size: 15px;
    }

    .category-small-item .category-arrow {
        width: 40px;
        height: 40px;
    }

    .category-small-item .category-arrow img {
        width: 20px;
        height: 20px;
    }
}

/* Мобильные устройства (до 768px) */
@media (max-width: 768px) {
    .categories-section {
        padding: 40px 0;
    }

    .categories-header {
        margin-bottom: 30px;
    }

    .categories-divider {
        width: 50px;
        height: 2px;
        margin-bottom: 12px;
    }

    .categories-section-title {
        font-size: 13px;
        margin-bottom: 12px;
    }

    .categories-button {
        padding: 12px 30px;
        font-size: 14px;
    }

    /* Убираем hover эффекты на мобильных */
    .categories-button:hover {
        transform: none;
    }
}

/* Маленькие экраны (до 576px) */
@media (max-width: 576px) {

    /* Показываем только 2 категории в столбик */
    .categories-small-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    /* Скрываем 3-ю и 4-ю категории */
    .category-small-item:nth-child(3),
    .category-small-item:nth-child(4) {
        display: none;
    }

    /* Увеличиваем высоту оставшихся карточек */
    .category-small-item .category-card {
        height: 320px;
    }

    .category-small-item .category-title {
        font-size: 20px;
        margin-bottom: 12px;
    }

    .category-small-item .category-overlay {
        padding: 25px 18px 18px;
    }

    .category-small-item .category-divider {
        width: 40px;
        margin-bottom: 10px;
    }

    .category-small-item .category-count {
        font-size: 15px;
    }

    .category-small-item .category-price {
        font-size: 16px;
    }

    .category-small-item .category-arrow {
        width: 44px;
        height: 44px;
    }

    .category-small-item .category-arrow img {
        width: 22px;
        height: 22px;
    }

    .categories-button {
        width: 100%;
        padding: 14px 20px;
    }
}

/* Очень маленькие экраны (до 480px) */
@media (max-width: 480px) {
    .categories-section {
        padding: 30px 0;
    }

    .categories-grid-layout {
        margin-bottom: 30px;
    }

    .category-small-item .category-card {
        height: 280px;
    }

    .category-small-item .category-title {
        font-size: 18px;
    }

    .category-small-item .category-overlay {
        padding: 20px 15px 15px;
    }
}

/* ===== СПЕЦИАЛЬНЫЕ СТИЛИ ===== */

/* Темная тема */
/* @media (prefers-color-scheme: dark) {
    .categories-section {
        background-color: #1a1a1a;
    }

    .categories-main-title {
        color: #fff;
    }

    .categories-section-title {
        color: #999;
    }
} */

/* Анимации при скролле */
.categories-section.animate-in .categories-header {
    animation: slideInDown 0.8s ease-out;
}

.categories-section.animate-in .categories-small-grid {
    animation: slideInLeft 0.8s ease-out 0.2s both;
}

.categories-section.animate-in .categories-large-item {
    animation: slideInRight 0.8s ease-out 0.4s both;
}

.categories-section.animate-in .categories-button-wrapper {
    animation: fadeInUp 0.8s ease-out 0.6s both;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Улучшенная типографика */
.categories-main-title strong {
    color: #7CB342;
    font-weight: 700;
}

/* Focus states для доступности */
.categories-button:focus {
    outline: 2px solid #7CB342;
    outline-offset: 2px;
}

/* Стили для печати */
@media print {
    .categories-section {
        padding: 20px 0;
        background: white !important;
    }

    .categories-large-item {
        display: none;
    }

    .categories-button-wrapper {
        display: none;
    }

    .categories-main-title,
    .categories-section-title {
        color: black !important;
    }

    .categories-grid-layout {
        display: block;
    }

    .categories-small-grid {
        display: block;
    }

    .category-small-item {
        page-break-inside: avoid;
        margin-bottom: 15px;
    }
}

/* Высокий контраст */
@media (prefers-contrast: high) {
    .categories-main-title {
        color: #000;
    }

    .categories-section-title {
        color: #000;
    }

    .categories-button {
        color: #000;
        border-color: #000;
    }

    .categories-button:hover {
        background: #000;
        color: #fff;
    }

    .categories-divider {
        background: #000;
    }
}

/* Уменьшенная анимация */
@media (prefers-reduced-motion: reduce) {

    .categories-button,
    .categories-section.animate-in .categories-header,
    .categories-section.animate-in .categories-small-grid,
    .categories-section.animate-in .categories-large-item,
    .categories-section.animate-in .categories-button-wrapper {
        animation: none;
        transition: none;
    }

    .categories-button:hover {
        transform: none;
    }
}

/* Утилитарные классы */
.categories-section.no-button .categories-button-wrapper {
    display: none;
}

.categories-section.compact {
    padding: 40px 0;
}

/* RTL поддержка */
[dir="rtl"] .categories-section {
    direction: rtl;
}

[dir="rtl"] .categories-grid-layout {
    flex-direction: row-reverse;
}

[dir="rtl"] .categories-image {
    right: 0;
    left: auto;
}

.categories-image {}