/**
 * Стили главной страницы.
 * Подключается только на is_front_page().
 */

.home-page {
    /* Общий контейнер */
}

/* Отступы между блоками */
.home-page > section {
    padding: 50px 0;
}

.home-page > section:nth-child(even) {
    /*background: #faf8f5;*/

}

/* Заголовки секций */
.home-section-title {
    text-align: center;
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 35px;
    color: var(--color-text);
}

@media (max-width: 768px) {
    .home-page > section {
        padding: 35px 0;
    }
    .home-section-title {
        font-size: 22px;
        margin-bottom: 25px;
    }
}

/* ============================================================
 *  БЛОК 1: БАННЕРЫ (КАРУСЕЛЬ)
 * ============================================================ */
.home-banners {
    padding: 30px 0 20px;
}

.home-banners .container {
    max-width: 1400px;
}

/* Карусель */
.home-banner-carousel {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
}

.home-banner-carousel__track {
    position: relative;
    width: 100%;
    aspect-ratio: 1400 / 400;
    background: #f5f0e8;
}

.home-banner-carousel__slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease;
}

.home-banner-carousel__slide.is-active {
    opacity: 1;
    visibility: visible;
    position: relative;
}

.home-banner-slide {
    width: 100%;
    height: 100%;
}

.home-banner-slide__link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
}

.home-banner-slide__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.home-banner-slide__img--mobile {
    display: none;
}

/* Одиночный баннер */
.home-banner-single {
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 1400 / 400;
    background: #f5f0e8;
}

.home-banner-single a {
    display: block;
    width: 100%;
    height: 100%;
}

.home-banner-single img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.home-banner-single .home-banner-slide__img--mobile {
    display: none;
}

/* Стрелки */
.home-banner-carousel__arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    color: var(--color-text);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.25s;
    z-index: 5;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
}

.home-banner-carousel:hover .home-banner-carousel__arrow {
    opacity: 1;
    visibility: visible;
}

.home-banner-carousel__arrow:hover {
    background: var(--color-primary);
    color: #fff;
}

.home-banner-carousel__arrow--prev {
    left: 18px;
}

.home-banner-carousel__arrow--next {
    right: 18px;
}

/* Точки */
.home-banner-carousel__dots {
    position: absolute;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 5;
    background: rgba(0, 0, 0, 0.25);
    padding: 8px 12px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
}

.home-banner-carousel__dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    padding: 0;
    transition: 0.2s;
}

.home-banner-carousel__dot:hover {
    background: rgba(255, 255, 255, 0.8);
}

.home-banner-carousel__dot.is-active {
    background: #fff;
    width: 24px;
    border-radius: 5px;
}

/* Мобильные */
@media (max-width: 768px) {
    .home-banners {
        padding: 15px 0 10px;
    }

    .home-banner-carousel {
        border-radius: 8px;
    }

    .home-banner-carousel__track {
        aspect-ratio: 4 / 3;
    }

    /* Мобильные картинки */
    .home-banner-slide__img--desktop {
        display: none;
    }
    .home-banner-slide__img--mobile {
        display: block;
    }
    .home-banner-slide:not(.has-mobile) .home-banner-slide__img--desktop {
        display: block;
    }
    .home-banner-slide:not(.has-mobile) .home-banner-slide__img--mobile {
        display: none;
    }

    .home-banner-single {
        aspect-ratio: 4 / 3;
        border-radius: 8px;
    }
    .home-banner-single .home-banner-slide__img--desktop {
        display: none;
    }
    .home-banner-single .home-banner-slide__img--mobile {
        display: block;
    }
    .home-banner-single:not(.has-mobile) .home-banner-slide__img--desktop {
        display: block;
    }
    .home-banner-single:not(.has-mobile) .home-banner-slide__img--mobile {
        display: none;
    }

    .home-banner-carousel__arrow {
        width: 38px;
        height: 38px;
        font-size: 14px;
        opacity: 1;
        visibility: visible;
    }
    .home-banner-carousel__arrow--prev {
        left: 8px;
    }
    .home-banner-carousel__arrow--next {
        right: 8px;
    }

    .home-banner-carousel__dots {
        bottom: 10px;
        padding: 6px 10px;
        gap: 6px;
    }
    .home-banner-carousel__dot {
        width: 7px;
        height: 7px;
    }
    .home-banner-carousel__dot.is-active {
        width: 20px;
    }
}

