/* =========================================================
   Nicecar — главная страница (home.css)
   Подключается только на главной (is_front_page).
   ========================================================= */

/* --------- 8. Hero / Slider ---------- */
.hero__swiper { width: 100%; }
/* Вендорный swiper-bundle.min.css подключается ПОСЛЕ home.css и задаёт
   .swiper-slide{display:block;height:100%} — из-за этого флекс-центрирование
   не работало, а высота слайда зависела от картинки. Селекторы с .hero
   перебивают вендорные по весу, независимо от порядка файлов. */
.hero .hero__slide {
    min-height: 360px;
    color: var(--white); position: relative;
    display: flex; align-items: center;
    height: auto;
}
.hero .hero__inner {
    position: relative; display: grid; grid-template-columns: minmax(0, 1fr);
    /* На телефоне и планшете картинка стоит над текстом, обе строки по содержимому
       и центрируются внутри слайда. */
    grid-template-rows: auto auto;
    align-content: center; align-items: center; align-self: stretch; gap: 20px;
    width: 100%;
    padding: 28px 16px 32px;
}
.hero__content, .hero__media { min-width: 0; }
.hero__content { overflow-wrap: anywhere; }
.hero__media {
    width: 100%; max-width: 320px; justify-self: center; align-self: center;
    /* В разметке картинка идёт после текста, на узких экранах поднимаем её наверх. */
    order: -1;
    /* Фиксированная высота полосы у всех слайдов: картинка вписывается без искажений. */
    height: 180px; display: flex; align-items: center; justify-content: center;
}
/* Высоту задаёт контент: картинка ограничена полосой, поэтому слайды одной высоты. */
.hero__image { display: block; width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; border-radius: var(--radius); }
.hero__title { color: var(--white); font-size: clamp(24px, 3.2vw, 42px); max-width: 720px; }
.hero__text { max-width: 600px; opacity: .92; font-size: 16px; }
.hero__text p:last-child { margin-bottom: 0; }
.hero__text a { color: inherit; text-decoration: underline; }
.hero__btn { margin-top: var(--px15); white-space: normal; max-width: 100%; }
.hero__swiper { overflow: hidden; }
@media (min-width: 768px) {
    .hero .hero__inner { gap: 24px; padding: 36px 20px 40px; }
    .hero__media { max-width: 420px; height: 220px; }
}

/* Минимальная высота слайда задаётся тем же селектором с .hero, иначе её
   перебивает базовая min-height: 360px. */
@media (min-width: 768px) { .hero .hero__slide { min-height: 460px; } }

/* С десктопа картинка уходит в правую колонку, текст — в левую. */
@media (min-width: 1024px) {
    .hero .hero__inner {
        grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
        grid-template-rows: minmax(0, 1fr);
        gap: 36px;
        padding: var(--px50) 48px 50px;
    }
    .hero .hero__inner--text-only { grid-template-columns: minmax(0, 1fr); }
    .hero__media { order: 0; max-width: 520px; height: 380px; }
    .hero .hero__slide { min-height: 600px; }
}

