.index-main {
    /* height: 3000px; */
    padding-top: 120px;
    width: 100%;
    justify-content: center;
    justify-items: center;
    min-height: 700px;
}

.s1 {
    width: 100%;
    background-color: #f7f7f7;
}

.s1-full {
    display: flex;
    flex-direction: row;
    width: clamp(1050px, calc(100% - 2*var(--g, 16px)), 1415px);
    margin-inline: auto;
}

.s1-left {
    width: 30%;
    background: linear-gradient(180deg, #444 0%, #3b3b3b 45%, #343434 100%);
    min-width: 0;


    background-image: url("/assets/img/fon-razrez-up-yellow.svg");
    background-repeat: no-repeat;
    background-position: left top;
    background-size: auto 100%;
    background-origin: border-box;
    background-clip: border-box;
    display: flex;
    flex-direction: row;

    margin-inline: auto;
}

.s1-right {
    display: grid;
    width: 70%;
    height: 100%;

}

.s1-banner-up {
    height: 500px;
    position: relative;
    /* чтобы спозиционировать видео внутри */
    overflow: hidden;
    /* обрезать края видео */
    /* Фолбек-фон на случай, если видео не загрузится */
    background: url("/assets/img/index/banner-photo.png") no-repeat top / cover;
}

.s1-banner-up .s1-banner-video {
    position: absolute;
    inset: 0;
    /* top:0; right:0; bottom:0; left:0 */
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* как background-size: cover */
    object-position: bottom center;
    /* как background-position: top */
    pointer-events: none;
    /* чтобы клики проходили сквозь видео */
    z-index: 0;
}

/* Если есть контент поверх видео */
.s1-banner-up>*:not(.s1-banner-video) {
    position: relative;
    z-index: 1;
}

.s1-banner-down-2 img {
    width: 100px;
}

@media (max-width: 1100px) {
    .index-main {
        padding-top: 60px;
    }

    .s1-full {
        display: grid;
        width: auto;
        flex-direction: column;


    }

    .s1-left {
        width: 100%;
        background-image: none;
        justify-content: center;
    }

    .s1-right {
        width: 100%;
        order: -1;

    }
}

/* =========================================
   HITS BLOCK (PRODUCTION)
   ========================================= */
.hits-debug-wrapper {
    /* Layout Safety */
    width: 100%;
    /* overflow: hidden; REMOVED to fix badge clipping */
    /* Critical protection */
    box-sizing: border-box;
    /* Defensive model */

    /* Production Styles */
    background-color: transparent;
    padding: 20px 0;
    margin-bottom: 40px;
    /* Separation */
}

.hits-debug-inner {
    /* Adaptive container */
    max-width: 1410px;
    margin: 0 auto;
    margin: 0 auto;
    padding: 0 5px;
    /* Increased to prevent badge clipping */
    box-sizing: border-box;

    /* Height for checking existence */
    /* min-height removed */
    /* Debug border removed */
}

/* =========================================
   PHASE 2: MOCK ITEMS
   ========================================= */

/* Use the REAL structural classes to test the REAL breakdown */
.new-hits-carousel {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    /* padding-bottom removed per user request */
}

.new-hits-track {
    display: flex;
    gap: 16px;
    padding-left: 12px;
    /* Added to make space for the first card's negative badge */
    /* Desktop Gap */
}

/* Base Card Logic (Desktop: 5 items) */
.new-hits-card {
    flex: 0 0 calc(20% - 12.8px);
    /* 5 items: (100% - 4*16px gap)/5 */
    width: calc(20% - 12.8px);

    /* Real Visuals will be handled by .nh-card inside this wrapper */
    /* flex: 0 0 calc(20% - 12.8px); -> Already defined above */
    /* width: calc(20% - 12.8px); -> Already defined above */

    /* Layout for inner card */
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* =========================================
   ADAPTATION (5 -> 4 -> 3 -> 2)
   ========================================= */

@media (max-width: 1200px) {

    /* 4 Cols */
    .new-hits-card {
        flex: 0 0 calc(25% - 12px);
        /* (100% - 3*16px)/4 */
        width: calc(25% - 12px);
    }
}

@media (max-width: 900px) {

    /* 3 Cols */
    .new-hits-card {
        flex: 0 0 calc(33.333% - 10.7px);
        /* (100% - 2*16px)/3 */
        width: calc(33.333% - 10.7px);
    }
}

@media (max-width: 600px) {

    /* 2 Cols */
    .new-hits-track {
        gap: 12px;
        /* Smaller gap on mobile */
        scroll-snap-type: x mandatory;
        padding-right: 16px;
    }

    .new-hits-card {
        flex: 0 0 calc(50% - 6px);
        /* (100% - 12px)/2 */
        width: calc(50% - 6px);
        scroll-snap-align: start;
    }
}

/* =========================================
   PHASE 3: INTERACTION STYLES
   ========================================= */

.new-hits-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.new-hits-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    color: #333;
}

/* Nav Buttons */
.new-hits-nav {
    display: flex;
    gap: 10px;
}

.new-hits-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid #f9c115;
    background: #fff;
    font-size: 20px;
    color: #333;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    user-select: none;
}

