/* ============================================
   БЛОК 1: СТИЛИ HERO-СЕКЦИИ
   ============================================ */
.hero {
    position: relative;
    width: 100%;
    height: 520px;
    overflow: hidden;
}

.hero-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hero .hero-container {
    position: absolute;
    inset: 0;
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    padding: 0 40px;
}

.hero-content {
    max-width: 470px;
    color: #F9F5F2;
}

.hero-content h1 {
    font-size: 72px;
    font-weight: 500;
    line-height: 1;
    margin-bottom: 30px;
}

.hero-content p {
    font-size: 22px;
    line-height: 1.7;
    font-weight: 400;
}

/* ============================================
   БЛОК 2: СТИЛИ СЕКЦИИ УСЛУГ
   ============================================ */
.services {
    padding: 35px;
    background: #F9F5F2;
}

/* ============================================
   БЛОК 3: ОБЩИЙ КОНТЕЙНЕР
   ============================================ */
.container {
    width: 90%;
    max-width: 1280px;
    margin: 0 auto;
}

/* ============================================
   БЛОК 4: ЗАГОЛОВОК СЕКЦИИ
   ============================================ */
.section-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 80px;
    margin-bottom: 70px;
}

.subtitle {
    display: inline-block;
    margin-bottom: 15px;
    font-size: 14px;
    letter-spacing: 4px;
    color: #688A8A;
    font-weight: 600;
}

.section-head h2 {
    font-size: 40px;
    font-weight: 500;
    color: #121719;
    line-height: 1.1;
}

.section-head p {
    max-width: 500px;
    font-size: 17px;
    line-height: 1.8;
    color: #6B686C;
}

/* ============================================
   БЛОК 5: СЕТКА КАРТОЧЕК
   ============================================ */
.cards {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.cards-title {
    color: #121719;
    margin-bottom: 0px;
}

.cards hr {
    display: block;
    height: 1px;
    background: #cbcbcb;
    border: none;
    margin: 10px 0;
}

/* ============================================
   БЛОК 6: КАРТОЧКА УСЛУГИ
   ============================================ */
.card {
    display: grid;
    grid-template-columns: 340px 1fr 220px;
    gap: 35px;
    background: #FAF6F3;
    border-radius: 22px;
    padding: 25px;
    border: 1px solid #bbbbbb;
}

.card-image img {
    width: 100%;
    height: 250px;
    border-radius: 18px;
    display: block;
    object-fit: cover;
}

.card-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.card-info h3 {
    font-size: 34px;
    font-weight: 500;
    color: #121719;
}

.features {
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
}

.features span {
    padding: 10px 18px;
    font-size: 14px;
    color: #555;
}

.card-side {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.price {
    font-size: 34px;
    color: #494B4F;
    margin-bottom: 25px;
}

.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 170px;
    height: 52px;
    border-radius: 50px;
    background: #326063;
    color: white;
    text-decoration: none;
    font-size: 15px;
    border: none;
    transition: transform 0.3s ease;
    cursor: pointer;
}

.btn:hover {
    background-color: #234143;
    transform: translateY(-5px);
}

/* ============================================
   БЛОК 7: СЕКЦИЯ ИНДИВИДУАЛЬНОГО ПОДХОДА
   ============================================ */
.advice {
    padding: 40px 0;
    background: #F9F5F2;
}

.advice-container {
    width: 90%;
    max-width: 1170px;
    margin: 0 auto;
    background-color: #E2F1F1;
    border-radius: 20px;
}

.advice-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 40px;
}

.advice-image {
    flex-shrink: 0;
    margin-right: 10px;
}

.advice-image img {
    width: 150px;
    height: 150px;
    object-fit: contain;
    display: block;
}

.advice-content {
    flex: 1;
}

.advice-content h3 {
    margin-bottom: 10px;
    font-size: 18px;
    color: #2f2f2f;
    width: 400px;
}

.advice-content p {
    margin-bottom: 20px;
    font-size: 17px;
    line-height: 1.5;
    color: #555;
}

.advice-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
}

.advice-bottom p {
    flex: 1;
    margin: 0;
    font-size: 17px;
    line-height: 1.5;
}

.advice-button {
    padding: 14px 36px;
    border: 1px solid #42626E;
    border-radius: 40px;
    background-color: transparent;
    color: #42626E;
    font-size: 16px;
    flex-shrink: 0;
    width: 500px;
    transform: translateY(-50%);
    transition: transform 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    display: flex;
    justify-content: center;
    align-items: center;
}

.advice-button:hover {
    border: 1px solid #153038;
    color: #153038;
    transform: translateY(-30px);
}

/* ============================================
   БЛОК 8: МОДАЛЬНЫЕ ОКНА
   ============================================ */
.modal-bg {
    position: fixed;
    inset: 0;
    display: none;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99999;
}

.modal-bg.active {
    display: flex;
}

.modal-window {
    background-color: #E2F1F1;
    border: 1px solid #cbcbcb;
    border-radius: 10px;
    width: 400px;
    max-width: 90%;
    min-height: 200px;
    padding: 20px;
    box-sizing: border-box;
}

.close {
    cursor: pointer;
}

/* ============================================
   АДАПТИВНЫЕ СТИЛИ
   ============================================ */

