/* ============================================================
   ЛЁГКИЙ ШАБЛОН
   ------------------------------------------------------------
   Структура файла:
   1. Переменные
   2. База и сброс
   3. Типографика
   4. Утилиты (лейаут, отступы, текст)
   5. Компоненты (карточка, кнопка, форма, ...)
   6. Секции (шапка, hero, футер, ...)
   7. Модальные окна и уведомления
   8. Адаптив
   ============================================================ */


/* ============================================================
   1. ТОКЕНЫ
   ============================================================ */
:root {
    --bg:            #ffffff;
    --bg-soft:       #fafafa;
    --bg-muted:      #f0f0f0;
    --ink:           #1a1a1a;
    --ink-strong:    #0a0a0a;
    --muted:         #666666;
    --muted-2:       #999999;
    --line:          #f0f0f0;
    --accent:        #111111;
    --accent-soft:   #333333;

    --r:             25px;
    --r-pill:        999px;

    --pad:           28px;
    --gap:           20px;
    --gap-lg:        24px;
    --section:       80px 0;

    --max:           1200px;
    --max-narrow:    900px;
}


/* ============================================================
   2. БАЗА
   ============================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a, button {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

img { max-width: 100%; display: block; }
button { font-family: inherit; }


/* ============================================================
   3. ТИПОГРАФИКА
   ============================================================ */
h1, h2, h3 {
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: var(--ink-strong);
}
h1 { font-size: 48px; margin-bottom: 24px; }
h2 { font-size: 36px; margin-bottom: 16px; }
h3 { font-size: 22px; margin-bottom: 12px; }

p { line-height: 1.6; }

