/* ==========================================================================
   Apex House — собственные стили темы.

   Написаны заново, вместо стилей конструктора. Значения не выдуманы:
   цвета, шрифты, размеры и отступы сняты замерами с исходного сайта
   (extract_design.py), поэтому внешний вид совпадает, а код наш.
   ========================================================================== */

:root {
    --apx-accent:        #fa7137;
    --apx-accent-dark:   #f15c2e;
    --apx-accent-light:  #ff714d;
    --apx-text:          #060607;
    --apx-text-muted:    #6b6b70;
    --apx-line:          #e4e6e8;
    --apx-bg:            #ffffff;
    --apx-bg-soft:       #f8f8f8;
    --apx-bg-sky:        #ecf5f9;

    --apx-font:          Roboto, 'Helvetica Neue', Arial, sans-serif;
    --apx-font-display:  Oswald, Roboto, Arial, sans-serif;

    --apx-radius:        7px;
    --apx-radius-lg:     10px;
    --apx-radius-card:   20px;

    --apx-container:     1390px;
    --apx-content:       1150px;
    --apx-gap:           30px;
    --apx-section-pad:   70px;
}

/* --- база --- */

*, *::before, *::after { box-sizing: border-box; }

body.apx {
    margin: 0;
    font-family: var(--apx-font);
    font-size: 16px;
    line-height: 1.45;
    color: var(--apx-text);
    background: var(--apx-bg);
    -webkit-font-smoothing: antialiased;
}

.apx img { max-width: 100%; height: auto; display: block; }
.apx a { color: inherit; text-decoration: none; }
.apx a:hover { color: var(--apx-accent); }

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

.apx-content { max-width: var(--apx-content); margin: 0 auto; }

.apx-section { padding: var(--apx-section-pad) 0; }
.apx-section--tight { padding: 40px 0; }
.apx-section--soft { background: var(--apx-bg-soft); }
.apx-section--sky { background: var(--apx-bg-sky); }

/* --- типографика --- */

.apx h1, .apx h2, .apx h3, .apx h4 { margin: 0 0 18px; font-weight: 700; line-height: 1.15; }

.apx-h1 { font-size: 40px; font-weight: 700; }
.apx-h2 { font-size: 48px; font-weight: 700; text-align: center; }
.apx-h3 { font-size: 22px; font-weight: 400; }
.apx-lead { font-size: 18px; }
.apx-small { font-size: 14px; color: var(--apx-text-muted); }
.apx-accent { color: var(--apx-accent); }
.apx-center { text-align: center; }

/* --- кнопки --- */

.apx-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 18px 30px;
    border: 0;
    border-radius: var(--apx-radius);
    background: var(--apx-accent);
    color: #fff;
    font: inherit;
    font-size: 16px;
    line-height: 1.25;
    text-align: center;
    cursor: pointer;
    transition: background .2s ease, transform .12s ease;
}

