/* ============================================================
   Карго Селекшн — основные стили
   ============================================================ */

:root {
    --primary: #27ae60;
    --primary-dark: #1e8449;
    --text: #1a1a1a;
    --text-muted: #666;
    --bg: #ffffff;
    --bg-gray: #f5f5f5;
    --bg-card: #ffffff;
    --bg-header: rgba(255, 255, 255, 0.95);
    --border: #e5e5e5;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --radius: 12px;
}

[data-theme="dark"] {
    --text: #f0f0f0;
    --text-muted: #a0a0a0;
    --bg: #0f0f0f;
    --bg-gray: #1a1a1a;
    --bg-card: #1e1e1e;
    --bg-header: rgba(15, 15, 15, 0.95);
    --border: #2a2a2a;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    padding-top: 70px;
    transition: background .3s, color .3s;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ============================== HEADER (фиксированный) ============================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--bg-header);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    transition: background .3s, border-color .3s;
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
    gap: 20px;
}
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 15px;
    letter-spacing: 0.02em;
    flex-shrink: 0;
    color: var(--text);
}
.logo img { height: 40px; width: auto; }
.logo-text-fallback {
    display: none;
    align-items: center;
    gap: 8px;
}
.nav {
    display: flex;
    align-items: center;
    gap: 24px;
    font-weight: 500;
    font-size: 15px;
}
.nav > a, .nav .nav-dropdown > a { color: var(--text-muted); transition: color .2s; }
.nav > a:hover, .nav .nav-dropdown > a:hover { color: var(--primary); }
.nav-dropdown { position: relative; }
.nav-dropdown > a { display: inline-flex; align-items: center; gap: 4px; }
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px;
    min-width: 200px;
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all .2s;
}
.nav-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.dropdown-menu a {
    display: block;
    padding: 10px 14px;
    border-radius: 8px;
    color: var(--text);
    font-size: 14px;
    transition: background .15s;
}
.dropdown-menu a:hover { background: var(--bg-gray); color: var(--primary); }

.header-actions { display: flex; align-items: center; gap: 10px; }
.header-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    border: none;
    cursor: pointer;
    transition: all .2s;
    white-space: nowrap;
}
.header-btn-call { background: var(--primary); color: #fff; }
.header-btn-call:hover { background: var(--primary-dark); }
.theme-btn {
    width: 40px; height: 40px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-gray);
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: background .2s;
}
.theme-btn:hover { background: var(--border); }
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text);
    cursor: pointer;
    padding: 4px;
}

/* ============================== HERO ============================== */
.hero {
    position: relative;
    min-height: 600px;
    display: flex;
    align-items: center;
    overflow: hidden;
    padding: 80px 0;
}
.hero-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}
.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0,0,0,.72), rgba(0,0,0,.45));
    z-index: 1;
}
.hero .container { position: relative; z-index: 2; color: #fff; text-align: center; }
.hero h1 {
    font-size: clamp(32px, 5vw, 56px);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 20px;
    letter-spacing: -0.02em;
}
.hero-desc {
    font-size: clamp(16px, 2vw, 19px);
    max-width: 720px;
    margin: 0 auto 32px;
    opacity: .92;
}
.hero-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* ============================== Кнопки ============================== */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    background: var(--primary);
    color: #fff;
    border-radius: 10px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    font-size: 16px;
    transition: all .2s;
    text-decoration: none;
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }

