/* ─── SECTION ─── */
.materials {
    padding: 24px 0 40px;
    overflow: hidden;
    background-color: var(--bg);
    border-bottom: 1px solid var(--grey-1);
}

@media (min-width: 64rem) {
    .materials {
        border-bottom: none;
    }
}

.materials .h2{
    margin: 0 0 8px;
}

/* ─── SWIPER WRAPPER ─── */
.materials__slider-wrap {
    position: relative;
}

/* ─── SWIPER ─── */
.materials-swiper {
    overflow: visible !important;
}

/* Scrollbar */
.materials-swiper .swiper-scrollbar {
    background: rgba(0,0,0,.08) !important;
    height: 2px !important;
    bottom: 0 !important;
    border-radius: 0 !important;
    left: 0 !important;
    width: 100% !important;
}

.materials-swiper .swiper-scrollbar-drag {
    background: var(--orange) !important;
    border-radius: 0 !important;
}

/* ─── CARD ─── */
.material-card {
    position: relative;
    border-radius: 2px;
    overflow: hidden;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    transition: box-shadow .25s, transform .25s;
    background: var(--bg, #F8F9FA);
    box-shadow: 0px 5px 50px rgba(18, 17, 39, 0.05);
    backdrop-filter: blur(2px);
    height: 136px;
    width: 136px;
    min-width: 136px;
}

.materials__slider-wrap .swiper-slide{
    flex-shrink: unset;
}

.material-card:hover {
    box-shadow: 0 12px 36px rgba(0,0,0,.12);
    transform: translateY(-3px);
}

/* Image area */
.material-card__img {
    position: relative;
    overflow: hidden;
    width: 100%;
    height: auto;
    object-fit: cover;
    padding: 10px 10px 0;
    flex: 1 1;
}

.material-card__img img{
    width: 100%;
    height: 100%;
}

/* Code badge — absolute top-right */
.material-card__code {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    width: 20px;
    height: 20px;
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--dark);
    letter-spacing: .02em;
    border-radius: 2px;
    line-height: 1;

    font-size: 8px;
    line-height: 160%;
}

/* Name */
.material-card__name {
    padding: 4px 8px 10px;
    font-size: 10px;
    font-weight: 600;
    color: var(--dark);
    line-height: 1.35;
    background: var(--white);
    text-wrap: nowrap;
}

@media (min-width: 768px) {
    .material-card__code { font-size: 14px; }
    .material-card__name { font-size: 16px; padding: 6px 12px 16px; }
}

@media (min-width: 1024px) {
    .materials {
        padding-top: 60px;
        padding-bottom: 84px;
    }

    .material-card {
        height: 220px;
        width: 220px;
        min-width: 220px;
    }

    .materials .h2{
        margin-bottom: 48px;
    }

    .material-card__code{
        right: 16px;
        top: 16px;
        width: 34px;
        height: 34px;
        font-size: 14px;
    }

    .material-card__img {
        aspect-ratio: 4 / 2.8;
    }

    .material-card__name{
        padding: 6px 12px 16px;
        font-size: 16px;
    }
}
