/* =========================================================
   Главная — тестовый блок "Популярные ланъярды для бейджей"
   Подключается отдельным файлом после index.css
   ========================================================= */

.home-products {
    width: 100%;
    background: #f7f9fb;
    padding: 72px 0 76px;
    border-top: 1px solid #edf0f3;
    border-bottom: 1px solid #edf0f3;
}

.home-products__head {
    max-width: 820px;
    margin: 0 auto 36px;
}

.home-products__head h2 {
    font-size: 31px;
    line-height: 1.25;
    font-weight: 600;
    color: #404040;
}

.home-products__head p {
    margin: 13px auto 0;
    max-width: 690px;
    font-size: 15px;
    line-height: 1.65;
    color: #777;
}

.home-products__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    align-items: stretch;
}

.home-product-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    background: #fff;
    border: 1px solid #e5e9ed;
    border-radius: 16px;
    box-shadow: 0 12px 30px rgba(25, 35, 45, 0.07);
    transition: transform .22s ease, box-shadow .22s ease;
}

.home-product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 36px rgba(25, 35, 45, 0.11);
}

.home-product-card__media {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #f1f3f5;
}

.home-product-card__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: opacity .38s ease, transform .55s ease;
}

.home-product-card__img--front { opacity: 1; }
.home-product-card__img--back { opacity: 0; transform: scale(1.025); }

@media (hover: hover) and (pointer: fine) {
    .home-product-card__media:hover .home-product-card__img--front { opacity: 0; }
    .home-product-card__media:hover .home-product-card__img--back { opacity: 1; transform: scale(1); }
}

.home-product-card__badge {
    position: absolute;
    left: 14px;
    top: 14px;
    z-index: 2;
    padding: 7px 11px;
    border-radius: 999px;
    background: rgba(255,255,255,.94);
    color: #50555b;
    font-size: 11px;
    line-height: 1;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(0,0,0,.10);
}

.home-product-card__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 23px 22px 22px;
}

.home-product-card__body h3 {
    margin: 0;
    min-height: 52px;
    font-size: 20px;
    line-height: 1.3;
    font-weight: 650;
    color: #353535;
}


.home-product-card__specs {
    margin: 0;
    padding: 15px 0;
    border-top: 1px solid #edf0f2;
    border-bottom: 1px solid #edf0f2;
}

.home-product-card__specs > div {
    display: grid;
    grid-template-columns: minmax(0, 42%) minmax(0, 58%);
    gap: 10px;
    padding: 4px 0;
}

.home-product-card__specs dt,
.home-product-card__specs dd {
    margin: 0;
    font-size: 12.5px;
    line-height: 1.45;
}

.home-product-card__specs dt {
    color: #969ba0;
    font-weight: 500;
}

.home-product-card__specs dd {
    color: #444;
    font-weight: 600;
    text-align: right;
}

.home-product-card__urgent {
    margin-top: 14px;
    padding-left: 20px;
    position: relative;
    font-size: 12px;
    font-weight: 600;
    color: #6f7a43;
}

.home-product-card__urgent::before {
    content: "✓";
    position: absolute;
    left: 0;
    top: -1px;
    color: #96ce1a;
    font-weight: 800;
}

.home-product-card__price {
    margin-top: auto;
    padding-top: 19px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
}

.home-product-card__price strong {
    font-size: 24px;
    line-height: 1;
    color: #ff8800;
    font-weight: 800;
    white-space: nowrap;
}

.home-product-card__price span {
    font-size: 12px;
    line-height: 1.35;
    color: #777;
    text-align: right;
}

.home-product-card__add {
    width: 100%;
    height: 46px;
    margin-top: 16px;
    border: 2px solid #ff8800;
    border-radius: 14px;
    background: #ff8800;
    color: #fff;
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: background .2s ease, color .2s ease, border-color .2s ease;
}

.home-product-card__add:hover,
.home-product-card__add.is-added {
    background: #fff;
    color: #ff8800;
}

