.category-selector {
    display: flex;
    justify-content: center;
    flex-wrap: wrap; /* Позволяет кнопкам переноситься на новую строку на мобильных */
    gap: 0.75rem; /* Отступы между кнопками */
    margin-bottom: 2.5rem; /* Отступ от фильтра до сетки с акциями */
    padding: 1rem 0;
}

/* Стили для каждой кнопки-фильтра */
.category-selector a {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: 2px solid #dee2e6; /* Легкая серая рамка */
    border-radius: 50px; /* Создаем форму "пилюли" */

    color: #495057;
    font-size: 0.9em;
    font-weight: 600;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;

    transition: all 0.3s ease;
}

/* Эффект при наведении на НЕактивную кнопку */
.category-selector a:not(.active):hover {
    border-color: #007bff;
    color: #007bff;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

/* Стиль для АКТИВНОЙ кнопки-фильтра */
.category-selector a.active {
    background-color: #007bff;
    border-color: #007bff;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
    transform: translateY(-2px);
}

/* Дополнительно: убедимся, что у контейнера акций есть верхний отступ */
.promotions-container {
    padding-top: 1rem;
}

.promo-detail-container {
    display: grid;
    /* На десктопе 2 колонки: основная и сайдбар */
    grid-template-columns: 2fr 1fr;
    gap: 2.5rem;
}

.promo-detail-logo {
    width: 100%;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.promo-description h2, .promo-extra-info h2, .contact-info h2 {
    font-size: 1.4em;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
}

.promo-description p, .promo-extra-info p {
    line-height: 1.8;
    color: #495057;
}

/* Сайдбар */
.promo-detail-sidebar {
    background-color: #f8f9fa;
    padding: 2rem;
    border-radius: 12px;
    align-self: start; /* "Прилипает" к верху */
    position: sticky;
    top: 120px; /* Отступ от шапки + запас */
}

.category-tag {
    display: inline-block;
    background-color: #e7f3fe;
    color: #007bff;
    padding: 5px 12px;
    border-radius: 50px;
    font-size: 0.8em;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.promo-detail-title {
    font-size: 2.5em;
    margin-top: 0;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.promo-deal {
    font-size: 1.25em;
    color: #dc3545; /* Красный цвет для привлечения внимания к акции */
    font-weight: 500;
    margin-bottom: 2rem;
}

/* Блок контактов */
.contact-info {
    margin-bottom: 2rem;
}
.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 1.1em;
}
.contact-icon {
    width: 26px; /* Задаем точную ширину */
    height: 26px; /* и высоту */
    color: #495057; /* Нейтральный темно-серый цвет для иконки */
    flex-shrink: 0; /* Предотвращает сжатие иконки */
}

/* Правило для самого SVG внутри контейнера */
.contact-icon svg {
    width: 100%;
    height: 100%;
}

.contact-item a {
    color: #007bff;
    font-weight: 500;
    text-decoration: none;
    border-bottom: 1px dashed #007bff;
}

.contact-item a:hover {
    color: #0056b3;
    border-bottom-style: solid;
}

.telegram-icon {
    color: #0088cc; /* Фирменный синий цвет Telegram */
}

/* Кнопка "Назад" */
.back-button {
    width: 100%;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5em;
    background-color: #6c757d; /* Нейтральный серый */
}
.back-button:hover {
    background-color: #5a6268;
}
.back-button .arrow {
    transition: transform 0.2s ease;
}
.back-button:hover .arrow {
    transform: translateX(-4px);
}


/* --- Адаптивность для детальной страницы --- */
@media (max-width: 992px) {
    .promo-detail-container {
        /* На планшетах и мобильных - одна колонка */
        grid-template-columns: 1fr;
    }
    .promo-detail-sidebar {
        position: static; /* Отключаем "прилипание" сайдбара */
        order: -1; /* Ставим сайдбар ПЕРЕД основным контентом на мобильных */
    }
}

@media (max-width: 768px) {
    .category-selector {
        /* 1. Вместо центрирования, выравниваем по левому краю */
        justify-content: flex-start;

        /* 2. Запрещаем перенос строк */
        flex-wrap: nowrap;

        /* 3. Включаем горизонтальный скролл */
        overflow-x: auto;

        /* 4. Добавляем боковые отступы, чтобы скролл не прилипал к краям экрана */
        /* Используем отрицательные margin и положительные padding для красивого эффекта */
        padding-left: 20px;
        padding-right: 20px;
        margin-left: -20px;
        margin-right: -20px;

        /* 5. (Важно!) Скрываем сам некрасивый скроллбар */
        -ms-overflow-style: none;  /* IE и Edge */
        scrollbar-width: none;  /* Firefox */
    }

    /* Прячем скроллбар для Webkit-браузеров (Chrome, Safari) */
    .category-selector::-webkit-scrollbar {
        display: none;
    }

    /* 6. Делаем кнопки чуть компактнее для мобильных */
    .category-selector a {
        padding: 0.6rem 1.2rem;
        flex-shrink: 0; /* Запрещаем кнопкам сжиматься */
    }
}


.promo-activation-container {
    padding: 1.5rem 0;
    margin-bottom: 2rem;
    text-align: center;
    border-bottom: 1px solid #eee;
}

/* --- Стили для кнопки активации (компактный вариант) --- */

.activate-button {
    /* Возвращаем горизонтальное расположение */
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0.75rem; /* Отступ между иконкой и текстом */

    /* Задаем компактные размеры */
    padding: 0.8rem 1.8rem;
    font-size: 1.15em; /* Делаем текст заметным */
    font-weight: 700;

    /* Стили из предыдущей версии */
    background: linear-gradient(45deg, #007bff, #0056b3);
    border: none;
    border-radius: 10px; /* Слегка скругляем */
    box-shadow: 0 6px 12px rgba(0, 123, 255, 0.25);
    transition: all 0.3s ease;
}

.activate-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 18px rgba(0, 123, 255, 0.35);
}

.activate-button .icon {
    /* Контейнер теперь отвечает только за выравнивание */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1; /* Убираем лишнюю высоту строки */
    transition: transform 0.3s ease;
}

.activate-button .icon svg {
    /* Прямо задаем размер самому SVG-элементу */
    width: 1.3em; /* Размер относительно шрифта кнопки */
    height: 1.3em;
}

.activate-button:hover .icon {
    transform: rotate(15deg);
}


/* --- Стили для карточки активации акции и QR-кода (ВСЕ СОСТОЯНИЯ) --- */

/* Общая карточка для всех состояний */
.promo-activation-card {
    background: #fff;
    border-radius: 16px;
    padding: 2.5rem;
    margin-bottom: 2.5rem;
    text-align: center;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    border-top: 5px solid #007bff; /* Синяя полоса по умолчанию */
}

/* 1. Блок "ДО активации" */
.activation-prompt h2 {
    font-size: 1.8em;
    margin-top: 0;
    margin-bottom: 0.5rem;
    color: #333;
}
.activation-prompt p {
    font-size: 1.1em;
    color: #666;
    max-width: 600px;
    margin: 0 auto 1.5rem auto;
}

/* 2. Блок "ПОСЛЕ активации" (общие стили) */
.status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px dashed #ddd;
}
.status-tag {
    font-weight: bold;
    padding: 5px 12px;
    border-radius: 50px;
    font-size: 0.9em;
}
.date-tag {
    font-size: 0.9em;
    color: #888;
}

.qr-code-display h2 {
    font-size: 1.8em;
    margin-top: 0;
    margin-bottom: 0.5rem;
}
.qr-code-instruction {
    font-size: 1.1em;
    color: #666;
    margin-bottom: 1.5rem;
}

/* Модификатор "Активен" */
.promo-activation-card .is-active {
    border-top-color: #28a745; /* Зеленая полоса */
}
.qr-code-display.is-active h2 {
    color: #28a745; /* Зеленый заголовок */
}
.status-tag.active-tag {
    background-color: #eaf6ec;
    color: #28a745;
}

.qr-code-image {
    display: block;
    max-width: 280px;
    width: 100%;
    margin: 0 auto;
    border-radius: 8px;
    padding: 1rem;
    background: #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Модификатор "Использован" */
.promo-activation-card .is-used {
    border-top-color: #6c757d; /* Серая полоса */
}
.qr-code-display.is-used h2 {
    color: #6c757d; /* Серый заголовок */
}
.status-tag.used-tag {
    background-color: #f8f9fa;
    color: #6c757d;
}
.qr-code-display.is-used .button {
    margin-top: 1rem;
}