.apx-btn:hover { background: var(--apx-accent-dark); color: #fff; }
.apx-btn:active { transform: translateY(1px); }
.apx-btn--lg { padding: 20px 34px; border-radius: var(--apx-radius-lg); font-size: 17px; font-weight: 500; }
.apx-btn--sm { padding: 12px 22px; font-size: 15px; font-weight: 700; }
.apx-btn--ghost { background: transparent; color: var(--apx-accent); box-shadow: inset 0 0 0 1px currentColor; }
.apx-btn--ghost:hover { background: var(--apx-accent); color: #fff; box-shadow: none; }

/* --- шапка --- */

.apx-header {
    position: sticky;
    top: 0;
    z-index: 60;
    background: #fff;
    border-bottom: 1px solid var(--apx-line);
}

.apx-header__top {
    display: flex;
    align-items: center;
    gap: 26px;
    padding: 14px 0;
}

.apx-header__logo img { width: 210px; }
.apx-header__slogan { font-size: 13px; line-height: 1.3; color: var(--apx-text-muted); max-width: 190px; }
.apx-header__contacts { margin-left: auto; text-align: right; }
.apx-header__phone { font-size: 19px; font-weight: 700; white-space: nowrap; }
.apx-header__work { font-size: 12px; color: var(--apx-accent); }
.apx-header__socials { display: flex; gap: 8px; align-items: center; }
.apx-header__socials a { display: block; width: 26px; height: 26px; }

.apx-nav { border-top: 1px solid var(--apx-line); }
.apx-nav ul { display: flex; flex-wrap: wrap; gap: 26px; margin: 0; padding: 11px 0; list-style: none; }
.apx-nav a { font-size: 14px; }

.apx-burger { display: none; width: 42px; height: 42px; border: 0; background: none; cursor: pointer; }
.apx-burger span { display: block; height: 2px; margin: 5px 0; background: var(--apx-text); }

/* --- первый экран --- */

.apx-hero { position: relative; background: var(--apx-bg-sky); overflow: hidden; }
.apx-hero__grid { display: grid; grid-template-columns: 1.05fr 1fr; align-items: center; gap: 30px; padding: 46px 0 30px; }
.apx-hero__kicker { font-size: 16px; margin-bottom: 12px; }
.apx-hero__title { font-size: 40px; font-weight: 700; line-height: 1.16; margin: 0 0 14px; }
.apx-hero__sub { font-size: 22px; color: var(--apx-accent); font-weight: 700; margin-bottom: 14px; }
.apx-hero__note { font-size: 15px; margin-bottom: 24px; }
.apx-hero__img img { width: 100%; }

.apx-usp { display: grid; grid-template-columns: repeat(4, 1fr); gap: 26px; padding: 24px 0 40px; }
.apx-usp__item { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; line-height: 1.35; }
.apx-usp__item img { width: 38px; flex: 0 0 38px; }

/* --- сетка карточек --- */

.apx-grid { display: grid; gap: var(--apx-gap); }
.apx-grid--2 { grid-template-columns: repeat(2, 1fr); }
.apx-grid--3 { grid-template-columns: repeat(3, 1fr); }
.apx-grid--4 { grid-template-columns: repeat(4, 1fr); }

.apx-card {
    background: #fff;
    border-radius: var(--apx-radius-card);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* --- каталог проектов --- */

.apx-tabs { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-bottom: 34px; }

.apx-tab {
    padding: 12px 26px;
    border: 1px solid var(--apx-line);
    border-radius: 40px;
    background: #fff;
    font: inherit;
    font-size: 16px;
    cursor: pointer;
    transition: all .18s ease;
}

.apx-tab:hover { border-color: var(--apx-accent); }
.apx-tab.is-active { background: var(--apx-accent); border-color: var(--apx-accent); color: #fff; }

.apx-projects__panel { display: none; }
.apx-projects__panel.is-active { display: block; }

.apx-project__media { position: relative; aspect-ratio: 4 / 3; background: var(--apx-bg-soft); }
.apx-project__media img { width: 100%; height: 100%; object-fit: cover; }
.apx-project__body { padding: 18px 20px 22px; display: flex; flex-direction: column; flex: 1; }
.apx-project__title { font-size: 20px; font-weight: 700; margin: 0 0 10px; }
.apx-project__specs { margin: 0 0 14px; padding-left: 18px; font-size: 15px; line-height: 1.5; }
.apx-project__price { font-size: 19px; font-weight: 700; margin-top: auto; }
.apx-project__mortgage { font-size: 14px; color: var(--apx-text-muted); margin: 4px 0 16px; }

/* --- раскрывающиеся блоки (описание проекта, вопрос-ответ) --- */

.apx-spoiler { border-top: 1px solid var(--apx-line); }
.apx-spoiler:last-child { border-bottom: 1px solid var(--apx-line); }

.apx-spoiler__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    padding: 16px 0;
    border: 0;
    background: none;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.apx-spoiler__head::after {
    content: '';
    flex: 0 0 10px;
    width: 10px;
    height: 10px;
    border-right: 2px solid var(--apx-text);
    border-bottom: 2px solid var(--apx-text);
    transform: rotate(45deg);
    transition: transform .2s ease;
}

.apx-spoiler.is-open .apx-spoiler__head::after { transform: rotate(-135deg); }
.apx-spoiler__body { display: none; padding: 0 0 18px; font-size: 15px; line-height: 1.6; }
.apx-spoiler.is-open .apx-spoiler__body { display: block; }

/* --- квиз --- */

.apx-quiz { background: #fff; border-radius: var(--apx-radius-card); padding: 34px 30px; }
.apx-quiz__progress { height: 4px; background: var(--apx-line); border-radius: 4px; margin-bottom: 26px; }
.apx-quiz__bar { height: 100%; width: 0; background: var(--apx-accent); border-radius: 4px; transition: width .3s ease; }
.apx-quiz__step { display: none; }
.apx-quiz__step.is-active { display: block; }
.apx-quiz__question { font-size: 22px; font-weight: 700; margin-bottom: 22px; }
.apx-quiz__options { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 26px; }

.apx-quiz__option {
    border: 1px solid var(--apx-line);
    border-radius: var(--apx-radius-lg);
    padding: 14px;
    cursor: pointer;
    transition: border-color .18s ease, box-shadow .18s ease;
}

.apx-quiz__option:hover { border-color: var(--apx-accent); }
.apx-quiz__option.is-picked { border-color: var(--apx-accent); box-shadow: 0 0 0 1px var(--apx-accent); }
.apx-quiz__option input { position: absolute; opacity: 0; pointer-events: none; }
.apx-quiz__option img { border-radius: 6px; margin-bottom: 10px; }
.apx-quiz__option span { font-size: 15px; }
.apx-quiz__nav { display: flex; align-items: center; gap: 14px; }
.apx-quiz__hint { font-size: 13px; color: var(--apx-text-muted); }

/* --- этапы --- */

.apx-stage { display: grid; grid-template-columns: 64px 1fr; gap: 18px; align-items: start; }
.apx-stage__num {
    width: 64px; height: 64px; border-radius: 50%;
    background: var(--apx-accent); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; font-weight: 700;
}
.apx-stage__title { font-size: 19px; font-weight: 700; margin: 0 0 8px; }

/* --- галерея и видео --- */

.apx-gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.apx-gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--apx-radius-lg); }
.apx-video { position: relative; aspect-ratio: 16 / 9; border-radius: var(--apx-radius-lg); overflow: hidden; background: #000; }
.apx-video iframe, .apx-video video { width: 100%; height: 100%; border: 0; }

/* --- цифры --- */

.apx-facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; text-align: center; }
.apx-fact__value { font-family: var(--apx-font-display); font-size: 42px; font-weight: 700; color: var(--apx-accent); }
.apx-fact__label { font-size: 15px; }

/* --- формы --- */

.apx-form { display: grid; gap: 14px; }
.apx-form__row { display: grid; gap: 14px; }
.apx-form input[type="text"], .apx-form input[type="tel"], .apx-form input[type="email"], .apx-form textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--apx-line);
    border-radius: var(--apx-radius);
    font: inherit;
    font-size: 16px;
    background: #fff;
}
.apx-form input:focus, .apx-form textarea:focus { outline: none; border-color: var(--apx-accent); }
.apx-form__error { color: #d23c22; font-size: 14px; display: none; }
.apx-form.has-error .apx-form__error { display: block; }
.apx-form__note { font-size: 12px; color: var(--apx-text-muted); }

/* --- модальные окна --- */

.apx-modal { position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center; padding: 20px; }
.apx-modal.is-open { display: flex; }
.apx-modal__overlay { position: absolute; inset: 0; background: rgba(6, 6, 7, .55); }
.apx-modal__box { position: relative; width: 100%; max-width: 480px; background: #fff; border-radius: var(--apx-radius-card); padding: 32px 28px; }
.apx-modal__close { position: absolute; top: 12px; right: 14px; border: 0; background: none; font-size: 26px; line-height: 1; cursor: pointer; color: var(--apx-text-muted); }

/* --- слайдер --- */

.apx-slider { position: relative; }
.apx-slider .swiper-button-prev, .apx-slider .swiper-button-next {
    width: 38px; height: 38px; border-radius: 50%;
    background: rgba(255, 255, 255, .85);
    color: var(--apx-text);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
}
.apx-slider .swiper-button-prev::after, .apx-slider .swiper-button-next::after { font-size: 14px; font-weight: 700; }

/* --- подвал --- */

.apx-footer { padding: 40px 0; background: var(--apx-bg-soft); font-size: 14px; }
.apx-footer__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }

/* --- адаптив --- */

@media (max-width: 1100px) {
    .apx-usp, .apx-gallery, .apx-facts, .apx-quiz__options { grid-template-columns: repeat(2, 1fr); }
    .apx-grid--4 { grid-template-columns: repeat(2, 1fr); }
    .apx-grid--3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
    :root { --apx-section-pad: 44px; --apx-gap: 18px; }
    .apx-h2 { font-size: 30px; }
    .apx-hero__title { font-size: 27px; }
    .apx-hero__sub { font-size: 19px; }
    .apx-hero__grid { grid-template-columns: 1fr; padding-top: 26px; }
    .apx-hero__img { order: -1; }
    .apx-nav { display: none; }
    .apx-nav.is-open { display: block; }
    .apx-nav ul { flex-direction: column; gap: 0; }
    .apx-nav li { border-bottom: 1px solid var(--apx-line); }
    .apx-nav a { display: block; padding: 12px 0; }
    .apx-burger { display: block; }
    .apx-header__slogan { display: none; }
    .apx-grid--2, .apx-grid--3, .apx-grid--4,
    .apx-usp, .apx-gallery, .apx-facts, .apx-quiz__options,
    .apx-footer__grid { grid-template-columns: 1fr; }
    .apx-quiz { padding: 22px 16px; }
    .apx-quiz__question { font-size: 19px; }
    .apx-stage { grid-template-columns: 48px 1fr; }
    .apx-stage__num { width: 48px; height: 48px; font-size: 18px; }
}
