/* ============================================================
   yeti-home.css — Главная страница Йети
   wp-content/themes/bono_child/css/yeti-home.css
   ============================================================ */

/* ── Отступы между блоками — одинаковые везде ───────────────── */
body.home #my-index {
    margin-top: 10px !important;
}

body.home .section-block {
    margin-bottom: 16px !important;
    padding-bottom: 0 !important;
}

/* ================================================================
   СЛАЙДЕР
   ================================================================ */
body.home .card-slider-container {
    background: #fff !important;
    border: 1px solid #e8e8e6 !important;
    border-radius: 10px !important;
    overflow: hidden !important;
}

/* Убрать серый фон у всех типов слайдов */
body.home .swiper-slide,
body.home .swiper-wrapper,
body.home .card-slider,
body.home .card-slider--type-product,
body.home .card-slider--type-category {
    background: #fff !important;
}

body.home .card-slider-wrap {
    display: flex !important;
    flex-direction: row !important;
    align-items: stretch !important;
    background: #fff !important;
    border: none !important;
    border-radius: 0 !important;
    text-decoration: none !important;
    min-height: 220px !important;
}

/* Картинка слева — убрать margin/padding которые даёт Bono */
body.home .card-slider__image {
    flex: 0 0 45% !important;
    overflow: hidden !important;
    background: #fff !important;
    margin: 0 !important;
    padding: 0 !important;
    position: static !important;
    width: 45% !important;
    max-width: 45% !important;
}

/* Перебить стили .card-slider--type-product .card-slider__image */
body.home .card-slider--type-product .card-slider__image,
body.home .card-slider--type-category .card-slider__image {
    margin-right: 0 !important;
    padding-top: 0 !important;
    flex-basis: 45% !important;
    max-width: 45% !important;
    background: #fff !important;
}

body.home .card-slider__image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    object-position: center !important;
    display: block !important;
    transition: transform .3s !important;
    padding: 16px !important;
}

/* Текст справа */
body.home .card-slider__body {
    flex: 1 !important;
    display: flex !important;
    align-items: center !important;
    padding: 0 !important;
    background: #fff !important;
}

body.home .card-slider__body-inner {
    padding: 24px 28px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
}

body.home .card-slider__title {
    font-size: 22px !important;
    font-weight: 700 !important;
    color: #1a1a1a !important;
    letter-spacing: -.3px !important;
    line-height: 1.25 !important;
    margin: 0 !important;
}

body.home .card-slider__excerpt,
body.home .card-slider__excerpt p {
    font-size: 14px !important;
    color: #555 !important;
    line-height: 1.6 !important;
    margin: 0 !important;
}

body.home .card-slider__button {
    display: inline-block !important;
    padding: 10px 22px !important;
    background: #85ad37 !important;
    color: #fff !important;
    border-radius: 8px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    width: fit-content !important;
    border-color: #85ad37 !important;
    transition: background .15s !important;
}

body.home .swiper-pagination-bullet-active {
    background: #85ad37 !important;
}

/* ================================================================
   НОВОСТИ — картинка 190px
   ================================================================ */
body.home .section-posts .post-cards {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 14px !important;
    padding: 0 !important;
    margin: 0 !important;
}

body.home .section-posts .post-card {
    background: #fff !important;
    border: 1px solid #e8e8e6 !important;
    border-radius: 10px !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
    width: auto !important;
    transition: border-color .18s !important;
}

body.home .section-posts .post-card:hover {
    border-color: #85ad37 !important;
    box-shadow: none !important;
}

body.home .section-posts .post-card .post-card__body {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 !important;
    overflow: hidden !important;
}

/* Картинка 190px высотой */
body.home .section-posts .post-card .post-card__thumbnail {
    order: -1 !important;
    flex: 0 0 190px !important;
    height: 190px !important;
    overflow: hidden !important;
    margin: 0 !important;
    width: 100% !important;
}

body.home .section-posts .post-card .post-card__thumbnail a {
    display: block !important;
    height: 190px !important;
    overflow: hidden !important;
    line-height: 0 !important;
}

body.home .section-posts .post-card .post-card__thumbnail img {
    width: 100% !important;
    height: 190px !important;
    object-fit: cover !important;
    object-position: center !important;
    display: block !important;
    max-width: none !important;
    max-height: none !important;
    transition: transform .3s !important;
}

body.home .section-posts .post-card:hover .post-card__thumbnail img {
    transform: scale(1.03) !important;
}

body.home .section-posts .post-card .post-card__title {
    order: 0 !important;
    padding: 10px 12px 4px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
    margin: 0 !important;
    flex: 1 !important;
}

body.home .section-posts .post-card .post-card__title a {
    color: #1a1a1a !important;
    text-decoration: none !important;
    transition: color .15s !important;
    font-size: 13px !important;
    font-weight: 600 !important;
}