/* ---------- ПЛАНШЕТЫ (768px - 1024px) ---------- */
@media screen and (max-width: 1024px) {
    .hero {
        height: 420px;
    }

    .hero .hero-container {
        padding: 0 30px;
    }

    .hero-content h1 {
        font-size: 52px;
    }

    .hero-content p {
        font-size: 18px;
    }

    .section-head {
        gap: 30px;
        margin-bottom: 50px;
    }

    .section-head h2 {
        font-size: 32px;
    }

    .card {
        grid-template-columns: 260px 1fr 180px;
        gap: 25px;
        padding: 20px;
    }

    .card-info h3 {
        font-size: 28px;
    }

    .card-image img {
        height: 200px;
    }

    .price {
        font-size: 28px;
    }

    .advice-wrapper {
        padding: 30px 30px;
        flex-wrap: wrap;
        justify-content: center;
        text-align: center;
    }

    .advice-content h3 {
        width: 100%;
        text-align: center;
    }

    .advice-bottom {
        flex-direction: column;
        align-items: center;
    }

    .advice-button {
        width: 100%;
        max-width: 400px;
        transform: translateY(0);
        margin-top: 10px;
    }

    .advice-button:hover {
        transform: translateY(-5px);
    }
}

/* ---------- МОБИЛЬНЫЕ ТЕЛЕФОНЫ (до 768px) ---------- */
@media screen and (max-width: 767px) {
    .hero {
        height: 320px;
    }

    .hero .hero-container {
        padding: 0 20px;
    }

    .hero-content {
        max-width: 100%;
    }

    .hero-content h1 {
        font-size: 36px;
        margin-bottom: 15px;
    }

    .hero-content p {
        font-size: 16px;
    }

    .services {
        padding: 20px 15px;
    }

    .container {
        width: 100%;
    }

    .section-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
        margin-bottom: 35px;
    }

    .section-head h2 {
        font-size: 28px;
    }

    .section-head p {
        max-width: 100%;
        font-size: 15px;
    }

    .subtitle {
        font-size: 12px;
        letter-spacing: 3px;
    }

    .cards {
        gap: 20px;
    }

    .cards-title {
        font-size: 22px;
    }

    .card {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 16px;
        border-radius: 16px;
    }

    .card-image img {
        height: 180px;
        border-radius: 14px;
    }

    .card-info {
        align-items: center;
        text-align: center;
    }

    .card-info h3 {
        font-size: 24px;
        margin-bottom: 8px;
    }

    .features {
        justify-content: center;
        gap: 10px;
    }

    .features span {
        padding: 6px 14px;
        font-size: 13px;
    }

    .card-side {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        flex-wrap: wrap;
        gap: 10px;
        width: 100%;
        padding-top: 10px;
        border-top: 1px solid #e0dcd9;
    }

    .price {
        font-size: 26px;
        margin-bottom: 0;
    }

    .btn {
        width: 140px;
        height: 44px;
        font-size: 14px;
    }

    .advice {
        padding: 30px 0;
    }

    .advice-container {
        width: 95%;
        border-radius: 16px;
    }

    .advice-wrapper {
        padding: 20px 18px;
        flex-direction: column;
        align-items: center;
    }

    .advice-image {
        margin-right: 0;
        margin-bottom: 10px;
    }

    .advice-image img {
        width: 100px;
        height: 100px;
    }

    .advice-content h3 {
        width: 100%;
        text-align: center;
        font-size: 20px;
    }

    .advice-content p {
        font-size: 15px;
        text-align: center;
        margin-bottom: 15px;
    }

    .advice-bottom {
        flex-direction: column;
        gap: 15px;
        width: 100%;
    }

    .advice-bottom p {
        text-align: center;
        font-size: 15px;
    }

    .advice-button {
        width: 100%;
        padding: 12px 20px;
        font-size: 15px;
        transform: translateY(0);
    }

    .advice-button:hover {
        transform: translateY(-3px);
    }

    .modal-window {
        width: 95%;
        padding: 20px;
        border-radius: 8px;
    }
}

/* ---------- ОЧЕНЬ МАЛЕНЬКИЕ ЭКРАНЫ (до 400px) ---------- */
@media screen and (max-width: 400px) {
    .hero {
        height: 260px;
    }

    .hero-content h1 {
        font-size: 28px;
    }

    .hero-content p {
        font-size: 14px;
    }

    .section-head h2 {
        font-size: 24px;
    }

    .card {
        padding: 12px;
        gap: 12px;
    }

    .card-image img {
        height: 150px;
    }

    .card-info h3 {
        font-size: 20px;
    }

    .features span {
        font-size: 12px;
        padding: 4px 10px;
    }

    .price {
        font-size: 22px;
    }

    .btn {
        width: 120px;
        height: 38px;
        font-size: 13px;
    }

    .advice-button {
        font-size: 14px;
        padding: 10px 16px;
    }

    .modal-window {
        padding: 16px;
    }
}

/* ---------- КРУПНЫЕ ЭКРАНЫ (от 1280px) ---------- */
@media screen and (min-width: 1280px) {
    .hero .hero-container {
        padding: 0 40px;
    }

    .card {
        padding: 30px 35px;
        gap: 40px;
    }

    .card-image img {
        height: 280px;
    }

    .advice-wrapper {
        padding: 10px 60px;
    }
}

/* ---------- ПОДДЕРЖКА СТАРЫХ БРАУЗЕРОВ ---------- */
@supports not (object-fit: cover) {
    .hero-bg {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        min-width: 100%;
        min-height: 100%;
    }

    .card-image img {
        position: relative;
        height: auto;
        min-height: 180px;
    }
}

/* ---------- ПЕЧАТЬ ---------- */
@media print {
    .hero {
        height: auto;
        min-height: 200px;
    }

    .hero .hero-container {
        position: relative;
        padding: 20px;
        background: #333;
    }

    .btn,
    .advice-button,
    .close {
        display: none !important;
    }

    .card {
        break-inside: avoid;
        border: 1px solid #ccc;
    }

    .modal-bg {
        display: none !important;
    }
}