.lead        { font-size: 20px; color: var(--muted); margin-bottom: 36px; }
.muted       { color: var(--muted); font-size: 15px; }
.small       { font-size: 14px; color: var(--muted-2); }
.italic      { font-style: italic; margin-bottom: 20px; color: #333; }
.mark        { background: #dfdfdf; padding: 6px 14px; border-radius: 8px; }
.link-underline { color: var(--accent); text-decoration: underline; }
.link-muted  { color: var(--muted-2); text-decoration: none; font-size: 14px; }


/* ============================================================
   4. УТИЛИТЫ
   ============================================================ */

.container {
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

.section      { padding: var(--section); }
.section--soft{ background: var(--bg-soft); }

.section-head { text-align: center; margin-bottom: 48px; }
.section-head p { color: var(--muted-2); font-size: 18px; margin-top: 8px; }

.grid       { display: grid; gap: var(--gap-lg); }
.grid--2    { grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); }
.grid--3    { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

.row  { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; margin-bottom: 48px; }

.visually-hidden {
    position: absolute;
    left: -9999px;
    width: 0; height: 0;
    overflow: hidden;
    opacity: 0;
}


/* ============================================================
   5. КОМПОНЕНТЫ
   ============================================================ */

/* ---------- Карточка ---------- */
.card {
    background: var(--bg);
    border-radius: var(--r);
    padding: var(--pad);
    height: 100%;
}
.card--white  { background: #fff; }
.card--accent { background: #fff; border: 2px solid var(--accent); }
.card--tariff {
    display: flex;
    flex-direction: column;
    position: relative;
}
.card__icon {
    font-size: 36px;
    margin-bottom: 16px;
    line-height: 1;
}

/* ---------- Карточка с картинкой ---------- */
.card--media {
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.card--media h3,
.card--media p,
.card--media .badge {
    margin-left: var(--pad);
    margin-right: var(--pad);
}
.card--media h3 { margin-top: 20px; }
.card--media p  { margin-bottom: var(--pad); }

.card__media {
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
}
.card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ---------- Блок «картинка + текст» ---------- */
.feature {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}
.feature__media img {
    width: 100%;
    height: auto;
    border-radius: var(--r);
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
}
.feature__body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

/* ---------- Кнопка ---------- */
.btn {
    display: inline-block;
    padding: 16px 32px;
    border-radius: var(--r-pill);
    font-weight: 600;
    font-size: 16px;
    text-decoration: none;
    border: 2px solid transparent;
    cursor: pointer;
    text-align: center;
    background: transparent;
    color: var(--accent);
}
.btn--primary { background: var(--accent); color: #fff; }
.btn--ghost   { border-color: #ddd; }
.btn--outline { border-color: var(--accent); }
.btn--block   { width: 100%; }
.btn--sm      { padding: 12px 24px; font-size: 14px; }

.btn:focus,
.burger:focus,
.slider__btn:focus,
.gallery__item:focus,
.faq__q:focus,
.nav a:focus {
    outline: none;
}
.btn:focus-visible,
.burger:focus-visible,
.slider__btn:focus-visible,
.gallery__item:focus-visible,
.faq__q:focus-visible,
.nav a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ---------- Бейдж ---------- */
.badge {
    display: inline-block;
    background: var(--bg-muted);
    padding: 8px 16px;
    border-radius: var(--r-pill);
    font-size: 14px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 20px;
}
.badge--dark {
    background: var(--accent);
    color: #fff;
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
}
.badge--inline {
    position: static;
    transform: none;
    display: inline-block;
    margin-bottom: 20px;
}

/* ---------- Статистика ---------- */
.stats {
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
    width: 100%;
}
.stat  { display: flex; flex-direction: column; }
.stat b     { font-size: 28px; font-weight: 800; color: var(--accent); }
.stat span  { font-size: 14px; color: var(--muted-2); }

/* ---------- Список ---------- */
.list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 28px;
    flex: 1;
}
.list li {
    color: var(--muted);
    font-size: 15px;
    line-height: 1.6;
    padding-left: 20px;
    position: relative;
}
.list li::before {
    content: "✓";
    color: #4CAF50;
    font-weight: 800;
    position: absolute;
    left: 0;
}

/* ---------- Цена ---------- */
.price {
    font-size: 36px;
    font-weight: 800;
    color: var(--accent);
    margin-bottom: 24px;
}

/* ---------- Шаг ---------- */
.step { text-align: center; }
.step__circle {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 800;
    margin: 0 auto 20px;
}
.step p { color: var(--muted); font-size: 15px; }

/* ---------- Отзыв ---------- */
.stars { color: #ffd700; font-size: 20px; margin-bottom: 16px; }

.author { display: flex; align-items: center; gap: 12px; }
.author__avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--muted);
    flex-shrink: 0;
}
.author strong { display: block; font-size: 15px; }
.author span   { font-size: 13px; color: var(--muted-2); }

/* ---------- Форма ---------- */
.form { display: flex; flex-direction: column; gap: 16px; }

.field {
    width: 100%;
    padding: 16px 20px;
    border-radius: var(--r);
    border: 1px solid #e0e0e0;
    font-size: 16px;
    font-family: inherit;
    outline: none;
    background: #fff;
}
.field:focus { border-color: var(--accent); }

.checkbox {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 14px;
    color: var(--muted);
    line-height: 1.4;
    cursor: pointer;
    margin: 8px 0;
}
.checkbox input {
    margin-top: 4px;
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    flex-shrink: 0;
}

/* ---------- Контакты ---------- */
.contacts {
    list-style: none;
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.contacts li {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--muted);
    font-size: 16px;
}
.contacts a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}


/* ============================================================
   6. СЕКЦИИ
   ============================================================ */

/* ---------- Шапка ---------- */
.header {
    position: sticky;
    top: 0;
    background: #fff;
    border-bottom: 1px solid var(--line);
    z-index: 1000;
    padding: 16px 0;
}
.header__inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.logo {
    font-size: 28px;
    font-weight: 800;
    color: var(--accent);
    text-decoration: none;
    position: relative;
    z-index: 1002;
}
.logo span { color: #aaa; }
.logo--footer { color: #fff; }

.nav { display: flex; gap: 28px; align-items: center; }
.nav a {
    color: var(--muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
}
.nav a.btn--primary { color: #fff; }

.burger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1002;
    position: relative;
}
.burger span {
    width: 24px;
    height: 2px;
    background: var(--accent);
    display: block;
}
.burger.is-active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.burger.is-active span:nth-child(2) { opacity: 0; }
.burger.is-active span:nth-child(3) { transform: rotate(-45deg) translate(7px, -7px); }

.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.overlay.is-active { opacity: 1; visibility: visible; pointer-events: auto; }

/* ---------- Hero ---------- */
.hero { background: var(--bg-soft); padding: 0; overflow: hidden; }
.hero__inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    padding: 60px 20px;
    max-width: var(--max);
    margin: 0 auto;
}
.hero__content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

/* ---------- Слайдер ---------- */
.slider {
    position: relative;
    overflow: hidden;
    border-radius: var(--r);
    width: 100%;
}
.slider__track {
    display: flex;
    transition: transform 0.4s ease;
    width: 100%;
}
.slider__slide {
    min-width: 100%;
    width: 100%;
    flex-shrink: 0;
}
.slider__slide img {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: var(--r);
    display: block;
}

.slider__btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.6);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    opacity: 0.5;
    font-size: 14px;
    color: #333;
}
.slider__btn--prev { left: 10px; }
.slider__btn--next { right: 10px; }

.slider__dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}
.slider__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ddd;
    border: none;
    cursor: pointer;
    padding: 0;
}
.slider__dot.is-active { background: var(--accent); width: 24px; border-radius: 4px; }

/* ---------- Галерея ---------- */
.gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--gap);
}
.gallery__item {
    border: none;
    padding: 0;
    background: none;
    cursor: pointer;
    border-radius: var(--r);
    overflow: hidden;
    display: block;
    position: relative;
    text-align: left;
    font-family: inherit;
}
.gallery__item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
}
.gallery__caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    padding: 10px;
}

