/* ============================================
   HEADER - Базові стилі (Mobile First)
   ============================================ */

.header {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    z-index: 100;
    padding: 7px 16px;
    background: var(--lpv3-header, #fff);
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: all 0.2s linear;
}

.header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0;
    max-width: 1340px;
    margin: 0 auto;
}

/* ============================================
   HEADER - Модифікатори тем
   ============================================ */

.header--black {
    color: #fff;
}

.header--black .header__logo path { fill: #fff; }
.header--black .header__nav-link { color: #fff; }
.header--black .header__nav-link path { stroke: #fff; }
.header--black .header__log-in { color: #fff; }
.header--black .header__nav-opener span,
.header--black .header__nav-opener::before,
.header--black .header__nav-opener::after { background: #fff; }
.header--black .header__nav { background: #000; }
.header--black .header__nav-small-card-link { color: #fff; }
.header--black .header__nav-small-card-title { color: gray; }

.header--black .lpv3-btn--filled {
    background: #fff;
    color: #000;
}

/* ============================================
   HEADER - Логотип
   ============================================ */

.header__logo {
    line-height: 1;
    display: inline-flex;
}

/* ============================================
   HEADER - Навігація (Desktop за замовчуванням)
   ============================================ */

.header__nav {
    width: 100%;
    display: none;
    justify-content: center;
    gap: 20px;
}

.header__nav-list {
    display: flex;
    justify-content: space-between;
    gap: 5px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.header__nav-list li {
    position: relative;
}

.header__nav-list li a {
    text-decoration: none;
    font-weight: 500;
    color: #202020;
    font-size: 16px;
    line-height: 18px;
}

.header__nav-list li a:hover { color: #202020; }

/* Випадаюче меню (Desktop) */
.header__nav-list li ul {
    position: absolute;
    flex-direction: column;
    row-gap: 16px;
    padding: 16px;
    background: #fff;
    margin: 13px 0 0 -20px;
    opacity: 0;
    visibility: hidden;
    transition: 0.5s all;
}

.header__nav-list li:hover ul {
    opacity: 1;
    display: flex;
    visibility: visible;
}

/* ============================================
   HEADER - Навігаційні елементи з картками
   ============================================ */

.header__nav-item {
    display: flex;
    padding: 16px 12px 16px 16px;
    align-items: center;
    gap: 4px;
    border-radius: 10000px;
    position: relative;
}

.header__nav-item:hover { background: #F5F5F5; }
.header__nav-item:hover .header__nav-sub-item {
    opacity: 1;
    visibility: visible;
}

.header__nav-link {
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    text-decoration: none;
    color: #000;
    font-family: Inter, sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 140%;
}

/* Підменю з картками */
.header__nav-sub-item {
    position: absolute;
    left: 0;
    top: 100%;
    display: flex;
    width: 304px;
    padding: 24px;
    flex-direction: column;
    align-items: flex-start;
    gap: 40px;
    background: #fff;
    border-radius: 14px;
    border: 4px solid #F5F5F5;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

/* Малі картки */
.header__nav-small-cards {
    width: 300px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

.header__nav-small-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    align-self: stretch;
}

.header__nav-small-card-title {
    color: #99A1AF;
    font-family: Inter, sans-serif;
    font-size: 12px;
    font-weight: 500;
    line-height: 130%;
    letter-spacing: 0.72px;
    text-transform: uppercase;
}

.header__nav-small-card-link {
    display: flex;
    padding: 0;
    align-items: center;
    gap: 4px;
    align-self: stretch;
    color: #000;
    font-family: Inter, sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 130%;
    text-decoration: none;
}

.header__nav-small-card-link::before {
    content: '•';
    color: #000;
}

.header__nav-small-card-link:hover { text-decoration: underline; }

.header__nav-small-card-link img {
    width: 20px;
    height: 20px;
    object-fit: cover;
    object-position: center;
}

/* Великі картки */
.header__nav-big-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    width: 480px;
}

.header__nav-big-card {
    padding: 10px;
    text-decoration: none;
    color: #202020;
    transition: 0.3s all;
}

.header__nav-big-card:hover { background: rgba(27, 15, 128, 0.05); }

.header__nav-big-card-title {
    margin-bottom: 10px;
    font-weight: 500;
    line-height: 18px;
}

.header__nav-big-card-text { line-height: 18px; }

/* ============================================
   HEADER - Права частина (Кнопки, Логін)
   ============================================ */

.header__right {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.header__log-in {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 17px;
    color: #202020;
    white-space: nowrap;
    text-decoration: none;
    font-size: 12px;
    line-height: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
}

.header__log-in span:last-child { color: var(--lpv3-5, #000); }

.header__log-in-icon {
    display: none;
    justify-content: center;
    align-items: center;
    width: 48px;
    height: 48px;
    background: var(--lpv3-5, #000);
    border-radius: 50%;
}

.header__log-in-icon svg { max-width: 18px; }

/* Кнопки */
.header .blue-button {
    display: inline-flex;
    padding: 15px 24px;
    white-space: nowrap;
    font-weight: 600;
    font-size: 18px;
    background: #000;
    border-radius: 8px;
}

.header .blue-button:hover { color: #000; }

.header .lpv3-btn { padding: 10px; }

/* ============================================
   HEADER - Бургер-меню (Mobile)
   ============================================ */

.header__nav-opener {
    display: block;
    width: 40px;
    height: 40px;
    margin-left: -10px;
    padding: 0;
    background: none;
    border: 0;
    position: relative;
}

.header__nav-opener span,
.header__nav-opener::before,
.header__nav-opener::after {
    position: absolute;
    width: 26px;
    left: 7px;
    height: 2px;
    top: 50%;
    background: #000;
    transition: transform 0.25s linear;
}

.header__nav-opener::before,
.header__nav-opener::after { content: ""; }

.header__nav-opener::before { transform: translateY(-8px); }
.header__nav-opener::after {
    width: 13px;
    transform: translateY(8px);
}

/* Анімація відкриття */
.header.show-nav .header__nav-opener { z-index: 11; }
.header.show-nav .header__nav-opener span { transform: rotate(-45deg); }
.header.show-nav .header__nav-opener::before { transform: translateY(0) rotate(45deg); }
.header.show-nav .header__nav-opener::after {
    transform: translateY(0);
    opacity: 0;
}

/* ============================================
   HEADER - Стани навігації
   ============================================ */

/* Мобільна навігація при відкритті */
.header.show-nav .header__nav {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    row-gap: 20px;
}

/* ============================================
   MOBILE NAVIGATION OVERLAY
   ============================================ */

.mobile-nav {
    position: fixed;
    inset: 0;
    z-index: 999;
    overflow: hidden;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(100%);
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0.32s;
}

.mobile-nav.is-open {
    visibility: visible;
    pointer-events: auto;
    transform: translateX(0);
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0s;
}

/* Екрани */
.mobile-nav__screen {
    position: absolute;
    inset: 0;
    background: #fff;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-nav__screen--main {
    z-index: 1;
    transform: translateX(0);
}

.mobile-nav__screen--main.is-out { transform: translateX(-100%); }

.mobile-nav__screen--sub {
    z-index: 2;
    transform: translateX(100%);
}

.mobile-nav__screen--sub.is-active { transform: translateX(0); }

/* Шапка */
.mobile-nav__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    flex-shrink: 0;
    min-height: 60px;
}

.mobile-nav__logo {
    line-height: 1;
    display: inline-flex;
}

.mobile-nav__close,
.mobile-nav__back {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    background: none;
    border: none;
    color: #000;
    flex-shrink: 0;
    cursor: pointer;
}

.mobile-nav__screen-title {
    font-size: 18px;
    font-weight: 500;
    color: #000;
    text-align: center;
}

/* Тіло */
.mobile-nav__body {
    flex: 1;
    overflow-y: auto;
    padding: 4px 20px 110px;
    -webkit-overflow-scrolling: touch;
}

.mobile-nav__body--sub { padding-top: 8px; }

/* Список навігації */
.mobile-nav__list {
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    list-style: none;
}

.mobile-nav__item { display: flex; }

.mobile-nav__link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 18px 0;
    font-family: inherit;
    font-size: 19px;
    font-weight: 400;
    line-height: 1.3;
    color: #000;
    text-align: left;
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
}

.mobile-nav__link span { flex: 1; }

/* Секції підменю */
.mobile-nav__section { padding: 16px 0; }

.mobile-nav__section-title {
    margin-bottom: 14px;
    font-size: 12px;
    font-weight: 700;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.mobile-nav__section-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.mobile-nav__section-link {
    display: block;
    position: relative;
    padding-left: 16px;
    font-size: 16px;
    line-height: 1.4;
    color: #000;
    text-decoration: none;
}

.mobile-nav__section-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.45em;
    width: 5px;
    height: 5px;
    background: #000;
    border-radius: 50%;
}

.mobile-nav__section-link:hover { text-decoration: underline; }

.mobile-nav__divider {
    margin: 0;
    border: none;
    border-top: 1px solid #ebebeb;
}

/* Футер з CTA */
.mobile-nav__footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10;
    padding: 14px 20px 20px;
    background: #fff;
}

.mobile-nav__cta {
    display: block;
    width: 100%;
    padding: 16px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 500;
    color: #fff;
    text-align: center;
    text-decoration: none;
    background: #000;
    border-radius: 100px;
    transition: opacity 0.2s;
}

.mobile-nav__cta:hover {
    opacity: 0.85;
    color: #fff;
}

/* ============================================
   BLOG - Картки
   ============================================ */

.blog .cards .cards-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.blog .cards .cards-header-all {
    color: rgb(117, 117, 117);
    text-decoration: none;
    font-size: 14px;
    line-height: 29px;
}

.blog .cards .cards-header-all:hover { color: #170df2; }

/* ============================================
   MEDIA QUERIES - Tablet (768px - 1199px)
   ============================================ */

@media (min-width: 768px) {
    .header__log-in {
        flex-direction: column-reverse;
        gap: 5px;
    }
    
    .header__log-in span { display: inline; }
    
    .header__log-in-icon { display: none; }
    
    .header__right { gap: 5px; }
    
    /* Landing Page */
    .landing-hero__inner {
        flex-direction: column;
        row-gap: 40px;
        padding: 38px 0 40px;
        height: unset;
    }
    
    .landing-hero__content { margin-right: auto; }
    
    .numbers-and-titles__list { justify-content: center; }
    
    .free-consultation-info { overflow: hidden; }
    .free-consultation-info__inner { position: static; }
    .landing-hero__background img { object-position: 75%; }
    
    .pricing-cards__list { grid-template-columns: repeat(2, 1fr); }
    .new-partners-section__grid { grid-template-columns: repeat(3, 1fr); }
}

/* ============================================
   MEDIA QUERIES - Desktop (1200px+)
   ============================================ */

@media (min-width: 1200px) {
    .header {
        padding: 16px;
    }

    .header__inner {
        column-gap: 20px;
    }

    /* Показуємо десктопну навігацію, ховаємо burger */
    .header__nav-opener { display: none; }

    .header__nav {
        display: flex;
        position: static;
        height: auto;
        background: transparent;
        overflow-y: visible;
    }

    /* Десктопний хедер з nav-items (~86px) — збільшуємо відступ */
    #PAGES_CONTAINER { padding-top: 90px; }
}

/* ============================================
   MEDIA QUERIES - Mobile (< 767px)
   ============================================ */

@media (max-width: 767px) {
    #PAGES_CONTAINER { padding-top: 64px; }
    
    .header__nav {
        display: none;
        position: absolute;
        width: 100%;
        height: calc(100vh - 70px);
        left: 0;
        top: 70px;
        background: gainsboro;
        overflow-y: auto;
        padding: 30px 15px;
    }
    
    /* Мобільна навігація - структура */
    .header__nav-list ul {
        flex-direction: column;
        row-gap: 32px;
        padding: 40px 0;
    }
    
    .header__nav-list ul li { text-align: center; }
    
    .header__nav-list ul li a {
        font-size: 20px;
        line-height: 32px;
        font-weight: 500;
        color: #202020;
    }
    
    .header__nav-list ul li ul {
        position: static;
        margin: 0;
        padding: 0;
        opacity: 1;
        background: unset;
        row-gap: 32px;
    }
    
    /* Мобільні картки в меню */
    .header__nav-item {
        display: block;
        padding: 0;
        border-radius: 0;
    }
    
    .header__nav-item:hover { background: transparent; }
    .header__nav-item:hover .header__nav-sub-item { display: block; }
    
    .header__nav-link {
        width: 100%;
        font-size: 20px;
        text-align: center;
    }
    
    .header__nav-sub-item {
        display: none;
        position: static;
        width: 100%;
        padding: 0;
        background: transparent;
        border: none;
        border-top: 1px solid #202020;
        border-bottom: 1px solid #202020;
        border-radius: 0;
        opacity: 1;
        visibility: visible;
        gap: 16px;
    }
    
    .header__nav-big-cards,
    .header__nav-small-cards { width: 100%; }
    
    /* Landing Page Mobile */
    .landing-hero__title {
        font-size: 32px;
        line-height: 1.5em;
    }
    
    .landing-hero__inner {
        flex-direction: column;
        padding: 40px 0;
    }
    
    .landing-hero__form { max-width: unset; }
    
    .problem-and-solutions__bottom-row ul {
        columns: unset;
        column-gap: unset;
    }
    
    .problem-and-solutions__column,
    .problem-and-solutions__bottom-row .problem-and-solutions__column { background: #E4ECF7; }
    
    .free-consultation-info__content { max-width: 420px; }
    .free-consultation-info__title {
        font-size: 32px;
        line-height: 1.5em;
    }
    
    .sponsors-partners__logos-list {
        grid-template-columns: repeat(3, 1fr);
        column-gap: 20px;
    }
    
    .special-offer-section { padding: 0 16px; }
    .special-offer-section__inner {
        flex-direction: column;
        align-items: center;
    }
    .special-offer-section__left-side { padding: 24px; }
    .special-offer-section__right-side img { max-width: unset; }
    
    .new-partners-section__filter {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        row-gap: 10px;
    }
    .new-partners-section__select {
        grid-column: span 2;
        max-width: unset;
    }
    .new-partners-section__clear-all {
        display: inline-flex;
        margin-left: auto;
        margin-top: 10px;
    }
    .new-partners-section__apply-button { margin-top: 10px; }
    
    /* Footer Mobile */
    .footer { padding: 60px 0 40px; }
    .footer__inner {
        flex-direction: column;
        gap: 40px;
    }
    .footer__right {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        row-gap: 25px;
        column-gap: 15px;
    }
    .footer__logos img {
        width: 50px;
        height: 50px;
        object-fit: contain;
    }
    
    /* Hero Mobile */
    .hero {
        margin: 0;
        padding: 33px 20px 93px;
    }
    .hero.min-height { min-height: 280px; }
    .hero h1, .hero h2, .hero h3 {
        letter-spacing: 1.4px;
        line-height: 39px;
        font-size: 28px;
        width: 190px;
    }
    .hero + .number-list { margin: 0; }
    .hero + .about {
        padding-top: 147px;
        margin-top: 0;
    }
    
    /* About Mobile */
    .about h1, .about h2, .about h3, .about h4, .about h5 {
        font-size: 29px;
        line-height: 46px;
    }
    
    /* Cards Mobile */
    .simple-card {
        height: 235px;
        margin: 0 0 32px;
    }
    .simple-card-text {
        font-size: 28px;
        line-height: 39px;
    }
    .simple-text { margin-bottom: 14px; }
    
    /* Author Mobile */
    .author {
        flex-direction: column;
        padding: 0 25px;
    }
    .author-img {
        margin: 0 0 10px;
        width: 160px;
        height: 160px;
    }
    .author-copyright { font-size: 11px; }
    
    /* Videos Mobile */
    .introduce-videos {
        padding: 0 40px;
        margin-bottom: 140px;
    }
    .introduce-videos h1, .introduce-videos h2, .introduce-videos h3, .introduce-videos h4 {
        letter-spacing: 1.4px;
        font-size: 28px;
        line-height: 39px;
        margin-bottom: 22px;
    }
    .introduce-videos-item { flex-direction: column; }
    .introduce-videos-label {
        text-align: center;
        padding: 0 0 10px;
    }
    .introduce-videos .white-btn { width: 100%; }
    
    /* Booking Mobile */
    .booking-card-area {
        flex-direction: column;
        padding: 0;
        border: 1px solid rgba(0,0,0,0.2);
    }
    .booking-card-img {
        width: 100%;
        height: 157px;
        margin: 0;
    }
    .booking-card-info {
        padding: 20px;
        flex-direction: column;
    }
    .booking-card-holder {
        gap: 12px;
        padding-bottom: 16px;
        border-bottom: 1px solid rgba(0,0,0,0.2);
        margin-bottom: 16px;
    }
    .booking-card-time {
        width: 100%;
        margin-bottom: 22px;
    }
    .booking-card-info .blue-button {
        width: 100%;
        margin-left: 0;
    }
    .booking-card.simple .booking-card-heading {
        font-size: 32px;
        line-height: 42px;
    }
    
    /* Text Page Mobile */
    .text-page { padding: 130px 0 80px; }
    .text-page h1 {
        font-size: 30px;
        line-height: 42px;
    }
    .text-page h3, .text-page h2 {
        font-size: 22px;
        line-height: 27px;
    }
    
    /* 404 Mobile */
    .error-404 { padding: 120px 16px 280px 16px; }
    .error-404__error-code {
        font: 800 180px/1.23em "Inter";
        top: -120px;
        left: -15px;
    }
    
    /* Consultation Mobile */
    .consultation { margin: 0; }
    .consultation-bg img { filter: grayscale(100%); }
    .consultation-holder { padding: 22px 25px; }
    .consultation h3, .consultation h4, .consultation h2 {
        font-size: 28px;
        line-height: 33px;
        text-align: center;
        letter-spacing: 1.4px;
    }
}