.new-hits-btn:hover {
    background: #f9c115;
}

/* Drag Cursor & Selection */
.new-hits-carousel {
    cursor: grab;
    /* Desktop UX */
    user-select: none;
    /* Prevent text highlight during drag */
}

.new-hits-carousel.active {
    cursor: grabbing;
}

/* =========================================
   PHASE 4: REAL CARD STYLES
   ========================================= */

/* Card Container (Premium Category Style) */
.nh-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    transition: transform 0.2s, box-shadow 0.2s;
}

.nh-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    /* Premium hover */
    border-color: #f9c115;
}

.nh-card__link {
    position: absolute;
    inset: 0;
    z-index: 1;
    /* Cover whole card */
}

.nh-badge {
    background: #f9c115;
    color: #000;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 3px;
    position: absolute;
    top: 12px;
    left: 12px;
}

.nh-card__img-wrap {
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.nh-card__img-wrap img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}

.nh-card__title {
    font-size: 14px;
    font-weight: 500;
    margin: 0 0 8px;
    line-height: 1.3;
    height: 38px;
    /* 2 lines limit */
    overflow: hidden;
    color: #333;
}

.nh-card__price-row {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
    color: #000;
}

.nh-unit {
    font-size: 12px;
    color: #777;
    font-weight: 400;
}

/* Buttons Logic */
.nh-card__actions {
    margin-top: auto;
    display: flex;
    gap: 8px;
    position: relative;
    z-index: 2;
    /* Clickable above link */
}

.nh-btn-cart {
    flex: 1;
    background: #f9c115;
    border: none;
    border-radius: 4px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
}

.nh-btn-cart img {
    width: 16px;
}

.nh-btn-buy {
    flex: 1;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: #333;
    text-decoration: none;
    font-weight: 600;
}

.nh-btn-buy:hover {
    background: #f5f5f5;
}

/* =========================================
   PHASE 4: VISUAL ADAPTATION (MOBILE)
   ========================================= */
@media (max-width: 900px) {
    .nh-card {
        padding: 8px;
        /* Compact padding */
    }

    .nh-card__img-wrap {
        height: 120px;
        /* Reduced image height */
        margin-bottom: 8px;
    }

    .nh-card__title {
        font-size: 13px;
        /* Balanced size */
        height: 34px;
        margin-bottom: 6px;
    }

    .nh-card__price-row {
        font-size: 14px;
        margin-bottom: 8px;
    }

    .nh-card__actions {
        gap: 4px;
    }

    .nh-btn-cart,
    .nh-btn-buy {
        height: 28px;
        /* Compact buttons */
        font-size: 11px;
        padding: 0 4px;
    }

    .nh-btn-cart span {
        display: none;
        /* Hide text on small screens to save space */
    }

    .nh-btn-cart img {
        margin: 0;
    }
}