/* ---------- FAQ ---------- */
.faq { max-width: 800px; margin: 0 auto; }
.faq__item { border-bottom: 1px solid #e0e0e0; }
.faq__q {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    font-weight: 600;
    color: var(--accent);
    text-align: left;
}
.faq__icon {
    font-size: 24px;
    transition: transform 0.3s;
    flex-shrink: 0;
    margin-left: 16px;
}
.faq__item.is-open .faq__icon { transform: rotate(45deg); }

.faq__a {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s;
}
.faq__item.is-open .faq__a {
    max-height: 300px;
    padding: 0 0 20px;
}
.faq__a p { color: var(--muted); font-size: 16px; }

/* ---------- Контакты ---------- */
.contact {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: start;
}

/* ---------- Подвал ---------- */
.footer {
    background: var(--accent);
    color: #fff;
    padding: 40px 0;
}
.footer__inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}
.footer__links { display: flex; gap: 20px; }
.footer__social { display: flex; gap: 16px; }
.footer__social a {
    color: #fff;
    text-decoration: none;
    font-size: 22px;
}


/* ============================================================
   7. МОДАЛЬНЫЕ ОКНА
   ============================================================ */

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}
.lightbox.is-open { display: flex; }
.lightbox__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    cursor: pointer;
}
.lightbox__content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
}
.lightbox__content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
}
.lightbox__close,
.lightbox__nav {
    position: absolute;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.lightbox__close {
    top: -40px;
    right: -40px;
    width: 40px;
    height: 40px;
    font-size: 18px;
}
.lightbox__nav {
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    font-size: 20px;
}
.lightbox__nav--prev { left: 20px; }
.lightbox__nav--next { right: 20px; }
.lightbox__caption {
    position: absolute;
    bottom: -40px;
    left: 0;
    right: 0;
    text-align: center;
    color: #fff;
    font-size: 14px;
    opacity: 0.8;
}

.cookie {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    border-radius: var(--r);
    z-index: 999;
    display: none;
    max-width: 600px;
    width: calc(100% - 40px);
}
.cookie.is-open { display: block; }
.cookie__inner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    flex-wrap: wrap;
}
.cookie__icon { font-size: 32px; flex-shrink: 0; }
.cookie__text {
    flex: 1;
    min-width: 200px;
    color: var(--muted);
    font-size: 14px;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 1003;
    display: none;
    align-items: center;
    justify-content: center;
}
.modal.is-open { display: flex; }
.modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    cursor: pointer;
}
.modal__content {
    position: relative;
    background: #fff;
    border-radius: var(--r);
    padding: 40px;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 1004;
    margin: 20px;
}
.modal__close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--bg-muted);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    color: var(--muted);
}
.modal__content h2 { font-size: 28px; margin-bottom: 24px; padding-right: 40px; }
.modal__content h3 { font-size: 18px; margin-top: 24px; margin-bottom: 12px; }
.modal__content p  { color: var(--muted); font-size: 14px; margin-bottom: 12px; }
.modal__content .list li { font-size: 14px; }


/* ============================================================
   8. АДАПТИВ
   ============================================================ */