/* ============================================================
 *  БЛОК 2: ТИЗЕРЫ (4 ПРЕИМУЩЕСТВА)
 * ============================================================ */
.home-features {
    padding: 40px 0;
}

.home-features__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.home-feature {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 22px;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    transition: 0.25s;
}

.home-feature:hover {
    border-color: var(--color-primary);
    box-shadow: 0 4px 14px rgba(139, 90, 43, 0.08);
    transform: translateY(-2px);
}

.home-feature__icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.home-feature__icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.home-feature__body {
    flex: 1;
    min-width: 0;
}

.home-feature__title {
    margin: 0 0 6px;
    font-size: 16px;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1.3;
}

.home-feature__text {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--color-text-muted);
}

/* Планшет — 2 в ряд */
@media (max-width: 1024px) {
    .home-features__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Мобильные — 1 в ряд */
@media (max-width: 600px) {
    .home-features {
        padding: 25px 0;
    }
    .home-features__grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .home-feature {
        padding: 16px;
        gap: 12px;
    }
    .home-feature__icon {
        width: 40px;
        height: 40px;
    }
    .home-feature__title {
        font-size: 15px;
    }
    .home-feature__text {
        font-size: 12px;
    }
}

/* ============================================================
 *  БЛОК 3: РАЗДЕЛЫ (8 КАТЕГОРИЙ)
 * ============================================================ */
.home-categories {
    padding: 50px 0;
}

.home-categories__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.home-category {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    transition: 0.25s;
}

.home-category:hover {
    border-color: var(--color-primary);
    box-shadow: 0 6px 20px rgba(139, 90, 43, 0.12);
    transform: translateY(-3px);
}

.home-category__image {
    aspect-ratio: 4 / 3;
    background: #f5f0e8;
    overflow: hidden;
}

.home-category__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.home-category:hover .home-category__image img {
    transform: scale(1.05);
}

.home-category__body {
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.home-category__name {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text);
    line-height: 1.3;
    transition: 0.2s;

    /* Ограничение: максимум 2 строки */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.home-category:hover .home-category__name {
    color: var(--color-primary);
}

.home-category__count {
    font-size: 12px;
    color: var(--color-text-muted);
}

/* Планшет — 3 в ряд */
@media (max-width: 1024px) {
    .home-categories__grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }
}

/* Малый планшет — 2 в ряд */
@media (max-width: 768px) {
    .home-categories {
        padding: 30px 0;
    }
    .home-categories__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .home-category__body {
        padding: 10px 12px;
    }
    .home-category__name {
        font-size: 13px;
    }
    .home-category__count {
        font-size: 11px;
    }
}

/* Мобильный — 2 в ряд (компактно) */
@media (max-width: 480px) {
    .home-categories__grid {
        gap: 8px;
    }
    .home-category__body {
        padding: 8px 10px;
    }
    .home-category__name {
        font-size: 12px;
    }
}

/* ============================================================
 *  БЛОК 4: SEO-ТЕКСТ
 * ============================================================ */
.home-seo-text {
    padding: 50px 0;
    background: #fff;
}

.home-seo-text__inner {
    max-width: 1000px;
    margin: 0 auto;
}

.home-seo-text__title {
    font-size: 26px;
    font-weight: 700;
    margin: 0 0 20px;
    color: var(--color-text);
    line-height: 1.3;
}

.home-seo-text__content {
    position: relative;
}

.home-seo-text__body {
    font-size: 15px;
    line-height: 1.7;
    color: var(--color-text);

    /* Свёрнуто — 10 строк */
    max-height: 17em; /* 10 строк × 1.7 */
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.home-seo-text__content.is-expanded .home-seo-text__body {
    max-height: 5000px; /* Большое значение для плавного раскрытия */
}

/* Затемнение снизу, когда свёрнуто */
.home-seo-text__content:not(.is-expanded) .home-seo-text__body::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(180deg, rgba(255,255,255,0) 0%, #fff 100%);
    pointer-events: none;
}

.home-seo-text__body p {
    margin: 0 0 15px;
}

.home-seo-text__body p:last-child {
    margin-bottom: 0;
}

.home-seo-text__body h2,
.home-seo-text__body h3 {
    margin: 20px 0 12px;
    color: var(--color-text);
    line-height: 1.3;
}

.home-seo-text__body ul,
.home-seo-text__body ol {
    margin: 0 0 15px;
    padding-left: 25px;
}

.home-seo-text__body a {
    color: var(--color-primary);
    text-decoration: underline;
}

.home-seo-text__body a:hover {
    color: var(--color-primary-dark);
}

/* Кнопка «Читать полностью» */
.home-seo-text__toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 15px;
    padding: 10px 20px;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    color: var(--color-primary);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: 0.2s;
}

.home-seo-text__toggle:hover {
    border-color: var(--color-primary);
    background: var(--color-bg-light);
}

.home-seo-text__toggle i {
    font-size: 12px;
    transition: transform 0.3s;
}

.home-seo-text__content.is-expanded .home-seo-text__toggle i {
    transform: rotate(180deg);
}

/* Если контент короткий — кнопка не нужна */
.home-seo-text__content.is-short .home-seo-text__toggle {
    display: none;
}

.home-seo-text__content.is-short .home-seo-text__body {
    max-height: none;
    overflow: visible;
}

.home-seo-text__content.is-short .home-seo-text__body::after {
    display: none;
}

/* Мобильные */
@media (max-width: 768px) {
    .home-seo-text {
        padding: 30px 0;
    }
    .home-seo-text__title {
        font-size: 20px;
        margin-bottom: 15px;
    }
    .home-seo-text__body {
        font-size: 14px;
        line-height: 1.6;
        max-height: 16em; /* 4 строки × 1.6 */
    }
    .home-seo-text__toggle {
        width: 100%;
        justify-content: center;
        padding: 12px;
        font-size: 13px;
    }
}

/* ============================================================
 *  БЛОК 6: О НАС
 * ============================================================ */
.home-about {
    padding: 60px 0;
    background: #fff;
}

.home-about__inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

/* Текст */
.home-about__text {
    min-width: 0;
}

.home-about__title {
    margin: 0 0 20px;
    font-size: 30px;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1.3;
}

.home-about__content {
    font-size: 15px;
    line-height: 1.7;
    color: var(--color-text);
}

.home-about__content p {
    margin: 0 0 15px;
}

.home-about__content p:last-child {
    margin-bottom: 0;
}

.home-about__content ul,
.home-about__content ol {
    margin: 0 0 15px;
    padding-left: 25px;
}

.home-about__content a {
    color: var(--color-primary);
    text-decoration: underline;
}

.home-about__content strong {
    font-weight: 700;
}

/* Картинка */
.home-about__image {
    border-radius: 12px;
    overflow: hidden;
    background: #f5f0e8;
    aspect-ratio: 4 / 3;
}

.home-about__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Планшет */
@media (max-width: 900px) {
    .home-about__inner {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

/* Мобильные */
@media (max-width: 768px) {
    .home-about {
        padding: 40px 0;
    }
    .home-about__title {
        font-size: 22px;
        margin-bottom: 15px;
    }
    .home-about__content {
        font-size: 14px;
        line-height: 1.6;
    }
}

/* ============================================================
 *  БЛОК 7: ТОВАРЫ ВКЛАДКАМИ
 * ============================================================ */
.home-products {
    padding: 50px 0;
}

/* Вкладки */
.home-products__tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.home-products__tab {
    padding: 10px 24px;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 30px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    color: var(--color-text);
    cursor: pointer;
    transition: 0.2s;
}

.home-products__tab:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.home-products__tab.is-active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}

/* Панели */
.home-products__pane {
    display: none;
}

.home-products__pane.is-active {
    display: block;
    animation: homeProductsFadeIn 0.4s ease;
}

@keyframes homeProductsFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Сетка товаров — та же, что и везде */
.home-products .products-grid {
    grid-template-columns: repeat(4, 1fr);
}

/* Адаптив */
@media (max-width: 1024px) {
    .home-products .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .home-products {
        padding: 30px 0;
    }
    .home-products__tabs {
        gap: 6px;
        margin-bottom: 20px;
    }
    .home-products__tab {
        padding: 8px 16px;
        font-size: 13px;
    }
    .home-products .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================================
 *  БЛОК 10: СЛАЙДЕР ОТЗЫВОВ
 * ============================================================ */
.home-reviews {
    padding: 50px 0;
    /*background: var(--color-bg-light);*/
}

.home-reviews__carousel {
    position: relative;
    overflow: hidden;
    padding: 10px 0;
    user-select: none;
    -webkit-user-select: none;
}

.home-reviews__track {
    display: flex;
    gap: 20px;
    transition: transform 0.4s ease;
    will-change: transform;
}

/* Карточка отзыва */
.home-review {
    flex: 0 0 calc((100% - 2 * 20px) / 3);
    /*background: #fff;*/
    background: var(--color-bg-light);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-sizing: border-box;
}

.home-review__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    flex-wrap: wrap;
}

.home-review__author {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.home-review__avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--color-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    flex-shrink: 0;
    text-transform: uppercase;
}

.home-review__info {
    min-width: 0;
}

.home-review__name {
    font-size: 15px;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1.2;
    margin-bottom: 3px;
}

.home-review__city {
    font-size: 12px;
    color: var(--color-text-muted);
}

.home-review__rating {
    display: flex;
    gap: 2px;
    font-size: 14px;
    color: #ddd;
}

.home-review__rating .fa-star.is-filled {
    color: #ffb800;
}

.home-review__text {
    font-size: 14px;
    line-height: 1.6;
    color: var(--color-text);
    flex: 1;
}

.home-review__text p {
    margin: 0 0 10px;
}

.home-review__text p:last-child {
    margin-bottom: 0;
}

/* Стрелки */
.home-reviews__arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid var(--color-border);
    color: var(--color-text);
    font-size: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
    z-index: 5;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.1);
}

