:root {
    --color-primary: #606e9d;
    --color-border: #ddd;
    --radius: 5px;
    --gap: 4px;
}

/* Контейнер блока */
.greatDeals {
    display: block;
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    text-align: center;
}


/* Шапка с заголовком и ссылкой */
.greatDeals .headerLine {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 12px 0;
}

/* Заголовки */
.greatDeals .headerLine h2 {
    margin: 0;
    font-size: 1em;
    font-weight: normal;
    color: #7d7d7d;
    background: linear-gradient(to bottom, #ffffff 37%, #f9f9f9 66%, #f4f4f4 100%);
    border-bottom: 1px solid var(--color-border);
}

.greatDeals .headerLine a {
    position: absolute;
    right: 20px;
    padding-left: 25px;
    padding-top: 2px;
    background: url('../img/svg/vk.svg') no-repeat left center;
    background-size: 20px 20px;
    font-weight: bold;
    font-size: 14px;
    color: var(--color-primary);
    text-decoration: none;
}

.greatDeals .children {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--gap);
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Карточка (общие стили) */
.deal {
    position: relative;
    width: 100%;
    aspect-ratio: 1/1;
    border-radius: var(--radius);
    overflow: hidden;
    background-position: center;
    background-repeat: no-repeat;
    background-size: auto 100%;
    transition: background-size 0.2s ease, opacity 0.2s ease;
}

.deal a {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
}

/* --- Стили конкретных карточек --- */

/* Семейная ипотека */
.deal.commercial {
    /* background-image: url('/sources/index/deals/family-mortgage-bg.png'); */
    background-image: url('/sources/index/deals/commercial-bg.png');
}
.deal.commercial a {
    background: url('/sources/index/deals/commercial-text.svg') no-repeat center;
    background-size: auto 100%;
}

/* Уютные квартиры */
.deal.comfortFlats {
    background-image: url('/sources/index/deals/comfort-village-bg.png');
}
.deal.comfortFlats a {
    background: url('/sources/index/deals/comfort-village-text.svg') no-repeat center;
    background-size: auto 100%;
}

/* Trade-In */
.deal.tradeIn {
    background-image: url('/sources/index/deals/trade-in-bg.png');
    background-color: #d7ebe0;
}
.deal.tradeIn a {
    background: url('/sources/index/deals/trade-in-text.svg') no-repeat center;
    background-size: auto 100%;
}

/* День открытых дверей */
.deal.openDoors {
    background-color: #bb2b56;
    background-size: auto 150%;
}
.deal.openDoors a span.address {
    display: none; /* Скрыто по умолчанию, показывается в нужных брейкпоинтах */
}

/* Сертификат */
.deal.certificate.NewYear {
    background-color: #4B5E85;
    background-image: url('/sources/index/deals/certificate_bg.png');
    background-size: cover;
}
.deal.certificate.NewYear a {
    background: url('/sources/index/deals/certificate-text.svg') no-repeat 50% 15px;
    background-size: 90% auto;
}

/* Дисконтная карта */
.deal.discountCard {
    background-color: #3d5093;
    background-image: url('/sources/index/deals/discount-card.png');
}
.deal.discountCard a {
    background: url('/sources/index/deals/discount-banner-text.svg') no-repeat center;
    background-size: auto 100%;
}

/* Ипотечный калькулятор */
.deal.mortgageCalculator {
    background-color: #338a7a;
    background-image: url('/sources/index/deals/green-bg-ipoteka.png');
    background-size: cover;
    height: 220px;
}
.deal.mortgageCalculator .mortgage a {
    background: url('/sources/index/deals/ipoteka-object.png') no-repeat calc(50% + 15px) 70px;
    background-size: 95px auto;
}
.deal.mortgageCalculator .mortgage a::before {
    content: "";
    display: block;
    width: 100%;
    height: 160px;
    background: linear-gradient(to bottom, rgb(68 172 147) 0%, rgba(60,127,111,0.65) 46%, rgba(0,0,0,0) 100%);
    border-radius: var(--radius) var(--radius) 0 0;
}
.deal.mortgageCalculator .mortgage a::after {
    content: "";
    display: block;
    width: 120px;
    height: 120px;
    margin: -160px auto 0;
    background: url('/sources/index/deals/ipoteka-text.svg') no-repeat;
    background-size: 120px auto;
}

/* Эффекты наведения */
.deal:hover {
    background-size: auto 105%;
    opacity: 0.9;
}

.deal a:hover {
    background-size: auto 105% !important;
}

/* --- Адаптивность --- */

@media (max-width: 900px) {
    .greatDeals .children {
        grid-template-columns: repeat(2, 1fr);
    }

    .greatDeals .headerLine {
        margin-left: 16px;
        justify-content: start;
    }

    .deal {
        aspect-ratio: 16/9;
        
    }
}

@media (max-width: 639px) {
    .greatDeals .children {
        gap: 0;
    }

    .greatDeals h2 .hidden {
        display: none;
    }

    .deal {
       border-radius: 0;   
    }
}