.home-products__more {
    margin-top: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 14px;
    color: #6f7377;
}

.home-products__more a {
    color: #6d9f00;
    font-weight: 700;
    border-bottom: 1px solid rgba(109,159,0,.35);
}

.home-products__more a:hover { color: #ff8800; border-color: #ff8800; }

@media (max-width: 1199px) {
    .home-products__grid { gap: 18px; }
    .home-product-card__body { padding: 20px 18px; }
    .home-product-card__body h3 { font-size: 18px; }
    .home-product-card__price strong { font-size: 21px; }
}

@media (max-width: 991px) {
    .home-products { padding: 60px 0 64px; }
    .home-products__grid { grid-template-columns: 1fr; max-width: 680px; margin: 0 auto; }
    .home-product-card { display: grid; grid-template-columns: 42% 58%; }
    .home-product-card__media { aspect-ratio: auto; min-height: 100%; }
    .home-product-card__body h3 { min-height: 0; }
}

@media (max-width: 767px) {
    .home-products { padding: 48px 0 52px; }
    .home-products__head { margin-bottom: 28px; }
    .home-products__head h2 { font-size: 30px; }
    .home-product-card { display: flex; }
    .home-product-card__media { aspect-ratio: 4 / 3; }
}

@media (max-width: 575px) {
    .home-products { padding: 38px 0 44px; }
    .home-products .container { padding-left: 15px; padding-right: 15px; }
    .home-products__head { margin-bottom: 22px; padding: 0 4px; }
    .home-products__head h2 { font-size: 25px; line-height: 1.25; }
    .home-products__head p { margin-top: 11px; font-size: 13px; line-height: 1.55; }
    .home-products__grid { gap: 18px; }
    .home-product-card { border-radius: 14px; }
    .home-product-card__media { aspect-ratio: auto; height: 205px; }
    .home-product-card__badge { left: 11px; top: 11px; padding: 6px 9px; font-size: 10px; }
    .home-product-card__body { padding: 17px 15px 16px; }
    .home-product-card__body h3 { min-height: 0; font-size: 17px; line-height: 1.35; }
    .home-product-card__specs { margin-top: 13px; padding: 12px 0; }
    .home-product-card__specs > div { grid-template-columns: 42% 58%; gap: 8px; padding: 3px 0; }
    .home-product-card__specs dt,
    .home-product-card__specs dd { font-size: 11.5px; line-height: 1.4; }
    .home-product-card__urgent { margin-top: 12px; font-size: 11px; }
    .home-product-card__price { padding-top: 15px; align-items: center; }
    .home-product-card__price strong { font-size: 21px; }
    .home-product-card__price span { font-size: 11px; }
    .home-product-card__add { height: 44px; margin-top: 13px; }
    .home-products__more { margin-top: 23px; padding: 0 8px; font-size: 12.5px; line-height: 1.5; text-align: center; }
}

@media (max-width: 380px) {
    .home-product-card__media { height: 190px; }
    .home-product-card__specs > div { grid-template-columns: 40% 60%; }
    .home-product-card__price { gap: 8px; }
    .home-product-card__price strong { font-size: 20px; }
}

/* =========================================================
   Mobile hardening — 343–575px
   Изолируем карточки от старых глобальных стилей главной
   ========================================================= */
@media only screen and (max-width: 575px) {
    .home-products .home-products__grid {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        width: 100% !important;
        max-width: 100% !important;
        gap: 16px !important;
        margin: 0 !important;
    }

    .home-products .home-product-card {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        overflow: hidden !important;
    }

    .home-products .home-product-card__media {
        display: block !important;
        position: relative !important;
        width: 100% !important;
        height: 210px !important;
        min-height: 210px !important;
        max-height: 210px !important;
        aspect-ratio: auto !important;
        flex: 0 0 210px !important;
        overflow: hidden !important;
    }

    .home-products .home-product-card__img {
        position: absolute !important;
        inset: 0 !important;
        display: block !important;
        width: 100% !important;
        height: 100% !important;
        min-height: 0 !important;
        max-height: none !important;
        object-fit: cover !important;
        object-position: center center !important;
    }

    .home-products .home-product-card__body {
        width: 100% !important;
        min-width: 0 !important;
        padding: 16px 15px 15px !important;
    }

    .home-products .home-product-card__body h3 {
        min-height: 0 !important;
        margin: 0 0 12px !important;
        font-size: 16px !important;
        line-height: 1.32 !important;
    }

    .home-products .home-product-card__specs {
        margin: 0 !important;
        padding: 10px 0 !important;
    }

    .home-products .home-product-card__specs > div {
        grid-template-columns: 43% 57% !important;
        gap: 7px !important;
        padding: 2px 0 !important;
    }

    .home-products .home-product-card__specs dt,
    .home-products .home-product-card__specs dd {
        font-size: 11px !important;
        line-height: 1.35 !important;
    }

    .home-products .home-product-card__urgent {
        margin-top: 10px !important;
        font-size: 10.5px !important;
        line-height: 1.35 !important;
    }

    .home-products .home-product-card__price {
        margin-top: 0 !important;
        padding-top: 13px !important;
        gap: 8px !important;
    }

    .home-products .home-product-card__price strong {
        font-size: 20px !important;
    }

    .home-products .home-product-card__price span {
        font-size: 10px !important;
    }

    .home-products .home-product-card__add {
        height: 42px !important;
        margin-top: 11px !important;
        font-size: 12px !important;
    }
}

/* Фастекс — немного уменьшаем фото относительно двух первых карточек */
.home-product-card:nth-child(3) .home-product-card__img--front {
    transform: scale(0.96) !important;
}

/* На ПК сохраняем тот же масштаб при наведении */
@media (hover: hover) and (pointer: fine) {
    .home-product-card:nth-child(3) .home-product-card__media:hover .home-product-card__img--front {
        transform: scale(0.96) !important;
    }
}

/* На мобильном уменьшаем чуть меньше */
@media only screen and (max-width: 575px) {
    .home-product-card:nth-child(3) .home-product-card__img--front {
        transform: scale(0.98) !important;
    }
}


@media only screen and (max-width: 380px) {
    .home-products .home-product-card__media {
        height: 195px !important;
        min-height: 195px !important;
        max-height: 195px !important;
        flex-basis: 195px !important;
    }
}

/* =========================================================
   Фото карточек v5 — компромисс между 1 и 2 вариантом
   ПК — фото чуть крупнее
   Мобилка — тоже крупнее, но аккуратнее
   ========================================================= */
.home-products .home-product-card__media {
    background: #ecebe7;
}

.home-products .home-product-card__img--front {
    object-fit: contain !important;
    object-position: center center !important;
    transform: scale(1.06);
}

.home-products .home-product-card__img--back {
    object-fit: cover !important;
    object-position: center center !important;
}

@media (hover: hover) and (pointer: fine) {
    .home-products .home-product-card__media:hover .home-product-card__img--front {
        transform: scale(1.06);
    }
}

/* Мобильная версия — фото крупнее, но аккуратнее, чем на ПК */
@media only screen and (max-width: 575px) {
    .home-products .home-product-card__media {
        height: 220px !important;
        min-height: 220px !important;
        max-height: 220px !important;
        flex-basis: 220px !important;
        background: #ecebe7 !important;
    }

    .home-products .home-product-card__img--front {
        object-fit: contain !important;
        object-position: center center !important;
        transform: scale(1.01) !important;
    }

    .home-products .home-product-card__img--back {
        object-fit: contain !important;
        object-position: center center !important;
        transform: scale(1.01) !important;
    }
}

@media only screen and (max-width: 380px) {
    .home-products .home-product-card__media {
        height: 210px !important;
        min-height: 210px !important;
        max-height: 210px !important;
        flex-basis: 210px !important;
    }

    .home-products .home-product-card__img--front,
    .home-products .home-product-card__img--back {
        transform: scale(0.98) !important;
    }
}