@media (max-width: 768px) {
    :root {
        --section: 50px 0;
        --pad: 24px;
    }

    h1 { font-size: 34px; }
    h2 { font-size: 28px; }

    /* Мобильное меню */
    .nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100vh;
        background: #fff;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 20px;
        z-index: 999;
        padding: 80px 20px;
        visibility: hidden;
        transition: right 0.25s ease-out;
    }
    .nav.is-open { right: 0; visibility: visible; }
    .nav a { font-size: 22px; font-weight: 600; color: var(--accent); }
    .nav a.btn--primary { color: #fff; }
    .nav .btn { font-size: 20px; padding: 16px 32px; }

    .burger { display: flex; }

    /* Hero */
    .hero__inner {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 0 16px 30px;
    }
    .hero__content {
        padding: 20px 4px 0;
        align-items: stretch;
    }
    .hero__content .row {
        flex-direction: column;
        align-items: stretch;
    }
    .hero__content .btn {
        width: 100%;
    }

    /* Слайдер — квадратный */
    .slider {
        border-radius: var(--r);
        width: 100%;
    }
    .slider__track { align-items: stretch; }
    .slider__slide {
        min-width: 100%;
        width: 100%;
        flex-shrink: 0;
        display: flex;
    }
    .slider__slide img {
        width: 100%;
        height: auto;
        aspect-ratio: 1 / 1;
        object-fit: cover;
        border-radius: var(--r);
        display: block;
    }

    .stats {
        gap: 20px;
        justify-content: center;
        text-align: center;
        width: 100%;
    }
    .stat { align-items: center; }

    .contact { grid-template-columns: 1fr; gap: 40px; }

    /* ---------- Галерея на телефоне: горизонтальный слайдер ---------- */
    .gallery {
        display: flex;
        flex-wrap: nowrap;
        gap: 12px;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding: 0 16px 16px;
        margin: 0 -16px;
    }
    .gallery::-webkit-scrollbar {
        display: none;
    }
    .gallery__item {
        flex: 0 0 80%;
        scroll-snap-align: center;
        border-radius: var(--r);
        overflow: hidden;
    }
    .gallery__item img {
        height: 320px;
        object-fit: cover;
    }

    /* Блок «картинка + текст» — в одну колонку, текст сверху, картинка снизу */
    .feature {
        display: flex;
        flex-direction: column;
        gap: 30px;
    }
    .feature__body {
        order: 1;
        align-items: stretch;
    }
    .feature__media {
        order: 2;
    }
    .feature__body .btn {
        width: 100%;
    }

    /* Картинка в блоке — квадратная */
    .feature__media img {
        aspect-ratio: 1 / 1;
        border-radius: var(--r);
        width: 100%;
        object-fit: cover;
    }

    /* Карточки с картинками — квадратные */
    .card__media {
        aspect-ratio: 1 / 1;
    }

    /* Кнопки слайдера */
    .slider__btn { width: 32px; height: 32px; font-size: 12px; opacity: 0.4; }
    .slider__btn--prev { left: 6px; }
    .slider__btn--next { right: 6px; }

    /* Лайтбокс */
    .lightbox__close { top: 10px; right: 10px; }
    .lightbox__nav { width: 40px; height: 40px; font-size: 16px; }
    .lightbox__nav--prev { left: 10px; }
    .lightbox__nav--next { right: 10px; }

    /* Cookie */
    .cookie { bottom: 10px; width: calc(100% - 20px); }
    .cookie__inner { flex-direction: column; text-align: center; gap: 12px; }

    /* Модалка */
    .modal__content { padding: 24px; margin: 10px; max-height: 90vh; }

    /* Подвал */
    .footer__inner { flex-direction: column; text-align: center; }
    .footer__links { flex-direction: column; gap: 10px; }
}

@media (max-width: 480px) {
    .row { flex-direction: column; align-items: stretch; }
    .btn { width: 100%; }
    .grid--2, .grid--3 { grid-template-columns: 1fr; }
    .cookie .btn { width: 100%; }

    .hero__inner {
        padding: 0 12px 24px;
        gap: 24px;
    }
    .hero__content {
        padding: 12px 0 0;
        align-items: stretch;
    }
    .hero__content .row {
        flex-direction: column;
        align-items: stretch;
    }
    .hero__content .btn {
        width: 100%;
    }

    .stats {
        justify-content: space-around;
        text-align: center;
    }

    .slider__slide img {
        width: 100%;
        aspect-ratio: 1 / 1;
        object-fit: cover;
        border-radius: var(--r);
    }

    /* Картинка в блоке «О шаблоне» — тоже квадратная */
    .feature__media img {
        aspect-ratio: 1 / 1;
        object-fit: cover;
    }

    /* Галерея: карточка чуть шире */
    .gallery__item {
        flex: 0 0 85%;
    }
    .gallery__item img {
        height: 280px;
    }
}