:root {
    --primary: #27ae60;
    --primary-hover: #219653;
    --purple: #5a32fb;
    
    --bg: #ffffff;
    --bg-gray: #f6f7f8;
    --bg-card: #ffffff;
    --text: #333333;
    --text-muted: #666666;
    --border: #eaecee;
    --blue: #428bf9;
    --radius: 24px;
    --radius-sm: 12px;
    --container: 1440px; 
    
    --shadow-card: 0 8px 30px rgba(0,0,0,.04);
    --shadow-hover: 0 16px 40px rgba(0,0,0,.08);
    --shadow-dropdown: 0 12px 40px rgba(0,0,0,.12);
    --shadow-btn: 0 4px 12px rgba(39, 174, 96, 0.3);
}

[data-theme="dark"] {
    --bg: #0f0f0f;
    --bg-gray: #1a1a1a;
    --bg-card: #1c1c1e;
    --text: #f0f0f0;
    --text-muted: #a0a0a0;
    --border: #2a2a2e;
    --blue: #5a9bff;
    --shadow-card: 0 8px 30px rgba(0,0,0,.4);
    --shadow-hover: 0 16px 40px rgba(0,0,0,.6);
    --shadow-dropdown: 0 12px 40px rgba(0,0,0,.6);
    --shadow-btn: 0 4px 12px rgba(39, 174, 96, 0.15);
}

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

html, body { 
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden; 
    margin: 0; 
    padding: 0;
}

html { scroll-behavior: smooth; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.3s ease, color 0.3s ease;
}
img, svg { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 40px;
    position: relative;
    z-index: 2; /* Контент всегда выше фона */
}

/* ============ HEADER ============ */
.header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0,0,0,0.02);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}
[data-theme="dark"] .header {
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 88px;
    gap: 24px;
}
.logo { display: flex; align-items: center; gap: 10px; }
.logo img { height: 38px; width: auto; }
[data-theme="dark"] .logo img { filter: brightness(0) invert(1); }
.logo-text-fallback {
    display: none; align-items: center; gap: 8px;
    font-weight: 800; font-size: 20px; letter-spacing: -.03em;
    color: var(--text);
}

.menu-toggle {
    display: none;
    background: none; border: none; color: var(--text);
    font-size: 24px; cursor: pointer; padding: 0;
}

.nav { display: flex; gap: 8px; align-items: center; }
.nav > a, .nav-dropdown > a {
    font-size: 16px; 
    font-weight: 600; 
    color: var(--text);
    transition: all .2s ease; 
    display: flex; align-items: center;
    gap: 6px; cursor: pointer;
    padding: 10px 18px; 
    border-radius: var(--radius-sm);
}
.nav > a:hover, .nav-dropdown > a:hover { 
    color: var(--primary); 
    background: var(--bg-gray); 
}

.nav-dropdown { position: relative; }
.dropdown-menu {
    position: absolute; top: calc(100% + 8px); left: 0;
    background: var(--bg-card); min-width: 240px;
    box-shadow: var(--shadow-dropdown); border-radius: var(--radius-sm);
    padding: 12px; opacity: 0; visibility: hidden;
    transform: translateY(10px); transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border); z-index: 200;
}
.nav-dropdown:hover .dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-menu a {
    display: block; padding: 12px 16px; font-size: 16px; font-weight: 500;
    color: var(--text); transition: background .2s, color .2s;
    border-radius: 8px; margin-bottom: 4px;
}
.dropdown-menu a:last-child { margin-bottom: 0; }
.dropdown-menu a:hover { background: var(--bg-gray); color: var(--primary); }

.header-actions { display: flex; align-items: center; gap: 14px; }
.header-btn {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 12px 20px; font-size: 15px; font-weight: 600;
    border-radius: var(--radius-sm); transition: 0.2s; white-space: nowrap;
}
.header-btn-call { 
    background: var(--primary); 
    color: #fff; 
    box-shadow: var(--shadow-btn); 
}
.header-btn-call:hover { background: var(--primary-hover); transform: translateY(-2px); }
.header-btn-mail { background: transparent; color: var(--text); border: 1px solid var(--border); }
.header-btn-mail:hover { background: var(--bg-gray); transform: translateY(-2px); }