body.home .section-posts .post-card:hover .post-card__title a {
    color: #85ad37 !important;
}

body.home .section-posts .post-card .post-card__meta {
    order: 1 !important;
    padding: 2px 12px 4px !important;
    margin: 0 !important;
    flex: 0 0 auto !important;
}

body.home .section-posts .post-card .post-card__date {
    font-size: 11px !important;
    color: #bbb !important;
}

body.home .section-posts .post-card .post-card__date:before {
    color: #85ad37 !important;
}

body.home .section-posts .post-card .post-card__description {
    order: 2 !important;
    padding: 0 12px 10px !important;
    font-size: 12px !important;
    color: #777 !important;
    line-height: 1.5 !important;
    margin: 0 !important;
    flex: 0 0 auto !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
}

/* ================================================================
   КАТЕГОРИИ — картинка на весь блок, текст под ней
   ================================================================ */
body.home .section-categories .shop-grid {
    display: grid !important;
    grid-template-columns: repeat(6, 1fr) !important;
    gap: 10px !important;
    margin: 0 !important;
    padding: 0 !important;
}

body.home .section-categories .product-category,
body.home .section-categories .product-category.first,
body.home .section-categories .product-category.last {
    background: #fff !important;
    border: 1px solid #e8e8e6 !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    transition: border-color .18s !important;
    float: none !important;
    clear: none !important;
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
}

body.home .section-categories .product-category:hover {
    border-color: #85ad37 !important;
}

body.home .section-categories .product-category > a {
    display: flex !important;
    flex-direction: column !important;
    text-decoration: none !important;
    color: inherit !important;
    height: 100% !important;
}

/* Картинка — убрать margin-bottom от Bono, object-contain чтобы влезала */
body.home .section-categories .product-category img,
body.home .section-categories .product-category a img {
    width: 100% !important;
    height: 120px !important;
    object-fit: contain !important;
    object-position: center !important;
    display: block !important;
    flex-shrink: 0 !important;
    transition: transform .3s !important;
    padding: 8px 8px 0 !important;
    background: #fff !important;
    margin: 0 !important;
    margin-bottom: 0 !important;
}

body.home .section-categories .product-category:hover img {
    transform: scale(1.04) !important;
}

/* Название — блок, без sup внутри строки */
body.home .section-categories .woocommerce-loop-category__title {
    padding: 6px 10px 0 !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    color: #1a1a1a !important;
    line-height: 1.3 !important;
    margin: 0 !important;
    transition: color .15s !important;
    display: block !important;
}

body.home .section-categories .product-category:hover .woocommerce-loop-category__title {
    color: #85ad37 !important;
}

/* Счётчик — отдельная строка под названием */
body.home .section-categories .woocommerce-loop-category__title sup.count {
    display: block !important;
    font-size: 10px !important;
    color: #bbb !important;
    font-weight: 400 !important;
    margin-top: 2px !important;
    padding-bottom: 8px !important;
    vertical-align: baseline !important;
}

body.home .section-categories .woocommerce-loop-category__title sup.count::after {
    content: '\00a0товаров' !important;
}

/* ── Адаптив ─────────────────────────────────────────────────── */
@media (max-width: 1200px) {
    body.home .section-categories .shop-grid {
        grid-template-columns: repeat(5, 1fr) !important;
    }
}

@media (max-width: 1024px) {
    body.home .section-posts .post-cards {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    body.home .section-categories .shop-grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }
    body.home .card-slider__title { font-size: 18px !important; }
    body.home .card-slider__body-inner { padding: 18px 20px !important; }
}

@media (max-width: 680px) {
    body.home .card-slider-wrap {
        flex-direction: column !important;
        min-height: auto !important;
    }
    body.home .card-slider__image,
    body.home .card-slider--type-product .card-slider__image,
    body.home .card-slider--type-category .card-slider__image {
        flex: 0 0 180px !important;
        height: 180px !important;
        max-width: 100% !important;
        width: 100% !important;
    }
    body.home .section-posts .post-cards,
    body.home .section-categories .shop-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }
}


/* ── Финальный фикс: sup.count не наезжает на название ──────── */
body.home .section-categories .product-category a .woocommerce-loop-category__title sup.count,
body.home .section-categories .product-category .woocommerce-loop-category__title sup.count {
    display: block !important;
    position: static !important;
    vertical-align: baseline !important;
    font-size: 10px !important;
    color: #bbb !important;
    font-weight: 400 !important;
    line-height: 1.4 !important;
    margin: 0 !important;
    padding: 1px 0 7px !important;
    top: auto !important;
}


/* ── Новости — одинаковая высота карточек на всех экранах ─────── */