.home-reviews__arrow:hover:not(:disabled) {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}

.home-reviews__arrow:disabled {
    opacity: 0.3;
    cursor: default;
}

.home-reviews__arrow--prev {
    left: 0;
}

.home-reviews__arrow--next {
    right: 0;
}

/* Точки */
.home-reviews__dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 25px;
}

.home-reviews__dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    border: none;
    background: #d0c5b5;
    cursor: pointer;
    padding: 0;
    transition: 0.2s;
}

.home-reviews__dot:hover {
    background: #b8a894;
}

.home-reviews__dot.is-active {
    background: var(--color-primary);
    width: 24px;
    border-radius: 5px;
}

/* Адаптив */
@media (max-width: 1024px) {
    .home-review {
        flex: 0 0 calc((100% - 20px) / 2);
    }
}

@media (max-width: 768px) {
    .home-reviews {
        padding: 30px 0;
    }
    .home-reviews__track {
        gap: 12px;
    }
    .home-review {
        flex: 0 0 100%;
        padding: 18px;
    }
    .home-review__avatar {
        width: 38px;
        height: 38px;
        font-size: 16px;
    }
    .home-review__name {
        font-size: 14px;
    }
    .home-review__text {
        font-size: 13px;
    }
    .home-reviews__arrow {
        display: none;
    }
}