/* Фон выбирается в параметрах слайда в админке. */
.hero__slide--red    { background: linear-gradient(135deg, #c0211c 0%, #7a0f0c 100%); }
.hero__slide--dark   { background: linear-gradient(135deg, #2a2a2a 0%, #0d0d0d 100%); }
.hero__slide--gradient { background: linear-gradient(135deg, #c0211c 0%, #2a2a2a 60%, #0d0d0d 100%); }
.hero__swiper .swiper-wrapper { align-items: stretch; }

/* --------- 10. Categories slider ---------- */
.categories__swiper { padding-bottom: 30px; position: relative; }
.categories__list { display: flex; }
.category-card {
    display: flex; flex-direction: column; gap: 10px;
    background: var(--white); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 12px; text-align: center;
    color: var(--black); height: 100%;
    transition: box-shadow var(--tr), transform var(--tr);
}
.category-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); color: var(--red); }
.category-card__thumb img { width: 100%; height: 160px; object-fit: cover; border-radius: var(--radius-sm); }
.category-card__title { font-weight: 700; }

/* --------- 12. Products slider ---------- */
.products__swiper { padding: 0 0 50px; position: relative; overflow: hidden; }
.products__swiper .swiper-wrapper { box-sizing: border-box; align-items: stretch; }
/* Слайды выравниваются по высоте — рамка карточки заливается на весь слайд. */
.products__swiper .swiper-slide { height: auto; display: flex; }
.products__swiper .swiper-slide > .product-card__inner { flex: 1 1 auto; }
.products__swiper .product-card { width: 100%; }

/* Стрелки в карусели товаров на главной — выносим за грани на ПК, прячем на мобильных. */
.products__swiper .swiper-button-prev,
.products__swiper .swiper-button-next {
    top: 40%;
}
.products__swiper .swiper-button-prev { left: 4px; }
.products__swiper .swiper-button-next { right: 4px; }
@media (max-width: 600px) {
    .products__swiper .swiper-button-prev,
    .products__swiper .swiper-button-next { display: none; }
}
/* --------- 13. Advantages (стиль scr2: чёрный фон, большие цифры/символы, вертикальные разделители) ---------- */
.advantages {
    background: #0d0d0d;
    color: #fff;
}
.advantages .section-header__title { color: #fff; }
.advantages__list {
    display: grid; grid-template-columns: 1fr; gap: 0;
    border-top: 1px solid rgba(255,255,255,.08);
    border-bottom: 1px solid rgba(255,255,255,.08);
}
@media (min-width: 600px)  { .advantages__list { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .advantages__list { grid-template-columns: repeat(4, 1fr); } }

.advantage {
    position: relative;
    background: transparent; border-radius: 0; box-shadow: none;
    padding: 36px 24px;
    text-align: center;
}
@media (min-width: 600px) {
    .advantage + .advantage { border-left: 1px solid rgba(255,255,255,.08); }
}
.advantage__num {
    display: block;
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(54px, 7vw, 86px);
    line-height: 1;
    color: #fff;
    letter-spacing: 1px;
    margin-bottom: 10px;
}
.advantage__num sup { font-size: .55em; vertical-align: top; line-height: 1; margin-left: 2px; }
.advantage__icon {
    display: inline-block; width: auto; height: auto; border-radius: 0;
    background: transparent; color: #fff; margin: 0 0 10px;
    background-image: none !important;
    font-family: var(--font-display); font-size: clamp(54px, 7vw, 86px);
    line-height: 1;
}
.advantage__title {
    font-size: 12px; font-weight: 700; letter-spacing: 2px;
    text-transform: uppercase; margin: 0 0 6px;
    color: #fff;
}
.advantage__text {
    color: #9a9a9a;
    font-size: 12px; letter-spacing: .3px;
    line-height: 1.55;
    max-width: 220px; margin: 0 auto;
}

/* --------- 28. Categories grid (main page, 4 cols, squares) ---------- */
.categories-grid {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--gap);
    margin: 0; padding: 0; list-style: none;
}
@media (min-width: 768px)  { .categories-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .categories-grid { grid-template-columns: repeat(4, 1fr); } }
.categories-grid .category-card__thumb img {
    width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: var(--radius-sm); height: auto;
}
.categories-grid__item[hidden] { display: none; }

/* --------- 30. Home contacts block (3 cols) ---------- */
.home-contacts { background: var(--grey); }
.home-contacts__grid {
    display: grid; grid-template-columns: 1fr; gap: var(--gap);
}
@media (min-width: 768px) { .home-contacts__grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .home-contacts__grid { grid-template-columns: repeat(3, 1fr); } }
.home-contacts__col {
    min-width: 0; background: var(--white); border-radius: var(--radius); padding: var(--px25);
}
.home-contacts__col-title {
    font-size: 18px; font-weight: 700; margin: 0 0 var(--px15);
    padding-bottom: 8px; border-bottom: 2px solid var(--red);
}
.home-contacts__img img { width: 100%; height: auto; border-radius: var(--radius); }
.home-contacts__route { margin-top: var(--px15); text-align: center; }

/* Instagram в колонке «Мы в соцсетях»: только число подписчиков. */
.home-contacts__col:has(.instagram-feed) { display: flex; flex-direction: column; }
.instagram-feed { display: flex; align-items: center; flex: 1; }
.instagram-feed__card { width: 100%; text-align: center; }
.instagram-feed__icon { display: inline-flex; color: var(--red); }
.instagram-feed__name { display: block; margin: 6px 0 12px; font-size: 14px; font-weight: 700; color: var(--text-muted); overflow-wrap: anywhere; }
.instagram-feed__label { margin: 0; font-size: 11px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--text-muted); }
.instagram-feed__count { margin: 2px 0 0; font-size: clamp(40px, 8vw, 58px); line-height: 1.02; font-weight: 800; letter-spacing: -1.5px; color: var(--red); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.instagram-feed__caption { margin: 2px 0 16px; font-size: 13px; color: var(--text-muted); }
.instagram-feed__btn { width: 100%; }
.instagram-feed__note { margin: 12px 0 0; font-size: 12px; color: var(--text-muted); }
.home-contacts__placeholder {
    display: flex; align-items: center; justify-content: center;
    min-height: 200px; border: 1px dashed var(--border); border-radius: var(--radius);
    color: var(--text-muted); font-size: 14px;
}