/* Все карточки в строке одной высоты */
body.home .section-posts .post-cards {
    align-items: stretch !important;
}

body.home .section-posts .post-card {
    height: 100% !important;
}

/* Заголовок — максимум 3 строки */
body.home .section-posts .post-card .post-card__title a {
    display: -webkit-box !important;
    -webkit-line-clamp: 3 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
}

/* Описание — максимум 2 строки */
body.home .section-posts .post-card .post-card__description {
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    flex: 0 0 auto !important;
}

/* На узких экранах картинка чуть меньше */
@media (max-width: 768px) {
    body.home .section-posts .post-card .post-card__thumbnail,
    body.home .section-posts .post-card .post-card__thumbnail a {
        height: 140px !important;
        flex: 0 0 140px !important;
    }
    body.home .section-posts .post-card .post-card__thumbnail img {
        height: 140px !important;
    }
}

@media (max-width: 480px) {
    body.home .section-posts .post-cards {
        grid-template-columns: 1fr !important;
    }
    body.home .section-posts .post-card .post-card__thumbnail,
    body.home .section-posts .post-card .post-card__thumbnail a {
        height: 180px !important;
        flex: 0 0 180px !important;
    }
    body.home .section-posts .post-card .post-card__thumbnail img {
        height: 180px !important;
    }
}


/* ── Финальный фикс новостей — карточки не растягиваются ─────── */
body.home .section-posts .post-cards {
    align-items: start !important;
}

body.home .section-posts .post-card {
    height: auto !important;
}

/* Описание — flow-root сбрасываем, ограничиваем строки */
body.home .section-posts .post-card .post-card__description {
    display: -webkit-box !important;
    -webkit-line-clamp: 3 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    max-height: none !important;
}

/* Заголовок — не растягивается */
body.home .section-posts .post-card .post-card__title {
    flex: 0 0 auto !important;
}


/* ── Одинаковая высота карточек новостей ─────────────────────── */
body.home .section-posts .post-cards {
    align-items: stretch !important;
}

body.home .section-posts .post-card {
    height: 100% !important;
}

body.home .section-posts .post-card .post-card__body {
    flex: 1 !important;
}

/* Заголовок занимает свободное место — прижимает мету и описание вниз */
body.home .section-posts .post-card .post-card__title {
    flex: 1 0 auto !important;
}

/* Описание и мета — фиксированные внизу */
body.home .section-posts .post-card .post-card__meta {
    flex: 0 0 auto !important;
}

body.home .section-posts .post-card .post-card__description {
    flex: 0 0 auto !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
}


/* ================================================================
   НОВОСТИ — финальный чистый блок (из точного HTML)
   Структура: .post-card__body > title, thumbnail, meta, description
   ================================================================ */

body.home .section-posts .post-cards {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 14px !important;
    padding: 0 !important;
    margin: 0 !important;
    align-items: stretch !important;
}

body.home .section-posts .post-card {
    background: #fff !important;
    border: 1px solid #e8e8e6 !important;
    border-radius: 10px !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
    width: auto !important;
    height: 100% !important;
    transition: border-color .18s !important;
}

body.home .section-posts .post-card:hover {
    border-color: #85ad37 !important;
}

/* body — flex колонка, занимает всю высоту */
body.home .section-posts .post-card .post-card__body {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 !important;
    overflow: hidden !important;
}

/* Картинка — наверх через order, фиксированная высота */
body.home .section-posts .post-card .post-card__thumbnail {
    order: -1 !important;
    flex: 0 0 180px !important;
    height: 180px !important;
    overflow: hidden !important;
    margin: 0 !important;
    width: 100% !important;
}

body.home .section-posts .post-card .post-card__thumbnail a {
    display: block !important;
    height: 180px !important;
    overflow: hidden !important;
    line-height: 0 !important;
}

body.home .section-posts .post-card .post-card__thumbnail img {
    width: 100% !important;
    height: 180px !important;
    object-fit: cover !important;
    object-position: center !important;
    display: block !important;
    max-width: none !important;
    max-height: none !important;
    transition: transform .3s !important;
}

body.home .section-posts .post-card:hover .post-card__thumbnail img {
    transform: scale(1.03) !important;
}

/* Заголовок */
body.home .section-posts .post-card .post-card__title {
    order: 0 !important;
    padding: 10px 12px 4px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
    margin: 0 !important;
    flex: 1 0 auto !important;
}

body.home .section-posts .post-card .post-card__title a {
    color: #1a1a1a !important;
    text-decoration: none !important;
    transition: color .15s !important;
}

body.home .section-posts .post-card:hover .post-card__title a {
    color: #85ad37 !important;
}

/* Мета (дата) */
body.home .section-posts .post-card .post-card__meta {
    order: 1 !important;
    padding: 0 12px 4px !important;
    margin: 0 !important;
    flex: 0 0 auto !important;
}