/* ============================================================
 *  БЛОК 11: FAQ (ВОПРОС-ОТВЕТ)
 * ============================================================ */
.home-faq {
    padding: 50px 0;
    background: #fff;
}

.home-faq__head {
    text-align: center;
    margin-bottom: 35px;
}

.home-faq__subtitle {
    margin: 10px 0 0;
    font-size: 15px;
    color: var(--color-text-muted);
}

.home-faq__list {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Элемент */
.home-faq__item {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.2s;
}

.home-faq__item:hover {
    border-color: #d0c5b5;
}

.home-faq__item.is-open {
    border-color: var(--color-primary);
}

/* Вопрос */
.home-faq__question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    width: 100%;
    padding: 18px 22px;
    background: none;
    border: none;
    text-align: left;
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    color: var(--color-text);
    cursor: pointer;
    transition: 0.2s;
    line-height: 1.4;
}

.home-faq__question:hover {
    background: var(--color-bg-light);
}

.home-faq__item.is-open .home-faq__question {
    color: var(--color-primary);
}

.home-faq__question-text {
    flex: 1;
    min-width: 0;
}

/* Иконка */
.home-faq__icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--color-bg-light);
    color: var(--color-primary);
    font-size: 12px;
    transition: transform 0.3s, background 0.2s, color 0.2s;
}