.theme-btn {
    width: 44px; height: 44px; border-radius: 50%;
    background: var(--bg-gray); color: var(--text); border: none;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    font-size: 18px; transition: 0.2s; flex-shrink: 0;
}
.theme-btn:hover { background: var(--border); transform: scale(1.05); }

/* ============ HERO С ВИДЕО ============ */
.hero { 
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80vh; 
    overflow: hidden;
    background: #111; 
    padding: 80px 0;
}

.hero-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    pointer-events: none;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 15, 15, 0.7); 
    z-index: 1;
}

.hero .container {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.hero h1 {
    display: flex; 
    align-items: center; 
    justify-content: center; 
    flex-wrap: wrap;
    gap: 24px; 
    margin: 0 0 28px; 
    font-size: clamp(40px, 5.5vw, 76px);
    font-weight: 800; 
    line-height: 1.1; 
    letter-spacing: -.03em;
    color: #fff; 
    text-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.hero-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 90px; height: 90px; 
    background: rgba(255, 255, 255, 0.15); 
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 24px; flex-shrink: 0; color: #fff;
}

.hero-icon svg { width: 50px; height: 50px; }

.hero-desc { 
    max-width: 850px; 
    margin: 0 auto 48px; 
    font-size: 20px; 
    line-height: 1.7; 
    color: rgba(255,255,255,0.9); 
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.hero-actions { 
    display: flex; 
    gap: 20px; 
    justify-content: center; 
    flex-wrap: wrap; 
}

.btn-primary {
    display: inline-flex; align-items: center; justify-content: center; gap: 12px;
    background: var(--primary); color: #fff; font-size: 18px; font-weight: 600;
    padding: 20px 36px; border: none; border-radius: var(--radius-sm); cursor: pointer; 
    transition: 0.3s; box-shadow: var(--shadow-btn);
}
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-3px); box-shadow: 0 8px 24px rgba(39, 174, 96, 0.4); }