body.home .section-posts .post-card .post-card__date {
    font-size: 11px !important;
    color: #bbb !important;
}

/* Описание — максимум 2 строки */
body.home .section-posts .post-card .post-card__description {
    order: 2 !important;
    padding: 0 12px 12px !important;
    font-size: 12px !important;
    color: #777 !important;
    line-height: 1.5 !important;
    margin: 0 !important;
    flex: 0 0 auto !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
}

@media (max-width: 1024px) {
    body.home .section-posts .post-cards {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 500px) {
    body.home .section-posts .post-cards {
        grid-template-columns: 1fr !important;
    }
}


/* ── Убрать обрезание текста в карточках новостей ────────────── */
body.home .section-posts .post-card {
    overflow: visible !important;
}

/* Только картинка обрезается */
body.home .section-posts .post-card .post-card__thumbnail {
    overflow: hidden !important;
}

/* Скруглённые углы только у картинки сверху */
body.home .section-posts .post-card .post-card__thumbnail img {
    border-radius: 9px 9px 0 0 !important;
}


/* Убрать обрезание текста в body карточки */
body.home .section-posts .post-card .post-card__body {
    overflow: visible !important;
}


/* Добавить отступ снизу чтобы последняя строка текста не обрезалась */
body.home .section-posts .post-card .post-card__description {
    padding-bottom: 14px !important;
    -webkit-line-clamp: 3 !important;
}


/* ── Кнопка слайдера — hover зелёный фон, белый текст ───────── */
body.home .card-slider__button:hover,
body.home .card-slider-wrap:hover .card-slider__button,
body.home a.card-slider__button:hover,
body.home span.card-slider__button:hover {
    background: #6e9228 !important;
    color: #fff !important;
    border-color: #6e9228 !important;
    box-shadow: none !important;
    opacity: 1 !important;
}


/* ── Одинаковые отступы между всеми секциями ─────────────────── */
body.home .section-block {
    margin-top: 16px !important;
    margin-bottom: 0 !important;
}

body.home #my-index {
    margin-top: 16px !important;
    margin-bottom: 16px !important;
}


/* ── Точные отступы между секциями — 16px везде ─────────────── */

/* Сброс всех внутренних отступов секций от Bono */
body.home .section-block {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* Контейнер всех секций — gap между ними */
body.home #primary .site-main {
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
}

/* Слайдер */
body.home #my-index {
    margin-top: 16px !important;
    margin-bottom: 0 !important;
}

/* Заголовки секций — убрать лишний margin снизу */
body.home .section-block__title {
    margin-bottom: 1rem !important;
}

/* Убрать padding у обёртки секций */
body.home .section-block__inner,
body.home .section-block-wrapper {
    padding: 0 !important;
}


/* ================================================================
   ТОЧНЫЕ ОТСТУПЫ — на основе реальной HTML-структуры
   Bono использует CSS Grid для .site-main на главной
   ================================================================ */

/* Убрать row-gap у grid-контейнера Bono */
body.home .site-main {
    row-gap: 16px !important;
    display: grid !important;
}

/* Сбросить все margin/padding у каждой секции */
body.home #my-index {
    margin: 0 !important;
    padding: 0 !important;
}

body.home .section-block.section-html.section-1,
body.home .section-id--6 {
    margin: 0 !important;
    padding: 0 !important;
}

body.home .section-block.section-categories,
body.home .section-id--1000 {
    margin: 0 !important;
    padding: 0 !important;
}

body.home .section-block.section-html.section-3,
body.home .section-id--1001 {
    margin: 0 !important;
    padding: 0 !important;
}

body.home .section-block.section-posts {
    margin: 0 !important;
    padding: 0 !important;
}

/* Убрать внутренние отступы Bono у section-block__inner */
body.home .section-block__inner {
    padding: 0 !important;
    margin: 0 !important;
}

/* Убрать padding у .section-html__body */
body.home .section-html__body {
    padding: 0 !important;
    margin: 0 !important;
}


/* ================================================================
   ФИНАЛЬНЫЕ ОТСТУПЫ — точно по скриншоту
   ================================================================ */

/* Уменьшить большой отступ после слайдера */
body.home .section-block.section-html.section-1 {
    margin-top: 16px !important;
}

/* Отступ: категории → баннер */
body.home .section-block.section-html.section-3 {
    margin-top: 16px !important;
}

/* Отступ: баннер → новости */
body.home .section-block.section-posts {
    margin-top: 16px !important;
}

/* Отступ: новости → футер */
body.home .section-block.section-posts:last-child {
    margin-bottom: 16px !important;
}

/* Убрать лишний отступ после слайдера который даёт #my-index */
body.home #my-index {
    margin-bottom: 0 !important;
}