.home-faq__item.is-open .home-faq__icon {
    transform: rotate(180deg);
    background: var(--color-primary);
    color: #fff;
}

/* Ответ */
.home-faq__answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
}

.home-faq__item.is-open .home-faq__answer {
    max-height: 2000px;
}

.home-faq__answer-inner {
    padding: 0 22px 22px;
    font-size: 15px;
    line-height: 1.7;
    color: var(--color-text);
}

.home-faq__answer-inner p {
    margin: 0 0 12px;
}

.home-faq__answer-inner p:last-child {
    margin-bottom: 0;
}

.home-faq__answer-inner ul,
.home-faq__answer-inner ol {
    margin: 0 0 12px;
    padding-left: 25px;
}

.home-faq__answer-inner a {
    color: var(--color-primary);
    text-decoration: underline;
}

/* Мобильные */
@media (max-width: 768px) {
    .home-faq {
        padding: 30px 0;
    }
    .home-faq__list {
        gap: 8px;
    }
    .home-faq__question {
        padding: 14px 16px;
        font-size: 14px;
        gap: 12px;
    }
    .home-faq__icon {
        width: 26px;
        height: 26px;
        font-size: 10px;
    }
    .home-faq__answer-inner {
        padding: 0 16px 16px;
        font-size: 13px;
        line-height: 1.6;
    }
}

/* ============================================================
 *  БЛОК 8: СЛАЙДЕР СТАТЕЙ
 * ============================================================ */
.home-articles {
    padding: 50px 0;
    background: #fff;
}

.home-articles__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.home-articles__head .home-section-title {
    margin: 0;
    text-align: left;
}

.home-articles__all {
    color: var(--color-primary);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: 0.2s;
}

.home-articles__all:hover {
    color: var(--color-primary-dark);
}

/* Карусель */
.home-articles__carousel {
    position: relative;
    overflow: hidden;
    padding: 10px 0;
    user-select: none;
    -webkit-user-select: none;
}

.home-articles__track {
    display: flex;
    gap: 20px;
    transition: transform 0.4s ease;
    will-change: transform;
}

/* Карточка статьи */
.home-article {
    flex: 0 0 calc((100% - 2 * 20px) / 3);
    box-sizing: border-box;
}

.home-article__link {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    transition: 0.25s;
}

.home-article__link:hover {
    border-color: var(--color-primary);
    box-shadow: 0 6px 20px rgba(139, 90, 43, 0.1);
    transform: translateY(-3px);
}

.home-article__image {
    aspect-ratio: 16 / 10;
    background: #f5f0e8;
    overflow: hidden;
}

.home-article__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s;
}

.home-article__link:hover .home-article__image img {
    transform: scale(1.05);
}

.home-article__body {
    padding: 16px 18px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.home-article__meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: var(--color-text-muted);
    flex-wrap: wrap;
}

.home-article__category {
    color: var(--color-primary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.home-article__title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: 0.2s;
}

.home-article__link:hover .home-article__title {
    color: var(--color-primary);
}

.home-article__excerpt {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--color-text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.home-article__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid #f0ece4;
    font-size: 12px;
    color: var(--color-text-muted);
}

.home-article__author {
    font-weight: 500;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 50%;
}

.home-article__rating {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    color: #ffb800;
    font-weight: 600;
    margin-right: 10px;
}

.home-article__rating i {
    font-size: 12px;
}

.home-article__read {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Стрелки */
.home-articles__arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid var(--color-border);
    color: var(--color-text);
    font-size: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
    z-index: 5;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.1);
}

.home-articles__arrow:hover:not(:disabled) {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}

.home-articles__arrow:disabled {
    opacity: 0.3;
    cursor: default;
}

.home-articles__arrow--prev {
    left: 0;
}

.home-articles__arrow--next {
    right: 0;
}

/* Точки */
.home-articles__dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 25px;
}

.home-articles__dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    border: none;
    background: #d0c5b5;
    cursor: pointer;
    padding: 0;
    transition: 0.2s;
}

.home-articles__dot:hover {
    background: #b8a894;
}

