/* Draft homepage v2 — М.Видео style slider. Loaded only with main.preview.tpl (logged-in admin). */

.kb-draft {
    margin: 14px 0 0;
    padding: 9px 14px;
    border: 1px dashed #c10101;
    background: #fff8f6;
    color: #7a1c1c;
    font-size: 13px;
    line-height: 1.45;
}

/* ═══════════════════════════════════════════════════════════════════════════
   SALE SLIDER — М.Видео style
   ═══════════════════════════════════════════════════════════════════════════ */
.kb-slider {
    margin: 22px 0 36px;
    padding: 18px 0 22px;
    background: linear-gradient(95deg, #e31c5f 0%, #ff3366 35%, #ff6b35 100%);
    border-radius: 16px;
    position: relative;
    overflow: hidden;
}

.kb-slider__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px 14px;
}

.kb-slider__title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.kb-slider__title a {
    color: #fff;
    text-decoration: none;
}

.kb-slider__title a:hover,
.kb-slider__title a:focus {
    color: #fff;
}

.kb-slider__nav {
    display: flex;
    gap: 8px;
}

.kb-slider__arrow {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.kb-slider__arrow:hover {
    background: rgba(255, 255, 255, 0.4);
}

.kb-slider__arrow:disabled {
    opacity: 0.4;
    cursor: default;
}

.kb-slider__track {
    display: flex;
    gap: 14px;
    padding: 0 24px;
    scroll-padding-left: 24px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
}

.kb-slider__track::-webkit-scrollbar {
    display: none;
}

/* ═══════════════════════════════════════════════════════════════════════════
   PRODUCT CARD — horizontal, image left, info right
   ═══════════════════════════════════════════════════════════════════════════ */
.kb-card {
    flex: 0 0 auto;
    width: 260px;
    display: flex;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.15s, transform 0.15s;
    scroll-snap-align: start;
    scroll-margin-left: 24px;
}

@media (hover: hover) and (pointer: fine) {
    .kb-card:hover {
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
        transform: translateY(-2px);
    }
}

.kb-card__img-wrap {
    flex: 0 0 100px;
    width: 100px;
    height: 120px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.kb-card__img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.kb-card__body {
    flex: 1 1 auto;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-width: 0;
}

.kb-card__name {
    margin: 0;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.35;
    color: #1f2022;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: calc(1.35em * 3);
    max-height: calc(1.35em * 3);
}

.kb-card__prices {
    position: relative;
    margin-top: 8px;
    padding-top: 16px;
}

.kb-card__old {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 16px;
    font-size: 11px;
    line-height: 16px;
    color: #888;
    text-decoration: line-through;
    white-space: nowrap;
    overflow: hidden;
}

.kb-card__row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
}

.kb-card__price {
    font-size: 15px;
    font-weight: 700;
    color: #1f2022;
    white-space: nowrap;
}

.kb-card__discount {
    display: inline-block;
    flex: none;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: 600;
    background: #c10101;
    color: #fff;
    border-radius: 4px;
    white-space: nowrap;
}

/* Sample badge */
.kb-card__mock {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 3px 7px;
    font-size: 10px;
    font-weight: 600;
    background: #1f2022;
    color: #fff;
    border-radius: 4px;
    z-index: 2;
}

.kb-card {
    position: relative;
}

/* Note for sample mode */
.kb-slider__note {
    margin: 10px 24px 0;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.45;
    color: #5e6670;
}

/* ═══════════════════════════════════════════════════════════════════════════
   ADVANTAGES — fixed for draft page
   ═══════════════════════════════════════════════════════════════════════════ */
.kb-home-preview .advantages {
    background-color: #f2f6f7;
    margin: 24px 0 0;
    padding: 0;
}

.kb-home-preview .advantages .container {
    padding: 0;
}

.kb-home-preview .advantages .row {
    display: flex;
    flex-wrap: wrap;
    margin: 0;
}

.kb-home-preview .advantages .row > [class*="col-"] {
    padding: 0;
}

.kb-home-preview .advantage {
    background: transparent;
    border: none;
    margin: 0;
    padding-left: 55px;
    padding-top: 20px;
    padding-bottom: 15px;
    padding-right: 10px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   TYPOGRAPHY OVERRIDES
   ═══════════════════════════════════════════════════════════════════════════ */
.kb-home-preview .h2 {
    background: transparent;
    border-bottom: none;
    padding: 28px 2px 12px;
    font-size: 22px;
    font-weight: 500;
    letter-spacing: -0.02em;
    color: #1f2022;
}

.kb-home-preview .wrap_block {
    margin-top: 8px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 767px) {
    .kb-slider {
        border-radius: 12px;
        margin: 14px 0 24px;
        padding: 14px 0 16px;
        max-width: 100%;
    }

    .kb-slider__header {
        padding: 0 16px 12px;
    }

    .kb-slider__title {
        font-size: 16px;
        letter-spacing: 0.02em;
        line-height: 1.2;
    }

    .kb-slider__track {
        padding: 2px 16px 2px 20px;
        scroll-padding-left: 20px;
        gap: 10px;
    }

    .kb-card {
        width: min(78vw, 240px);
        scroll-margin-left: 20px;
    }

    .kb-card__img-wrap {
        flex: 0 0 80px;
        width: 80px;
        height: 100px;
        background: #fff;
    }

    .kb-card__img {
        width: 100%;
        height: 100%;
    }

    .kb-card__body {
        padding: 10px 12px;
    }

    .kb-card__name {
        font-size: 12px;
        -webkit-line-clamp: 2;
        min-height: calc(1.35em * 2);
        max-height: calc(1.35em * 2);
    }

    .kb-card__price {
        font-size: 14px;
    }

    .kb-slider__nav {
        display: none;
    }
}

@media (max-width: 359px) {
    .kb-slider__title {
        font-size: 15px;
    }

    .kb-card {
        width: 196px;
    }

    .kb-card__row {
        flex-wrap: wrap;
    }

    .kb-card__img-wrap {
        flex-basis: 72px;
        width: 72px;
        height: 92px;
    }
}

/* Installed home-screen app: keep the rail clear of the side notch. */
@media (display-mode: standalone), (display-mode: fullscreen) {
    .kb-slider {
        margin-left: env(safe-area-inset-left);
        margin-right: env(safe-area-inset-right);
    }
}
