﻿:root {
    --bg: #eef2f6;
    --text: #111111;
    --muted: #6b7280;
    --line: rgba(20, 20, 20, 0.08);
    --glass-light: rgba(255, 255, 255, 0.72);
    --glass-strong: rgba(255, 255, 255, 0.84);
    --glass-dark: rgba(18, 22, 28, 0.72);
    --stroke-light: rgba(255, 255, 255, 0.55);
    --stroke-dark: rgba(255, 255, 255, 0.10);
    --primary: #1f6fff;
    --shadow-soft: 0 8px 30px rgba(15, 23, 42, 0.08);
    --shadow-medium: 0 16px 40px rgba(15, 23, 42, 0.12);
    --radius-xl: 26px;
    --radius-lg: 20px;
    --radius-md: 16px;
    --container: 1280px;
    --header-height: 98px;
    --header-height-scrolled: 72px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

    body.apple-glass-body {
        font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
        color: var(--text);
        background: radial-gradient(circle at top left, rgba(255,255,255,0.95), rgba(241,244,247,1) 45%, rgba(232,236,241,1) 100%);
    }

    body.menu-open {
        overflow: hidden;
    }

a {
    text-decoration: none;
    color: inherit;
    transition: 0.25s ease;
}

button {
    font: inherit;
}

.container {
    width: min(var(--container), calc(100% - 48px));
    margin: 0 auto;
}

.glass-panel {
    background: var(--glass-light);
    border: 1px solid var(--stroke-light);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    box-shadow: var(--shadow-soft);
    border-radius: var(--radius-xl);
}

.glass-panel--dark {
    background: var(--glass-dark);
    border-color: var(--stroke-dark);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.26);
}

/* HEADER */

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding-top: 18px;
    transition: 0.3s ease;
}

.header-shell {
    min-height: var(--header-height);
    display: grid;
    grid-template-columns: 260px 1fr auto;
    align-items: center;
    gap: 24px;
    padding: 0 24px;
    transition: 0.3s ease;
}

.site-header.is-scrolled {
    padding-top: 10px;
}

    .site-header.is-scrolled .header-shell {
        min-height: var(--header-height-scrolled);
        background: rgba(255, 255, 255, 0.78);
        box-shadow: var(--shadow-medium);
        border-radius: 22px;
        grid-template-columns: 220px 1fr 0;
    }

.header-left {
    display: flex;
    align-items: center;
    gap: 18px;
}

.burger-btn {
    width: 44px;
    height: 44px;
    border: none;
    background: transparent;
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    border-radius: 12px;
}

    .burger-btn span {
        display: block;
        width: 18px;
        height: 1.8px;
        background: #2a2a2a;
        border-radius: 20px;
    }

.header-logo {
    display: inline-flex;
    align-items: center;
}

    .header-logo img {
        height: 81px;
        width: auto;
        display: block;
        transition: 0.3s ease;
    }

.site-header.is-scrolled .header-logo img {
    height: 40px;
}

.header-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 52px;
    min-width: 0;
}

    .header-nav a {
        position: relative;
        font-size: 15px;
        font-weight: 600;
        color: #1b1b1b;
    }

        .header-nav a.active,
        .header-nav a:hover {
            color: var(--primary);
        }

.site-header.is-scrolled .header-nav {
    justify-content: space-evenly;
    width: 100%;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 14px;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    overflow: hidden;
}

.site-header.is-scrolled .header-right {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-8px);
    width: 0;
}

.header-phone {
    white-space: nowrap;
    font-size: 17px;
    font-weight: 700;
    color: #111827;
}

.icon-search-btn {
    width: 42px;
    height: 42px;
    border: none;
    background: transparent;
    border-radius: 50%;
    color: #9ca3af;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

    .icon-search-btn svg {
        width: 20px;
        height: 20px;
    }

.glass-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 22px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.44);
    background: rgba(255,255,255,0.52);
    color: #171717;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

    .glass-button:hover {
        transform: translateY(-1px);
    }

.glass-button--primary {
    background: linear-gradient(180deg, rgba(41,124,255,0.96), rgba(25,111,255,0.88));
    color: #fff;
    border-color: rgba(255,255,255,0.18);
}