.home-articles__dot.is-active {
    background: var(--color-primary);
    width: 24px;
    border-radius: 5px;
}

/* ============================================================
 *  БЛОК 9: НОВОСТИ — СЕТКА
 * ============================================================ */
.home-news {
    padding: 50px 0;
    /*background: var(--color-bg-light);*/
}

.home-news__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.home-news__head .home-section-title {
    margin: 0;
    text-align: left;
}

.home-news__all {
    color: var(--color-primary);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: 0.2s;
}

.home-news__all:hover {
    color: var(--color-primary-dark);
}

.home-news__grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr 1fr;
    gap: 20px;
    align-items: stretch;
}

/* Карточка новости */
.home-news-card {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    overflow: hidden;
    transition: 0.25s;
}

.home-news-card:hover {
    border-color: var(--color-primary);
    box-shadow: 0 6px 20px rgba(139, 90, 43, 0.1);
    transform: translateY(-3px);
}

.home-news-card__link {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
}

.home-news-card__image {
    aspect-ratio: 16 / 10;
    background: #f5f0e8;
    overflow: hidden;
}

.home-news-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s;
}

.home-news-card:hover .home-news-card__image img {
    transform: scale(1.05);
}

.home-news-card__body {
    padding: 16px 18px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.home-news-card__date {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--color-text-muted);
}

.home-news-card__date i {
    font-size: 11px;
}

.home-news-card__title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: 0.2s;
}

.home-news-card__link:hover .home-news-card__title {
    color: var(--color-primary);
}

.home-news-card__excerpt {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--color-text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Акцентная (первая) новость */
.home-news-card--featured .home-news-card__image {
    aspect-ratio: 16 / 9;
}

.home-news-card--featured .home-news-card__title {
    font-size: 20px;
    -webkit-line-clamp: 3;
}

.home-news-card--featured .home-news-card__excerpt {
    font-size: 14px;
    -webkit-line-clamp: 3;
}

.home-news-card--featured .home-news-card__body {
    padding: 20px 22px 22px;
}

/* Адаптив */
@media (max-width: 1024px) {
    .home-article {
        flex: 0 0 calc((100% - 20px) / 2);
    }

    .home-news__grid {
        grid-template-columns: 1fr 1fr;
    }

    .home-news-card--featured {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    .home-articles,
    .home-news {
        padding: 30px 0;
    }

    .home-articles__head,
    .home-news__head {
        margin-bottom: 20px;
    }

    .home-articles__track {
        gap: 12px;
    }

    .home-article {
        flex: 0 0 100%;
    }

    .home-articles__arrow {
        display: none;
    }

    .home-article__title {
        font-size: 15px;
    }

    .home-article__excerpt {
        font-size: 12px;
    }

    /* Новости */
    .home-news__grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .home-news-card--featured .home-news-card__title {
        font-size: 17px;
    }

    .home-news-card__title {
        font-size: 15px;
    }
}

/* ============================================================
 *  БЛОК «ФОРМА НА ГЛАВНОЙ»
 * ============================================================ */

/* Секция */
.home-form {
    padding: 60px 0;
    /*background: var(--color-bg-light);*/
}

.home-form__inner {
    max-width: 900px;
    margin: 0 auto;
}

.home-form__head {
    text-align: center;
    margin-bottom: 30px;
}

.home-form__title {
    margin: 0 0 10px;
    font-size: 28px;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1.3;
}

.home-form__subtitle {
    margin: 0;
    font-size: 15px;
    color: var(--color-text-muted);
}

/* Карточка вокруг формы */
.home-form__form {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--color-border);
}

/* ============================================================
 *  СЕТКА ДЛЯ ФОРМЫ — 2 КОЛОНКИ
 * ============================================================ */
.home-form__form .cf7-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.home-form__form .cf7-col {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}

/* Убираем лишние отступы и переносы от CF7 */
.home-form__form .wpcf7-form p {
    margin: 0;
}

.home-form__form .wpcf7-form br {
    display: none;
}

.home-form__form .wpcf7-form label {
    display: block;
    font-size: 14px;
    color: var(--color-text);
    font-weight: 500;
    margin: 0;
}

/* Поля ввода */
.home-form__form .wpcf7-form input[type="text"],
.home-form__form .wpcf7-form input[type="tel"],
.home-form__form .wpcf7-form input[type="email"],
.home-form__form .wpcf7-form textarea {
    width: 100%;
    padding: 14px 16px;
    margin-top: 6px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    color: var(--color-text);
    background: #fff;
    outline: none;
    transition: 0.2s;
    box-sizing: border-box;
}

.home-form__form .wpcf7-form input:focus,
.home-form__form .wpcf7-form textarea:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(139, 90, 43, 0.1);
}

