/*
 * №75. Блоки главной страницы (front/index.blade.php, templates/home-block*.blade.php, js/home-blocks.js).
 * Полки — как прежние «Сезонные товары VERITAN» и «Новинки»: заголовок, подзаголовок, «Смотреть все», лента карточек
 * со стрелками по краям; у каждой полки своя карусель. Полки ниже экрана до подгрузки — серые заготовки карточек.
 */
/* Шапка полки (№76): название 28 px, под ним подзаголовок; до карточек 40 px (было ~95 px).
   «Смотреть все»: ПК — справа, как на прежней главной (№78, ниже в @media min-width); телефон — «Все ›» справа в строке
   названия (№76, @media max-width). Слева отступ 6 px — название ровно над краем первой карточки (у ленты такой же отступ). */
.hb-head { margin: 40px 0 0; padding: 0 6px; }
.hb-head-row { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 28px; row-gap: 4px; }
.hb-head .hb-title { min-width: 0; margin: 0; font-family: inherit; font-size: 28px; line-height: 34px; font-weight: 800; color: #303030;
    overflow-wrap: break-word; }
.hb-more { display: inline-flex; flex: 0 0 auto; align-items: center; white-space: nowrap; text-decoration: none; transition: color .15s; }
.hb-more-short { display: none; }
.hb-more-ico { flex: 0 0 auto; width: 7px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round;
    stroke-linejoin: round; }