/* ============================== ICON BAR (80% ширина) ============================== */
.icon-bar-wrapper {
    padding: 40px 20px;
    display: flex;
    justify-content: center;
    background: var(--bg);
}
.icon-bar {
    display: flex;
    gap: 8px;
    padding: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
    flex-wrap: wrap;
    justify-content: space-between;
    width: 80vw; /* 80% от ширины экрана */
    max-width: 1400px; 
    margin: 0 auto;
}
.icon-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 18px;
    background: transparent;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 12px;
    transition: all .2s;
    flex: 1; /* Равномерно распределяет элементы */
}
.icon-item:hover { background: var(--bg-gray); color: var(--text); }
.icon-item.active { background: var(--primary); color: #fff; }
.icon-box { width: 28px; height: 28px; }
.icon-box svg { width: 100%; height: 100%; }
.icon-label { white-space: nowrap; }

/* ============================== SERVICE PANELS ============================== */
.service-details-section { padding: 20px 0 60px; }
.service-details-box { position: relative; }
.service-panel {
    display: none;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px;
    box-shadow: var(--shadow);
}
.service-panel.active { display: block; animation: fadeIn .4s ease; }
.service-panel-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}
.service-panel-icon {
    width: 48px; height: 48px;
    background: rgba(39, 174, 96, .12);
    color: var(--primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.service-panel-icon svg { width: 26px; height: 26px; }
.service-panel h2 { font-size: 26px; font-weight: 700; }
.service-panel-content p { color: var(--text-muted); font-size: 16px; line-height: 1.7; }
.panel-map {
    margin-top: 24px;
    width: 100%;
    height: 350px;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-gray);
}
.panel-map iframe, .panel-map > div { width: 100% !important; height: 100% !important; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ============================== SECTIONS ============================== */
.section { padding: 80px 0; }
.section-gray { background: var(--bg-gray); }
.section-title {
    font-size: clamp(28px, 4vw, 40px);
    font-weight: 800;
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}
.section-sub {
    color: var(--text-muted);
    font-size: 17px;
    margin-bottom: 40px;
}

/* ============================== ABOUT ============================== */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: center;
    margin-top: 40px;
}
.about-text p { margin-bottom: 16px; font-size: 16px; line-height: 1.7; color: var(--text-muted); }
.about-visual svg { width: 100%; height: auto; border-radius: var(--radius); }

/* ============================== SERVICES GRID ============================== */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}
.service-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    transition: all .3s;
}
.service-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
    border-color: var(--primary);
}
.service-card h3 { font-size: 20px; font-weight: 700; margin-bottom: 10px; }
.service-card p { color: var(--text-muted); margin-bottom: 18px; font-size: 15px; }
.service-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
    background: none;
    border: none;
    font-size: 15px;
    padding: 0;
    font-family: inherit;
    transition: gap .2s;
}
.service-link:hover { gap: 10px; }

/* ============================== MAPS ============================== */
.maps-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 32px;
}
.map-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.map-info {
    padding: 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.map-info h3 { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.map-info p { color: var(--text-muted); font-size: 14px; }
.contact-line { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.contact-line a:hover { color: var(--primary); }
.map-wrapper { position: relative; height: 320px; background: var(--bg-gray); }
.map-wrapper iframe, .map-wrapper > div { width: 100% !important; height: 100% !important; }
.map-expand-btn {
    position: absolute;
    top: 10px; right: 10px;
    z-index: 10;
    padding: 8px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    color: var(--text);
}
.map-wrapper:fullscreen { height: 100vh; }

/* ============================== CTA ============================== */
.cta-section {
    padding: 80px 20px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    text-align: center;
}
.cta-section h2 { font-size: clamp(26px, 4vw, 36px); font-weight: 800; margin-bottom: 12px; }
.cta-section p { font-size: 17px; opacity: .92; margin-bottom: 28px; }
.cta-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* ============================== FOOTER ============================== */
.footer {
    background: var(--bg-gray);
    padding: 40px 0;
    border-top: 1px solid var(--border);
}
.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    color: var(--text-muted);
    font-size: 14px;
}
.footer-brand { font-weight: 700; color: var(--text); }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-links a:hover { color: var(--primary); }

/* ============================== MOBILE BOTTOM NAV ============================== */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--bg-header);
    border-top: 1px solid var(--border);
    z-index: 999;
    padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.mobile-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px;
    font-size: 11px;
    color: var(--text-muted);
    transition: color .2s;
}
.mobile-nav-item i { font-size: 20px; }
.mobile-nav-item.active { color: var(--primary); }