/* Textarea в правой колонке — растягивается на всю высоту */
.home-form__form .cf7-col .cf7-form-row--textarea {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin: 0;
}

.home-form__form .cf7-col .cf7-form-row--textarea label {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.home-form__form .cf7-col .cf7-form-row--textarea .wpcf7-form-control-wrap {
    flex: 1;
    display: flex;
}

.home-form__form .cf7-col .cf7-form-row--textarea textarea {
    flex: 1;
    min-height: 180px;
    resize: vertical;
}

/* ============================================================
 *  НИЖНЯЯ СТРОКА: КНОПКА СЛЕВА + СОГЛАСИЕ СПРАВА
 * ============================================================ */

/* Обёртка нижней строки — flex */
.home-form__form .cf7-bottom-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-top: 20px;
}

/* Кнопка — слева */
.home-form__form .cf7-bottom-row .cf7-form-row--submit {
    flex: 0 0 auto;
    width: 40%;
    margin: 0;
}

.home-form__form .cf7-bottom-row .cf7-form-row--submit p {
    margin: 0;
}

.home-form__form .wpcf7-form input[type="submit"] {
    width: 100%;
    padding: 16px 24px;
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: 0.2s;
    margin: 0;
    min-height: 52px;
}

.home-form__form .wpcf7-form input[type="submit"]:hover {
    background: var(--color-primary-dark);
}

/* Согласие — справа */
.home-form__form .cf7-bottom-row .cf7-form-row--acceptance {
    flex: 1;
    margin: 0;
}

.home-form__form .cf7-bottom-row .cf7-form-row--acceptance p {
    margin: 0;
}

.home-form__form .wpcf7-form .wpcf7-acceptance {
    margin: 0;
}

.home-form__form .wpcf7-form .wpcf7-acceptance label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    color: var(--color-text-muted);
    font-weight: 400;
    cursor: pointer;
    line-height: 1.4;
    margin: 0;
}

.home-form__form .wpcf7-form .wpcf7-acceptance input[type="checkbox"] {
    margin: 3px 0 0;
    flex-shrink: 0;
    cursor: pointer;
}

.home-form__form .wpcf7-form .wpcf7-acceptance a {
    color: var(--color-primary);
    text-decoration: underline;
}

/* Сообщения об отправке */
.home-form__form .wpcf7-response-output {
    margin: 15px 0 0;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    border: none !important;
}

.home-form__form .wpcf7-form.sent .wpcf7-response-output {
    background: #e8f5e9;
    color: #2e7d32;
    border-left: 4px solid #4caf50 !important;
}

.home-form__form .wpcf7-form.invalid .wpcf7-response-output,
.home-form__form .wpcf7-form.failed .wpcf7-response-output {
    background: #ffebee;
    color: #c62828;
    border-left: 4px solid #f44336 !important;
}

/* ============================================================
 *  МОБИЛЬНЫЕ
 * ============================================================ */
@media (max-width: 768px) {
    .home-form {
        padding: 40px 0;
    }

    .home-form__title {
        font-size: 22px;
    }

    .home-form__subtitle {
        font-size: 14px;
    }

    .home-form__form {
        padding: 20px;
        border-radius: 10px;
    }

    /* Сетка — в одну колонку */
    .home-form__form .cf7-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .home-form__form .cf7-col .cf7-form-row--textarea textarea {
        min-height: 100px;
    }

    /* Нижняя строка — в столбик */
    .home-form__form .cf7-bottom-row {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }

    .home-form__form .cf7-bottom-row .cf7-form-row--submit {
        width: 100%;
    }

    .home-form__form .wpcf7-form input[type="text"],
    .home-form__form .wpcf7-form input[type="tel"],
    .home-form__form .wpcf7-form input[type="email"],
    .home-form__form .wpcf7-form textarea {
        padding: 12px 14px;
        font-size: 14px;
    }

    .home-form__form .wpcf7-form input[type="submit"] {
        padding: 14px 20px;
        font-size: 15px;
    }
}