.btn-outline {
    display: inline-flex; align-items: center; justify-content: center; gap: 12px;
    background: transparent; color: #fff; font-size: 18px; font-weight: 600;
    padding: 20px 36px; border: 2px solid rgba(255,255,255,0.5); border-radius: var(--radius-sm);
    cursor: pointer; transition: 0.3s; backdrop-filter: blur(4px);
}
.btn-outline:hover { background: rgba(255,255,255,0.15); border-color: #fff; transform: translateY(-3px); }

/* ============ ICON BAR ============ */
.icon-bar-wrapper {
    max-width: var(--container); margin: 0 auto; padding: 0 40px;
    position: relative; z-index: 10;
}
.icon-bar {
    background: var(--bg-card); border-radius: var(--radius); padding: 32px;
    display: grid; grid-template-columns: repeat(6, 1fr); gap: 24px;
    box-shadow: var(--shadow-card); border: 1px solid var(--border);
    transition: 0.3s;
}
.icon-item {
    display: flex; flex-direction: column; align-items: center; gap: 16px;
    text-align: center; cursor: pointer; transition: transform .3s;
    background: transparent; border: none; padding: 0; outline: none;
}
.icon-item:hover { transform: translateY(-6px); }
.icon-box {
    width: 72px; height: 72px; display: flex; align-items: center; justify-content: center;
    background: var(--bg-gray); border-radius: 20px; transition: 0.3s; color: var(--text);
}
.icon-box svg { width: 36px; height: 36px; }
.icon-label { font-size: 15px; font-weight: 600; color: var(--text); transition: 0.3s; }
.icon-item.active .icon-box { background: var(--primary); color: #fff; box-shadow: var(--shadow-btn); }
.icon-item.active .icon-label { color: var(--primary); }

/* ============ SERVICE DETAILS ============ */
.service-details-section { padding: 56px 0 120px; }
.service-details-box {
    background: var(--bg-card); border-radius: var(--radius); padding: 64px;
    border: 1px solid var(--border); box-shadow: var(--shadow-card);
    min-height: 340px; transition: 0.3s;
}
.service-panel { display: none; animation: fadeIn 0.5s ease; }
.service-panel.active { display: block; }
.service-panel-header { display: flex; align-items: center; gap: 28px; margin-bottom: 32px; }
.service-panel-icon {
    width: 80px; height: 80px; background: var(--bg-gray); border-radius: 24px;
    display: flex; align-items: center; justify-content: center; color: var(--primary);
}
.service-panel-icon svg { width: 40px; height: 40px; }
.service-panel h2 { font-size: 40px; font-weight: 800; margin: 0; letter-spacing: -.02em; }
.service-panel-content p { font-size: 18px; line-height: 1.8; color: var(--text-muted); margin: 0 0 20px; max-width: 1100px; }
.panel-map {
    margin-top: 40px; border-radius: var(--radius-sm); overflow: hidden;
    height: 550px; border: 1px solid var(--border); background: var(--bg-gray);
}
.panel-map iframe { width: 100% !important; height: 100% !important; border: 0; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }

/* ============ SECTIONS ============ */
.section { padding: 120px 0; transition: background-color 0.3s ease; }
.section-gray { background: var(--bg-gray); }
.section-title { font-size: clamp(34px, 4vw, 52px); font-weight: 800; letter-spacing: -.02em; margin: 0 0 24px; color: var(--text); }
.section-sub { font-size: 20px; color: var(--text-muted); margin: 0 0 64px; max-width: 800px; }

.about-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 90px; align-items: center; }
.about-text p { font-size: 18px; line-height: 1.8; color: var(--text-muted); margin: 0 0 28px; }
.about-visual {
    background: var(--bg-card); border-radius: var(--radius); overflow: hidden;
    aspect-ratio: 4/3; display: flex; align-items: center; justify-content: center; padding: 40px;
    box-shadow: var(--shadow-card); border: 1px solid var(--border);
}
.about-visual svg { width: 100%; height: 100%; object-fit: contain; }

.services-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.service-card {
    background: var(--bg-card); border-radius: var(--radius); padding: 44px;
    border: 1px solid var(--border); display: flex; flex-direction: column; transition: 0.3s;
    box-shadow: var(--shadow-card);
}
.service-card:hover { border-color: transparent; box-shadow: var(--shadow-hover); transform: translateY(-8px); }
.service-card h3 { font-size: 24px; font-weight: 700; margin: 0 0 16px; color: var(--text); }
.service-card p { font-size: 17px; color: var(--text-muted); line-height: 1.7; margin: 0 0 32px; flex: 1; }
.service-link { font-size: 17px; font-weight: 600; color: var(--primary); display: inline-flex; align-items: center; gap: 8px; }
.service-link:hover { text-decoration: underline; }

/* ============ MAPS ============ */
.maps-grid { display: flex; flex-direction: column; gap: 56px; }
.map-card {
    background: var(--bg-card); border-radius: var(--radius); overflow: hidden;
    border: 1px solid var(--border); display: flex; flex-direction: column; transition: 0.3s;
    box-shadow: var(--shadow-card);
}
.map-info {
    padding: 36px 48px; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 24px;
}
.map-info-text h3 { font-size: 26px; font-weight: 700; margin: 0 0 8px; }
.map-info-text p { font-size: 17px; color: var(--text-muted); margin: 0; }
.map-info .contact-line { display: flex; align-items: center; gap: 12px; font-weight: 600; font-size: 20px; }
.map-wrapper { position: relative; height: 600px; background: var(--bg-gray); }
.map-wrapper iframe { width: 100%; height: 100% !important; border: 0; display: block; }
.map-wrapper:fullscreen { background: var(--bg-card); border-radius: 0; height: 100vh; width: 100vw; }
.map-wrapper:fullscreen iframe { height: 100vh !important; }
.map-expand-btn {
    position: absolute; top: 24px; right: 24px; z-index: 10;
    background: var(--bg-card); color: var(--text); border: 1px solid var(--border);
    padding: 14px 24px; border-radius: var(--radius-sm); font-size: 16px; font-weight: 600;
    cursor: pointer; display: flex; align-items: center; gap: 10px; box-shadow: var(--shadow-card); transition: 0.2s;
}
.map-expand-btn:hover { background: var(--bg-gray); transform: translateY(-2px); }

/* ============ CTA ============ */
.cta-section {
    background: var(--primary); color: #fff; border-radius: var(--radius);
    padding: 90px 48px; text-align: center; max-width: var(--container);
    margin: 120px auto; width: calc(100% - 80px); box-sizing: border-box;
    box-shadow: 0 20px 50px rgba(39, 174, 96, 0.2);
}
.cta-section h2 { font-size: clamp(34px, 4vw, 52px); font-weight: 800; margin: 0 0 24px; letter-spacing: -.02em; }
.cta-section p { font-size: 22px; margin: 0 0 56px; color: rgba(255,255,255,.9); max-width: 800px; margin-left: auto; margin-right: auto; }
.cta-actions { display: flex; gap: 24px; justify-content: center; flex-wrap: wrap; }

.cta-actions .btn-primary { 
    color: var(--primary); 
    background: #fff; 
    box-shadow: 0 8px 24px rgba(0,0,0,0.1); 
}
.cta-actions .btn-primary:hover { 
    background: #f0f0f0; 
}
.cta-actions .btn-outline { 
    color: #fff; 
    background: transparent;
    border-color: rgba(255,255,255,.5); 
    box-shadow: none;
}
.cta-actions .btn-outline:hover { 
    background: rgba(255,255,255,.1); 
    border-color: #fff; 
}

/* ============ FOOTER ============ */
.footer { background: var(--bg-card); border-top: 1px solid var(--border); padding: 64px 0; transition: 0.3s; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 32px; }
.footer-brand { font-weight: 700; font-size: 22px; }
.footer-links { display: flex; gap: 48px; }
.footer-links a { font-size: 16px; color: var(--text-muted); font-weight: 500; }
.footer-links a:hover { color: var(--primary); }

/* ============ MOBILE BOTTOM NAV ============ */
.mobile-bottom-nav { display: none; }

/* ==========================================================================
   АДАПТИВНОСТЬ
   ========================================================================== */
@media (max-width: 1024px) {
    .header-btn-mail { display: none; }
    .nav { gap: 4px; }
    .nav > a, .nav-dropdown > a { font-size: 15px; padding: 8px 12px; }
    .hero-actions { flex-direction: column; align-items: stretch; }
    .icon-bar { grid-template-columns: repeat(3, 1fr); }
    .services-grid { grid-template-columns: repeat(2, 1fr); }
    .about-grid { grid-template-columns: 1fr; }
    .service-details-box { padding: 40px; }
    .map-info { flex-direction: column; align-items: flex-start; }
}

/* Мобильная версия */
@media (max-width: 768px) {
    .container { padding: 0 16px; box-sizing: border-box; }
    
    .header { box-shadow: none; }
    .header-inner { height: 64px; }
    .header-btn { display: none; }
    .menu-toggle { display: block; order: 2; }
    .header-actions { order: 3; margin-left: auto; }
    .logo { order: 1; }
    .logo img { height: 28px; }
    
    .nav {
        display: none; position: absolute; top: 100%; left: 0; right: 0; width: 100%;
        background: var(--bg-card); flex-direction: column; padding: 16px 20px;
        border-bottom: 1px solid var(--border); box-shadow: var(--shadow-dropdown);
        gap: 0; box-sizing: border-box;
    }
    .nav.active { display: flex; }
    .nav > a, .nav-dropdown > a {
        padding: 14px 0; border-bottom: 1px solid var(--border); width: 100%;
        border-radius: 0; font-size: 16px;
    }
    .nav > a:hover, .nav-dropdown > a:hover { background: transparent; }
    .nav > a:last-child { border-bottom: none; }
    .nav-dropdown { width: 100%; }
    .dropdown-menu {
        position: relative; top: 0; box-shadow: none; border: none;
        background: var(--bg-gray); border-radius: 8px; margin-top: 8px;
        display: none; opacity: 1; visibility: visible; transform: none; width: 100%;
        padding: 8px;
    }
    .nav-dropdown:hover .dropdown-menu { display: block; }
    
    .hero { 
        min-height: auto; 
        padding: 80px 0 60px; 
    }
    .hero h1 { font-size: clamp(26px, 8vw, 36px); flex-direction: column; gap: 16px; text-align: center; width: 100%; }
    .hero-icon { width: 60px; height: 60px; border-radius: 16px; }
    .hero-icon svg { width: 32px; height: 32px; }
    .hero-desc { font-size: 15px; margin-bottom: 24px; }
    .hero-actions { gap: 12px; width: 100%; }
    .btn-primary, .btn-outline { width: 100%; padding: 16px; font-size: 16px; box-sizing: border-box; }
    
    .icon-bar-wrapper { padding: 0 16px; width: 100%; box-sizing: border-box; overflow: hidden; }
    .icon-bar {
        display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
        padding: 12px; gap: 8px; border-radius: var(--radius-sm);
        box-shadow: var(--shadow-card); width: 100%; box-sizing: border-box;
        -webkit-overflow-scrolling: touch;
    }
    .icon-bar::-webkit-scrollbar { display: none; }
    .icon-item { flex: 0 0 76px; scroll-snap-align: start; padding: 8px 4px; }
    .icon-box { width: 48px; height: 48px; margin-bottom: 4px; border-radius: 12px; box-shadow: none; }
    .icon-box svg { width: 24px; height: 24px; }
    .icon-label { font-size: 11px; }
    .icon-item.active .icon-box { box-shadow: none; }
    
    .service-details-section { padding: 20px 0 40px; }
    .service-details-box { padding: 20px; border-radius: var(--radius-sm); width: 100%; box-sizing: border-box; }
    .service-panel h2 { font-size: 22px; }
    .service-panel-header { margin-bottom: 16px; gap: 12px; }
    .service-panel-icon { width: 48px; height: 48px; border-radius: 12px; }
    .service-panel-icon svg { width: 24px; height: 24px; }
    .service-panel-content p { font-size: 15px; }
    .panel-map { height: 250px; width: 100%; box-sizing: border-box; margin-top: 20px; }
    
    .section { padding: 48px 0; }
    .section-title { font-size: 24px; margin-bottom: 12px; }
    .section-sub { font-size: 15px; margin-bottom: 24px; }
    .services-grid { grid-template-columns: 1fr; gap: 16px; width: 100%; }
    .service-card { padding: 20px; width: 100%; box-sizing: border-box; box-shadow: none; border: 1px solid var(--border); }
    .service-card:hover { transform: none; box-shadow: none; }
    .service-card h3 { font-size: 18px; }
    .service-card p { font-size: 14px; }
    
    .maps-grid { gap: 24px; width: 100%; }
    .map-card { width: 100%; box-sizing: border-box; box-shadow: none; }
    .map-info { padding: 16px; width: 100%; box-sizing: border-box; }
    .map-info-text h3 { font-size: 18px; }
    .map-wrapper { height: 250px; width: 100%; box-sizing: border-box; }
    .map-expand-btn { top: 12px; right: 12px; padding: 8px 12px; font-size: 13px; }
    
    .cta-section { padding: 40px 16px; margin: 48px auto; width: calc(100% - 32px); box-sizing: border-box; box-shadow: none; }
    .cta-section h2 { font-size: 22px; }
    .cta-section p { font-size: 15px; margin-bottom: 24px; }
    .cta-actions { flex-direction: column; width: 100%; gap: 12px; }
    
    .cta-actions .btn-outline {
        background: transparent;
        border-color: rgba(255,255,255,.5);
    }
    
    .footer { padding: 32px 0 100px 0; }
    .footer-inner { flex-direction: column; align-items: flex-start; gap: 16px; width: 100%; box-sizing: border-box; }
    .footer-links { flex-wrap: wrap; gap: 16px; }
    .footer-brand { font-size: 18px; }
    
    .mobile-bottom-nav {
        display: flex; position: fixed; bottom: 0; left: 0; width: 100%;
        background: var(--bg-card); border-top: 1px solid var(--border);
        z-index: 100; justify-content: space-around;
        padding: 10px 0 calc(10px + env(safe-area-inset-bottom));
        transition: background-color 0.3s; box-sizing: border-box;
    }
    .mobile-nav-item {
        display: flex; flex-direction: column; align-items: center; gap: 4px;
        color: var(--text-muted); font-size: 11px; font-weight: 500;
        text-decoration: none; padding: 4px 16px;
    }
    .mobile-nav-item i { font-size: 22px; }
    .mobile-nav-item.active { color: var(--primary); }
}