/* spacing for fixed header */
.site-main {
    padding-top: 136px;
    min-height: 60vh;
}

/* FULLSCREEN MENU */

.fullscreen-menu {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(247, 247, 248, 0.94);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: 0.3s ease;
}

    .fullscreen-menu.is-open {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

.fullscreen-menu__inner {
    width: min(1200px, calc(100% - 80px));
    margin: 0 auto;
    padding: 28px 0 60px;
    min-height: 100vh;
}

.fullscreen-menu__top {
    display: grid;
    grid-template-columns: 60px 1fr 60px;
    align-items: center;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

.fullscreen-menu__logo {
    justify-self: center;
}

    .fullscreen-menu__logo img {
        height: 54px;
        display: block;
    }

.menu-close {
    position: relative;
    width: 38px;
    height: 38px;
    border: none;
    background: transparent;
    cursor: pointer;
}

    .menu-close span {
        position: absolute;
        top: 18px;
        left: 7px;
        width: 24px;
        height: 1.5px;
        background: #2d2d2d;
    }

        .menu-close span:first-child {
            transform: rotate(45deg);
        }

        .menu-close span:last-child {
            transform: rotate(-45deg);
        }

.fullscreen-menu__grid {
    display: grid;
    grid-template-columns: 0.9fr 1.2fr 1fr 1fr;
    gap: 56px;
    padding-top: 42px;
}

.menu-col h4 {
    margin: 0 0 18px;
    font-size: 28px;
    font-weight: 700;
    color: #171717;
}

.menu-col a,
.menu-address {
    display: block;
    margin-bottom: 12px;
    font-size: 17px;
    line-height: 1.45;
    color: #5c6470;
}

    .menu-col a:hover {
        color: #171717;
    }

.menu-main-link {
    font-size: 22px;
    font-weight: 700;
    color: #171717;
}

    .menu-main-link.active {
        color: var(--primary);
    }

.callback-modal {
    position: fixed;
    inset: 0;
    z-index: 2100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 24px;
    overflow-y: auto;
    background: rgba(10, 18, 34, 0.32);
    backdrop-filter: blur(16px) saturate(135%);
    -webkit-backdrop-filter: blur(16px) saturate(135%);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

    .callback-modal.is-open {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

.callback-modal__inner {
    width: min(1180px, calc(100% - 56px));
    min-height: auto;
    margin: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0;
}

.callback-modal__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.callback-modal__eyebrow {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.78);
}

.callback-modal__close span {
    background: rgba(255, 255, 255, 0.92);
}

.callback-modal__content {
    padding-top: 22px;
    width: 100%;
}

/* FOOTER */

.site-footer {
    margin-top: 64px;
}

.footer-bg {
    padding: 40px 0;
    background: radial-gradient(circle at top left, rgba(58, 67, 82, 0.56), rgba(15, 18, 24, 0.98) 58%);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.1fr 1.2fr 1fr 1fr;
    gap: 34px;
    padding: 34px;
}

.footer-col h4 {
    margin: 0 0 16px;
    color: #fff;
    font-size: 21px;
    font-weight: 700;
}

.footer-col a,
.footer-col span {
    display: block;
    margin-bottom: 11px;
    color: rgba(255,255,255,0.74);
    font-size: 15px;
    line-height: 1.5;
}

    .footer-col a:hover {
        color: #fff;
    }

.footer-col--contacts .glass-button {
    margin-top: 10px;
    width: fit-content;
}

@media (max-width: 1200px) {
    .header-shell {
        grid-template-columns: 1fr;
        justify-items: center;
        padding: 18px 20px;
    }

    .header-left,
    .header-right {
        width: 100%;
        justify-content: center;
    }

    .header-nav {
        flex-wrap: wrap;
        gap: 24px;
    }

    .fullscreen-menu__grid,
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .container {
        width: min(100%, calc(100% - 24px));
    }

    .site-main {
        padding-top: 120px;
    }

    .header-shell {
        gap: 14px;
    }

    .header-nav {
        gap: 16px;
    }

    .header-phone,
    .header-right .glass-button--primary {
        display: none;
    }

    .callback-modal__inner {
        width: min(100%, calc(100% - 24px));
        padding: 18px 0 24px;
    }

    .callback-modal__top {
        padding-bottom: 14px;
    }

    .fullscreen-menu__inner {
        width: min(100%, calc(100% - 32px));
    }

    .fullscreen-menu__grid,
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .menu-col h4 {
        font-size: 22px;
    }
}

/* RESPONSIVE FIX: compact header, no horizontal drift on phones/tablets */
html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

body.apple-glass-body {
    min-width: 320px;
}

img,
svg,
video,
canvas,
iframe {
    max-width: 100%;
}

.site-header,
.site-main,
.site-footer,
.fullscreen-menu,
.callback-modal {
    max-width: 100%;
}

.header-shell,
.header-left,
.header-nav,
.header-right,
.footer-grid,
.fullscreen-menu__grid,
.callback-modal__inner {
    min-width: 0;
}

.header-nav a,
.footer-col a,
.footer-col span,
.menu-col a,
.menu-address {
    overflow-wrap: anywhere;
}

.header-phone,
.footer-col--contacts a,
.footer-col--contacts span {
    white-space: normal;
    overflow-wrap: anywhere;
}

.fullscreen-menu {
    overflow-y: auto;
    overscroll-behavior: contain;
}

@media (max-width: 1200px) {
    .site-header {
        padding-top: 14px;
    }

    .header-shell,
    .site-header.is-scrolled .header-shell {
        min-height: 84px;
        grid-template-columns: auto minmax(0, 1fr);
        justify-items: stretch;
        align-items: center;
        gap: 18px;
        padding: 0 18px;
        border-radius: 24px;
    }

    .header-left,
    .site-header.is-scrolled .header-left {
        width: auto;
        min-width: 0;
        justify-content: flex-start;
    }

    .header-logo img {
        height: 58px;
        max-width: 96px;
    }

    .site-header.is-scrolled .header-logo img {
        height: 46px;
    }

    .header-nav,
    .site-header.is-scrolled .header-nav {
        width: auto;
        min-width: 0;
        justify-content: flex-end;
        flex-wrap: nowrap;
        gap: clamp(16px, 2.1vw, 28px);
    }

    .header-nav a {
        white-space: nowrap;
        font-size: 15px;
    }

    .header-right,
    .site-header.is-scrolled .header-right {
        display: none;
        width: 0;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }

    .site-main {
        padding-top: 120px;
    }
}

@media (max-width: 768px) {
    .container {
        width: min(100%, calc(100% - 28px));
    }

    .site-header {
        padding-top: max(10px, env(safe-area-inset-top));
    }

    .header-shell,
    .site-header.is-scrolled .header-shell {
        min-height: 76px;
        grid-template-columns: 1fr;
        gap: 0;
        padding: 0 14px;
        border-radius: 24px;
    }

    .header-left,
    .site-header.is-scrolled .header-left {
        display: grid;
        grid-template-columns: 44px minmax(0, 1fr) 44px;
        align-items: center;
        gap: 0;
        width: 100%;
    }

    .burger-btn {
        grid-column: 1;
        justify-self: start;
        width: 44px;
        height: 44px;
    }

    .header-logo {
        grid-column: 2;
        justify-self: center;
    }

    .header-logo img,
    .site-header.is-scrolled .header-logo img {
        height: 54px;
        max-width: 92px;
    }

    .header-nav,
    .site-header.is-scrolled .header-nav,
    .header-right,
    .site-header.is-scrolled .header-right {
        display: none;
    }

    .site-main {
        padding-top: 104px;
    }

    .fullscreen-menu__inner {
        width: min(100%, calc(100% - 28px));
        min-height: auto;
        padding: 14px 0 34px;
    }

    .fullscreen-menu__top {
        grid-template-columns: 44px minmax(0, 1fr) 44px;
        padding-bottom: 14px;
    }

    .fullscreen-menu__logo img {
        height: 48px;
    }

    .fullscreen-menu__grid,
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .fullscreen-menu__grid {
        gap: 18px;
        padding-top: 22px;
    }

    .menu-col {
        padding: 18px 20px;
        border-radius: 22px;
        background: rgba(255, 255, 255, 0.58);
        border: 1px solid rgba(255, 255, 255, 0.62);
    }

    .menu-col h4 {
        margin-bottom: 12px;
        font-size: 20px;
    }

    .menu-main-link {
        font-size: 23px;
    }

    .menu-col a,
    .menu-address {
        margin-bottom: 10px;
        font-size: 16px;
    }

    .site-footer {
        margin-top: 36px;
    }

    .footer-bg {
        padding: 28px 0;
    }

    .footer-grid {
        gap: 22px;
        padding: 24px;
        border-radius: 26px;
    }

    .footer-col h4 {
        font-size: 20px;
    }

    .footer-col--contacts .glass-button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .container {
        width: min(100%, calc(100% - 24px));
    }

    .header-shell,
    .site-header.is-scrolled .header-shell {
        min-height: 72px;
        padding-inline: 12px;
        border-radius: 22px;
    }

    .header-logo img,
    .site-header.is-scrolled .header-logo img {
        height: 50px;
    }

    .site-main {
        padding-top: 96px;
    }

    .footer-grid {
        padding: 22px;
    }
}

@media (max-width: 480px) {
    .glass-button {
        min-height: 50px;
        padding-inline: 18px;
        text-align: center;
    }
}

/* DESKTOP/TABLET HEADER HOTFIX: keep sticky header as one compact row after mobile patch */
@media (min-width: 769px) {
    .site-header .header-shell {
        overflow: hidden;
        grid-auto-rows: minmax(0, auto);
    }

    .site-header.is-scrolled .header-shell {
        min-height: var(--header-height-scrolled) !important;
        height: var(--header-height-scrolled) !important;
        max-height: var(--header-height-scrolled) !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        align-items: center !important;
        grid-template-rows: 1fr !important;
    }

    .site-header.is-scrolled .header-left,
    .site-header.is-scrolled .header-nav {
        height: var(--header-height-scrolled) !important;
        align-self: center !important;
        grid-row: 1 !important;
    }

    .site-header.is-scrolled .header-nav {
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        justify-content: space-evenly !important;
        width: 100% !important;
    }

    .site-header.is-scrolled .header-right {
        display: none !important;
    }
}

@media (min-width: 769px) and (max-width: 1200px) {
    .site-header .header-shell,
    .site-header.is-scrolled .header-shell {
        display: grid !important;
        grid-template-columns: auto minmax(0, 1fr) !important;
        grid-template-rows: 1fr !important;
        gap: clamp(18px, 3vw, 36px) !important;
        justify-items: stretch !important;
        align-items: center !important;
    }

    .site-header .header-shell {
        min-height: 84px !important;
        height: 84px !important;
        max-height: 84px !important;
        padding: 0 22px !important;
    }

    .site-header.is-scrolled .header-shell {
        min-height: 72px !important;
        height: 72px !important;
        max-height: 72px !important;
        padding: 0 22px !important;
    }

    .site-header .header-left,
    .site-header.is-scrolled .header-left {
        grid-column: 1 !important;
        grid-row: 1 !important;
        width: auto !important;
        min-width: 0 !important;
        justify-content: flex-start !important;
    }

    .site-header .header-nav,
    .site-header.is-scrolled .header-nav {
        grid-column: 2 !important;
        grid-row: 1 !important;
        display: flex !important;
        width: 100% !important;
        min-width: 0 !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        justify-content: space-evenly !important;
        gap: clamp(18px, 4vw, 54px) !important;
    }

    .site-header .header-nav a,
    .site-header.is-scrolled .header-nav a {
        white-space: nowrap !important;
    }

    .site-header .header-right,
    .site-header.is-scrolled .header-right {
        display: none !important;
        width: 0 !important;
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }

    .site-header .header-logo img {
        height: 58px !important;
        max-height: 58px !important;
    }

    .site-header.is-scrolled .header-logo img {
        height: 42px !important;
        max-height: 42px !important;
    }
}