.hb-head .hb-sub { margin: 6px 0 0; font-size: 14px; line-height: 20px; font-weight: 500; color: #828282; }
.hb .hb-items { margin-top: 20px; }
@media (min-width: 1001px) {
    /* №78: название и подзаголовок — слева, «Смотреть все» — справа (вровень с краем последней карточки), по середине
       обеих строк. Обёртка строки названия раскрыта (contents) — её части встают в сетку шапки */
    .hb-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: 40px; }
    .hb-head-row { display: contents; }
    .hb-head .hb-title { grid-area: 1 / 1; }
    .hb-head .hb-sub { grid-area: 2 / 1; }
    .hb-more { grid-area: 1 / 2 / 3 / 3; align-self: center; justify-self: end; font-size: 14px; line-height: 21px; }
    .hb-more-ico { display: none; }
    /* жёлтая кнопка — как прежняя «Смотреть все» (.btn-main, 134 × 51 px). Поля −8,5 px сверху и снизу: шапка без
       подзаголовка (34 px) от кнопки выше не становится — отступы до карточек и между блоками те же */
    .hb-more--btn { margin: -8.5px 0; padding: 15px 20px; border-radius: 4px; background: #FEDC29; color: #4F4F4F; font-weight: 700;
        transition: filter .5s; }
    .hb-more--btn:hover { color: #4F4F4F; text-decoration: none; filter: brightness(105%); }
    /* ссылка — как прежняя «Смотреть все товары» (.btn-small) */
    .hb-more--link { color: #828282; font-weight: 500; text-decoration: underline; }
    .hb-more--link:hover { color: #4F4F4F; text-decoration: underline; }
}
/* после полки прежний блок (разделы, преимущества, баннеры, «О магазине») — ровно 40 px от карточек (20 px поля ленты + 20 px).
   Свои верхние отступы этих частей (у баннеров 35 px, у плиток на телефоне −22 px: раньше они стояли сразу под баннером)
   здесь не действуют — иначе на телефоне плитки прилипали к полке, а баннеры отходили на 55 px */
.hb-goods + .hb-fixed, .hb-viewed + .hb-fixed, .hb-promos + .hb-fixed { margin-top: 20px; }
.hb-goods + .hb-fixed > :first-child, .hb-viewed + .hb-fixed > :first-child, .hb-promos + .hb-fixed > :first-child { margin-top: 0 !important; }

/* серые заготовки карточек, пока полка подгружается (без прыжка страницы) */
.hb-skel { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-top: 20px; padding: 20px 6px; }
/* высота как у карточки: фото — квадрат во всю ширину, под ним ~232 px текста, цены и кнопки (при любой ширине экрана) */
.hb-skel i { display: block; height: 0; padding-top: calc(100% + 232px); border-radius: 8px;
    background: linear-gradient(90deg, #F2F3F5 0%, #E9EBEE 40%, #F2F3F5 80%) 0 0 / 300% 100%; animation: hb-shine 1.4s ease-in-out infinite; }
@keyframes hb-shine {
    from { background-position: 100% 0; }
    to { background-position: 0 0; }
}
.hb-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.hb-block[hidden] { display: none; }

/* стрелки: листать некуда (товаров меньше, чем помещается в ряд) — не видно; в начале / в конце ленты — бледная.
   Общее правило .arrow-left / .arrow-right (main.css) перебивало .swiper-button-lock из стилей карусели */
.hb-items .swiper-button-lock { display: none; }
.hb-items .swiper-button-disabled { opacity: .4; cursor: default; pointer-events: none; }

/* №80: блок «Баннеры» — как верхний баннер (home-banner.css): скруглённая рамка; картинка той же формы её заполняет
   (.is-fit — home-blocks.js), другой формы — целиком на размытом фоне из неё же; точки под баннером, стрелок нет.
   ПК: широкий — 1860 : 300, два рядом — по 930 : 300 (как прежние средние) через 10 px. До 1000 px «два рядом» —
   одна лента (.hbn-mob, картинки по очереди); телефон (≤ 600 px): у широкого — своя картинка 2 : 1, если есть. */
.hb-banners { margin-top: 40px; }
.hb-goods + .hb-banners, .hb-viewed + .hb-banners, .hb-promos + .hb-banners { margin-top: 20px; }
/* после баннера прежний блок (плитки разделов, преимущества, «О магазине») — через 30 px от точек, как после прежних
   баннеров; свои верхние отступы этих частей (у плиток на телефоне −22 px) здесь не действуют — иначе плитки
   наезжали на точки баннера */
.hb-banners + .hb-fixed { margin-top: 30px; }
.hb-banners + .hb-fixed > :first-child { margin-top: 0 !important; }
.hbn-pc { display: flex; gap: 10px; }
.hbn-pc > .hbn-box { flex: 1 1 0; min-width: 0; }
.hbn-mob { display: none; }
.hbn-slider { position: relative; border-radius: 12px; }
.hbn-link { position: relative; display: block; padding-top: 16.129%; overflow: hidden; border-radius: 12px; background: #F0F2F4;
    isolation: isolate; -webkit-mask-image: -webkit-radial-gradient(white, black); }
.hbn-double .hbn-link { padding-top: 32.258%; }
.hbn-link picture,
.hbn-link img { position: absolute; top: 0; left: 0; display: block; width: 100%; height: 100%; }
.hbn-bg img { object-fit: cover; -webkit-filter: blur(22px) saturate(1.15); filter: blur(22px) saturate(1.15); transform: scale(1.18); }
.hbn-bg::after { content: ''; position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: rgba(255, 255, 255, .12); }
.hbn-img img { object-fit: contain; }
.hbn-slide.is-fit .hbn-bg { display: none; }
.hbn-slide.is-fit .hbn-img img { object-fit: cover; }
/* точки — как у верхнего баннера (у точек сайта в main.css !important — здесь тоже) */
.hbn-dots { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 12px; }
.hbn-dots .swiper-pagination-bullet { width: 8px !important; height: 8px !important; margin: 0 !important; border-radius: 4px !important;
    background-color: #D5D9DE !important; box-shadow: none; opacity: 1 !important; cursor: pointer; transition: width .25s, background-color .25s; }
.hbn-dots .swiper-pagination-bullet-active { width: 22px !important; background-color: #FEDC29 !important; }
.hbn-dots .swiper-pagination-bullet:focus { outline: none; }
.hbn-dots .swiper-pagination-bullet:focus-visible { outline: 2px solid #303030; outline-offset: 2px; }

/* карточки акций в ленте — во всю ширину слайда */
.hb-promo-items .swiper-slide { height: auto; }
.hb-promo-items .pr-card { height: 100%; }

/* предпросмотр на дату (видит только администратор) */
.hb-preview { margin: 16px 0 14px; padding: 10px 14px; border: 1px solid #FBEFB8; border-radius: 8px; background: #FFF7D1; color: #303030;
    font-size: 14px; line-height: 20px; }

/* блок только для ПК / только для телефона */
@media (max-width: 1000px) {
    .hb-only-desktop { display: none !important; }
    .hb-skel { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 0; padding-top: 16px; }
    .hb-skel i:nth-child(n+3) { display: none; }

    /* №76: телефон — название слева (20 px, до двух строк), «Все ›» справа в той же строке, подзаголовок под названием;
       до карточек 16 px. Раньше: всё по центру, жёлтая кнопка под названием и ~100 px пустоты до карточек */
    .hb-head { margin-top: 26px; }
    .hb-fixed + .hb-block > .hb-head { margin-top: 36px; }     /* после плиток, преимуществ, баннеров — чуть больше воздуха */
    .hb-head-row { flex-wrap: nowrap; align-items: center; justify-content: space-between; column-gap: 12px; }
    .hb-head .hb-title { font-size: 20px; line-height: 26px; text-align: left; }
    .hb-more { gap: 5px; margin: -10px -6px -10px 0; padding: 10px 6px 10px 8px; font-size: 15px; line-height: 20px; font-weight: 500;
        color: #303030; }
    .hb-more:hover { color: #303030; text-decoration: underline; text-underline-offset: 3px; }
    .hb-more-full { display: none; }
    .hb-more-short { display: inline; }
    .hb-more-ico { width: 6px; height: 11px; color: #828282; }
    .hb-head .hb-sub { margin-top: 3px; font-size: 13px; line-height: 18px; text-align: left; }
    .hb .hb-items { margin-top: 0; }
    .hb .hb-items .hb-swiper { padding-top: 16px; }

    /* №80: «два рядом» — одной лентой; баннер от полки — как прежние баннеры */
    .hbn-pc { display: none; }
    .hbn-mob { display: block; }
    .hb-banners { margin-top: 26px; }
    .hb-banners + .hb-block > .hb-head { margin-top: 30px; }
}
@media (max-width: 600px) {
    .hbn-slider,
    .hbn-link { border-radius: 10px; }
    .hbn-has-phone .hbn-link { padding-top: 50%; }
    .hbn-dots { margin-top: 8px; }
}
@media (min-width: 640px) and (max-width: 1000px) {
    .hb-skel { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .hb-skel i:nth-child(3) { display: block; }
}
@media (min-width: 1001px) {
    .hb-only-mobile { display: none !important; }
}
@media (max-width: 1259px) and (min-width: 1001px) {
    .hb-skel { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .hb-skel i:nth-child(5) { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .hb-skel i { animation: none; }
}