/* ============================================================
 *  СТРАНИЦА 404
 * ============================================================ */
.error-404 {
    padding: 40px 0 60px;
}

.error-404__hero {
    max-width: 900px;
    margin: 0 auto 60px;
    text-align: center;
}

/* Картинка 404 — крупная, по центру */
.error-404__image {
    max-width: 640px;
    margin: 0 auto 35px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.error-404__image img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 16px;
    /* лёгкая тень, чтобы картинка не сливалась с фоном */
    filter: drop-shadow(0 14px 40px rgba(30, 90, 43, 0.15));
}

.error-404__title {
    font-size: 34px;
    font-weight: 700;
    color: var(--color-text);
    margin: 0 0 18px;
    line-height: 1.2;
}

.error-404__text {
    max-width: 640px;
    margin: 0 auto 32px;
    font-size: 16px;
    line-height: 1.6;
    color: var(--color-text-muted);
}

/* Поиск */
.error-404__search {
    max-width: 560px;
    margin: 0 auto 30px;
}

.error-404__search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    border: 2px solid var(--color-border);
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
    transition: 0.2s;
}

.error-404__search-wrapper:focus-within {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(30, 90, 43, 0.08);
}

.error-404__search-icon {
    position: absolute;
    left: 16px;
    color: var(--color-text-muted);
    font-size: 15px;
    pointer-events: none;
}

.error-404__search-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 14px 16px 14px 44px;
    font-size: 15px;
    font-family: inherit;
    color: var(--color-text);
    background: transparent;
    min-width: 0;
}

.error-404__search-input::placeholder {
    color: #aaa;
}

.error-404__search button {
    background: var(--color-primary);
    color: #fff;
    border: none;
    padding: 0 24px;
    height: 50px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: 0.2s;
    white-space: nowrap;
}

.error-404__search button:hover {
    background: var(--color-primary-dark);
}

/* Кнопки */
.error-404__actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.error-404__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 26px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: 0.2s;
    border: 1px solid transparent;
    font-family: inherit;
    cursor: pointer;
}

.error-404__btn--primary {
    background: var(--color-primary);
    color: #fff;
}

.error-404__btn--primary:hover {
    background: var(--color-primary-dark);
    color: #fff;
}

.error-404__btn--outline {
    background: #fff;
    color: var(--color-text);
    border-color: var(--color-border);
}

.error-404__btn--outline:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

/* Секции */
.error-404__section {
    margin-top: 50px;
}

.error-404__section-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--color-text);
    margin: 0 0 22px;
    text-align: center;
}

/* Мобильные */
@media (max-width: 768px) {
    .error-404 {
        padding: 20px 0 40px;
    }

    .error-404__hero {
        margin-bottom: 40px;
    }

    .error-404__image {
        max-width: 100%;
        margin-bottom: 24px;
    }

    .error-404__title {
        font-size: 22px;
    }

    .error-404__text {
        font-size: 14px;
        margin-bottom: 24px;
    }

    .error-404__search-wrapper {
        flex-direction: column;
        align-items: stretch;
        border-radius: 8px;
    }

    .error-404__search-input {
        padding: 12px 14px 12px 40px;
        font-size: 14px;
    }

    .error-404__search-icon {
        top: 14px;
        left: 14px;
    }

    .error-404__search button {
        width: 100%;
        height: 46px;
        padding: 0;
    }

    .error-404__actions {
        flex-direction: column;
    }

    .error-404__btn {
        width: 100%;
    }

    .error-404__section {
        margin-top: 35px;
    }

    .error-404__section-title {
        font-size: 20px;
        margin-bottom: 16px;
    }
}

@media (max-width: 480px) {
    .error-404__title {
        font-size: 20px;
    }
}

.home-h1 {
    text-align: center;
}

.home-h1-section, .home-banners {
    padding: 0 !important;
}

.home-features {
    padding-top: 20px !important;
    padding-bottom: 0 !important;
}

.home-categories {
    padding-top: 20px !important;
}