/* ============================== MODALS ============================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
}
.modal-overlay.active { display: flex; }
.modal {
    background: var(--bg-card);
    color: var(--text);
    border-radius: 16px;
    padding: 32px;
    max-width: 480px;
    width: 100%;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
    animation: modalIn .3s ease;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}
.modal-wide { max-width: 720px; }
@keyframes modalIn {
    from { opacity: 0; transform: translateY(20px) scale(.95); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-close {
    position: absolute;
    top: 16px; right: 16px;
    width: 36px; height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--bg-gray);
    color: var(--text);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s;
}
.modal-close:hover { background: var(--border); }
.modal-title { font-size: 24px; font-weight: 800; margin-bottom: 20px; padding-right: 40px; }
.modal-content { color: var(--text-muted); font-size: 15px; line-height: 1.7; }
.modal-content h3 { color: var(--text); font-size: 16px; font-weight: 700; margin: 20px 0 8px; }
.modal-content h3:first-child { margin-top: 0; }
.modal-content p { margin-bottom: 12px; }

/* ============================== FORM ============================== */
.contact-form { display: flex; flex-direction: column; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 14px; font-weight: 600; color: var(--text); }
.form-group .optional { color: var(--text-muted); font-weight: 400; }
.form-group input {
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    background: var(--bg);
    color: var(--text);
    transition: border-color .2s;
}
.form-group input:focus { outline: none; border-color: var(--primary); }
.form-submit { width: 100%; margin-top: 8px; }
.form-submit:disabled { opacity: .6; cursor: not-allowed; }
.form-message { font-size: 14px; text-align: center; min-height: 20px; }
.form-message.success { color: var(--primary); font-weight: 600; }
.form-message.error { color: #e74c3c; font-weight: 600; }
.form-caption {
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.5;
}
.form-caption a { color: var(--primary); font-weight: 600; }
.form-notice {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.5;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}
.form-notice a { color: var(--primary); }

body.modal-open { overflow: hidden; }

/* ============================== АДАПТИВ ============================== */
@media (max-width: 992px) {
    .nav { display: none; }
    .nav.active {
        display: flex;
        position: absolute;
        top: 70px; left: 0; right: 0;
        flex-direction: column;
        background: var(--bg-card);
        padding: 20px;
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow);
        align-items: flex-start;
        gap: 16px;
    }
    .nav.active .nav-dropdown { width: 100%; }
    .nav.active .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        padding: 0 0 0 16px;
        min-width: 0;
        margin-top: 6px;
    }
    /* Прячем текст кнопки на планшетах и телефонах */
    .header-btn-text { display: none; }
    .header-btn-call { padding: 10px 14px; font-size: 18px; } 
    
    .menu-toggle { display: block; }
    .about-grid { grid-template-columns: 1fr; }
    .maps-grid  { grid-template-columns: 1fr; }
    .icon-bar { width: 95vw; }
}

@media (max-width: 768px) {
    body { padding-top: 60px; padding-bottom: 70px; }
    .header-inner { height: 60px; }
    .nav.active { top: 60px; }
    .section { padding: 60px 0; }
    .hero { min-height: 500px; padding: 60px 0; }
    .mobile-bottom-nav { display: flex; }
    .service-panel { padding: 24px; }
    .service-panel h2 { font-size: 22px; }
    .footer-inner { flex-direction: column; text-align: center; }
    .modal { padding: 24px; }
    .icon-item { padding: 10px 12px; font-size: 11px; }
    .icon-box { width: 24px; height: 24px; }
    .hero-actions { flex-direction: column; align-items: center; }
    .hero-actions > a { width: 100%; max-width: 340px; }
    .cta-actions { flex-direction: column; align-items: center; }
    .cta-actions > a { width: 100%; max-width: 340px; }
    .icon-bar { width: 100%; padding: 6px; gap: 4px; }
    .header-btn-call { padding: 8px 12px; font-size: 16px; }
}