/* =========================================
   5. КАТАЛОГ И КАРТОЧКИ
   ========================================= */
.section-title {
    font-size: 26px;
    margin: 48px 0 24px;
    color: var(--text-main);
    border-left: 4px solid var(--brand-red);
    padding-left: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.section-title.no-border {
    border-left: none;
    padding-left: 0;
}

.products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 60px;
}

.product {
    background: var(--bg-card);
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: 0.2s;
    display: flex;
    flex-direction: column;
}

.product:hover {
    border-color: transparent;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    transform: translateY(-4px);
}

.product__image {
    background: #fff;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border-bottom: 1px solid var(--border-color);
}

.product__image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.product__body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product__title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.3;
}

.product__desc {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
    flex: 1;
}

.product__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}

.product__price {
    font-size: 18px;
    font-weight: 700;
    color: var(--brand-red);
}

/* Категории */
.category-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 24px;
    margin-bottom: 60px;
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
}

.category-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border-radius: 4px;
    overflow: hidden;
    text-decoration: none;
    transition: 0.2s ease-in-out;
    border: 1px solid var(--border-color);
    width: calc(33.333% - 16px);
    min-width: 240px;
    max-width: 320px;
}

.category-card:hover {
    border-color: transparent;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    transform: translateY(-4px);
}

.category-card__image {
    height: 180px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.category-card__image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.category-card:hover .category-card__image img {
    transform: scale(1.05);
}

.category-card__placeholder {
    width: 80px;
    height: 80px;
    background: #fef2f2;
    color: var(--brand-red);
    font-size: 36px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.category-card__title {
    padding: 20px;
    text-align: center;
    font-weight: 600;
    font-size: 16px;
    color: var(--text-main);
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-card:hover .category-card__title {
    color: var(--brand-red);
}

/* Подкатегории */
.subcategories-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    max-width: 900px;
    margin: 0 auto 40px auto;
}

.subcategory-card {
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--bg-card);
    padding: 20px 24px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    text-decoration: none;
    color: var(--text-main);
    font-weight: 600;
    font-size: 15px;
    transition: 0.2s;
    text-align: center;
    min-width: 220px;
    flex: 0 1 auto;
}

.subcategory-card:hover {
    border-color: #9ca3af;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

/* Бейдж акции на карточке товара */
.product__image {
    position: relative;
}

.promo-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--brand-red);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 4px;
    z-index: 10;
    box-shadow: 0 2px 10px rgba(209, 18, 42, 0.4);
    display: flex;
    align-items: center;
    gap: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    animation: pulseBadge 2s infinite;
}

.promo-badge .old-price-small {
    text-decoration: line-through;
    font-size: 10px;
    opacity: 0.7;
    font-weight: normal;
    margin-left: 4px;
}

/* Старая цена в футере карточки */
.product__price-old {
    font-size: 13px;
    color: #9ca3af;
    text-decoration: line-through;
    margin-right: 8px;
}

/* =========================================
   БЛОК ГОРЯЧИХ ПРЕДЛОЖЕНИЙ
   ========================================= */
.promo-section {
    background: #1f2937;
    padding: 40px 0;
    margin-bottom: 40px;
}

.promo-section__header {
    text-align: center;
    margin-bottom: 30px;
}

.promo-section__title {
    color: #fff;
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.promo-section__subtitle {
    color: #9ca3af;
    font-size: 15px;
}

/* Обертка для позиционирования стрелок */
.promo-carousel-wrapper {
    position: relative;
    padding: 0 40px; 
}

.promo-carousel {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    scroll-behavior: smooth;
    /* Отступы сверху/снизу для тени, по бокам для красоты */
    padding: 20px 0; 
    scrollbar-width: none; 
    -ms-overflow-style: none;
    justify-content: flex-start;
}

/* Убираем скроллбар */
.promo-carousel::-webkit-scrollbar {
    display: none;
}

/* Если товаров мало и они влезают — центрируем */
.promo-carousel.is-centered {
    justify-content: center;
}

/* Фейковые отступы по бокам, чтобы карточки не прилипали к краям при скролле */
.promo-carousel::before,
.promo-carousel::after {
    content: '';
    flex: 0 0 10px; /* Ширина отступа */
}

/* Карточка */
.promo-card {
    flex: 0 0 320px; 
    background: #fff;
    border-radius: 8px;
    display: flex;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.promo-card:hover {
    box-shadow: 0 10px 30px rgba(209, 18, 42, 0.4);
    transform: scale(1.03);
}

/* Картинка слева */
.promo-card__img-box {
    width: 120px;
    flex-shrink: 0;
    position: relative;
    background: #f9fafb;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border-right: 1px solid #e5e7eb;
}

.promo-card__img-box img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.promo-card__badge {
    position: absolute;
    top: 5px;
    left: 5px;
    background: var(--brand-red);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    padding: 3px 6px;
    border-radius: 4px;
}

/* Информация справа */
.promo-card__info {
    padding: 12px;
    display: flex;
    flex-direction: column;
    flex: 1;
    justify-content: space-between;
}

.promo-card__title {
    font-size: 13px;
    font-weight: 600;
    color: #1f2937;
    text-decoration: none;
    line-height: 1.3;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.promo-card__prices {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.promo-card__price-old {
    font-size: 12px;
    color: #9ca3af;
    text-decoration: line-through;
}

.promo-card__price-new {
    font-size: 18px;
    font-weight: 800;
    color: var(--brand-red);
}

/* Кнопки навигации */
.promo-carousel__btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    color: #1f2937;
    border: none;
    font-size: 18px;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    display: none;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.promo-carousel__btn:hover {
    background: var(--brand-red);
    color: #fff;
}

.promo-carousel__btn--prev { left: 0; }
.promo-carousel__btn--next { right: 0; }

/* Показываем стрелки только если есть класс is-scrollable */
.promo-carousel-wrapper.is-scrollable .promo-carousel__btn {
    display: flex;
}

@media (max-width: 1300px) {
    .promo-carousel-wrapper { padding: 0 20px; }
}

@media (max-width: 768px) {
    .promo-card { flex: 0 0 280px; }
    .promo-carousel__btn { display: none !important; }
    
    /* Убираем фейковые отступы на телефоне */
    .promo-carousel::before,
    .promo-carousel::after {
        display: none;
    }
}