/* ЗБРОС СТИЛІВ ТА БАЗА */
:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary: #475569;
    --dark: #0f172a;
    --light-bg: #f8fafc;
    --text: #334155;
    --text-muted: #64748b;
    --border: #e2e8f0;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text);
    line-height: 1.6;
    background-color: #ffffff;
}

.container {
    width: 100%;
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 20px;
}

/* КНОПКИ */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    font-size: 15px;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-secondary {
    background-color: transparent;
    color: var(--dark);
    border: 2px solid var(--border);
}

.btn-secondary:hover {
    background-color: var(--light-bg);
    border-color: var(--secondary);
}

.btn-block {
    display: block;
    width: 100%;
    text-align: center;
}

/* НАВІГАЦІЯ */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    height: 70px;
}

.nav {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    order: 2;
    margin-left: auto;
    margin-right: 30px;
}

.logo {
    display: flex;
    flex-direction: column;
}

.logo-main {
    font-weight: 800;
    font-size: 22px; /* Зробили трохи більшим та суворішим */
    color: var(--dark);
    letter-spacing: 1.5px;
}

.logo-sub {
    font-size: 11px;
    color: var(--primary);
    font-weight: 600;
    margin-top: -3px;
}

.nav a {
    text-decoration: none;
    color: var(--secondary);
    margin-left: 25px;
    font-weight: 500;
    font-size: 15px;
    transition: color 0.2s;
}

.nav a:hover {
    color: var(--primary);
}

/* ПЕРШИЙ ЕКРАН */
.hero {
    padding: 100px 0;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
}

.hero-container {
    display: flex;
    align-items: center;
    gap: 50px;
}

.hero-content {
    flex: 1;
}

.badge {
    background-color: #eff6ff;
    color: var(--primary);
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 20px;
}

.hero h1 {
    font-size: 42px;
    color: var(--dark);
    line-height: 1.2;
    margin-bottom: 20px;
    font-weight: 700;
}

.hero p {
    font-size: 18px;
    color: var(--secondary);
    margin-bottom: 30px;
}

.hero-actions {
    display: flex;
    gap: 15px;
}

.hero-image {
    flex: 1;
}

.hero-image img {
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.08);
}

/* ПОСЛУГИ */
.services {
    padding: 100px 0;
    background-color: var(--light-bg);
}

.section-title {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 60px auto;
}

.section-title h2 {
    font-size: 32px;
    color: var(--dark);
    margin-bottom: 15px;
}

.section-title p {
    color: var(--text-muted);
}

.services-grid {
    display: flex;
    gap: 30px;
}

.service-card {
    flex: 1;
    background: #ffffff;
    padding: 40px;
    border-radius: 8px;
    border-top: 5px solid var(--border);
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 20px rgba(0,0,0,0.05);
}

.service-card.mech { border-top-color: var(--primary); }
.service-card.electro { border-top-color: #10b981; }

.service-icon {
    font-size: 35px;
    margin-bottom: 20px;
}

.service-card h3 {
    font-size: 22px;
    color: var(--dark);
    margin-bottom: 15px;
}

.service-card p {
    color: var(--text-muted);
    margin-bottom: 25px;
}

.service-list {
    list-style: none;
}

.service-list li {
    position: relative;
    padding-left: 25px;
    margin-bottom: 12px;
    font-size: 15px;
}

.service-list li::before {
    content: "•";
    color: var(--primary);
    font-weight: bold;
    font-size: 18px;
    position: absolute;
    left: 5px;
    top: -2px;
}

/* ПРО МОЖЛИВОСТІ */
.about {
    padding: 100px 0;
    background-color: #ffffff;
}

.about-box {
    background-color: var(--dark);
    color: white;
    padding: 60px;
    border-radius: 12px;
    background-image: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

.about-text h2 {
    font-size: 32px;
    margin-bottom: 20px;
}

.about-text p {
    color: #94a3b8;
    font-size: 17px;
    max-width: 800px;
    margin-bottom: 30px;
}

.features {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.feature-item {
    font-weight: 500;
    color: #cbd5e1;
}

/* КОНТАКТИ */
.contact {
    padding: 100px 0;
    background-color: #ffffff;
    border-top: 1px solid var(--border);
}

.contact-container {
    display: flex;
    flex-direction: column;
    gap: 50px;
    align-items: stretch;
    width: 100%;
}

.contact-intro {
    max-width: 900px;
    text-align: center;
    width: 100%;
    margin: 0 auto;
}

.contact-intro h2 {
    font-size: 32px;
    color: var(--dark);
    margin-bottom: 20px;
}

.contact-intro p {
    font-size: 16px;
    color: var(--secondary);
    margin-bottom: 0;
}

.contact-contacts {
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
    padding: 28px 32px;
    background: var(--light-bg);
    border-radius: 8px;
    border: 1px solid var(--border);
    box-sizing: border-box;
}

.contact-contacts h3 {
    font-size: 22px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 18px;
}

.contact-details p {
    margin-bottom: 10px;
    font-size: 15px;
}

.contact-details a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.contact-form-wrapper {
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
    background: var(--light-bg);
    padding: 40px;
    border-radius: 8px;
    border: 1px solid var(--border);
    box-sizing: border-box;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 6px;
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: inherit;
    font-size: 16px;
    background: white;
}

.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* КНОПКИ КЕРУВАННЯ В ХЕДЕРІ */
.controls {
    display: inline-flex;
    gap: 10px;
    margin-left: 0;
    align-items: center;
    vertical-align: middle;
    order: 3;
}

.btn-control {
    /* display: none; */
    background: var(--light-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s ease;
}

.btn-control:hover {
    background: var(--border);
    transform: scale(1.05);
}

.lang-btn {
    font-size: 12px;
    font-weight: 700;
    color: var(--dark);
    letter-spacing: 0.5px;
}

/* ТЕМНА ТЕМА (DARK MODE) */
body.dark-theme {
    --light-bg: #1e293b;
    --dark: #f8fafc;
    --text: #cbd5e1;
    --text-muted: #94a3b8;
    --border: #334155;
    background-color: #0f172a;
}

body.dark-theme .header {
    background: rgba(15, 23, 42, 0.95);
    border-bottom-color: var(--border);
}

body.dark-theme .logo-main, 
body.dark-theme .nav a:not(.btn) {
    color: #ffffff;
}

body.dark-theme .hero {
    background: linear-gradient(180deg, #111827 0%, #0f172a 100%);
}

body.dark-theme .service-card {
    background: #1e293b;
}

body.dark-theme .contact-form-wrapper {
    background: #1e293b;
}

body.dark-theme .contact-contacts {
    background: #1e293b;
}

body.dark-theme .form-group input,
body.dark-theme .form-group textarea {
    background: #0f172a;
    color: white;
    border-color: var(--border);
}

body.dark-theme .btn-secondary {
    color: white;
    border-color: var(--border);
}
body.dark-theme .btn-secondary:hover {
    background: #334155;
}

/* ПІДВАЛ */
.footer {
    background-color: var(--dark);
    color: #64748b;
    padding: 30px 0;
    text-align: center;
    font-size: 14px;
    border-top: 1px solid #1e293b;
}

/* АДАПТИВНІСТЬ ДЛЯ ВЕЛИКИХ ЕКРАНІВ (Масштабування «на випередження») */
@media (min-width: 769px) {
    .hero h1 {
        font-size: clamp(32px, 4vw, 46px); /* Авто-масштабування від 32px до 46px */
    }
    .hamburger { 
        display: none; /* Ховаємо гамбургер на комп'ютерах */
    }
}

/* ГЛИБОКА МОБІЛЬНА АДАПТАЦІЯ (Екрани до 768px включно) */
@media (max-width: 768px) {
    /* 1. Навігаційна шапка, кнопки та логотип в один ряд */
    .header-container {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }

    .section-pd-mb {
        padding: 50px 0;
    }

    .controls {
        display: flex;
        gap: 10px;
        margin: 0;
        margin-left: auto; /* М'яко притискає кнопки теми/мови праворуч до гамбургера */
        margin-right: 15px;
        order: 0;
    }

    /* 2. Пропорційне зменшення шрифтів */
    .hero h1 { font-size: 28px; line-height: 1.3; }
    .hero p { font-size: 15px; }
    .section-title h2, .about-text h2, .contact-intro h2 { font-size: 24px; }
    .contact-contacts h3 { font-size: 20px; }
    .service-card h3 { font-size: 19px; }
    
    /* 3. Центрування елементів та тексту секцій */
    .hero, .services, .about, .contact {
        text-align: center;
    }
    .hero-container, .services-grid, .contact-container {
        flex-direction: column;
        gap: 30px;
    }

    .hero-actions {
        justify-content: center;
        flex-direction: column;
        width: 100%;
    }
    .hero-actions .btn {
        width: 100%;
    }
    .service-list {
        text-align: left;
        display: inline-block; /* Щоб маркери списку не розліталися по боках */
    }
    .features {
        grid-template-columns: 1fr;
        text-align: left;
        display: inline-block;
    }

    /* 4. Стилізація кнопки Гамбургера */
    .hamburger {
        display: block;
        background: none;
        border: none;
        cursor: pointer;
        z-index: 110;
        padding: 0;
    }
    .bar {
        display: block;
        width: 25px;
        height: 3px;
        margin: 5px auto;
        transition: all 0.3s ease-in-out;
        background-color: var(--dark); /* Авто-колір під тему */
    }
    /* Анімація перетворення в хрестик */
    .hamburger.active .bar:nth-child(2) { opacity: 0; }
    .hamburger.active .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .hamburger.active .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

    /* 5. Чисте мобільне меню (Виїжджає на весь екран) */
    .nav {
        position: fixed;
        left: -100%;
        top: 0;
        display: flex;
        flex-direction: column;
        justify-content: center; /* Центруємо пункти по вертикалі */
        align-items: center;
        gap: 30px; /* Великі зручні проміжки */
        background-color: #ffffff;
        width: 100%;
        height: 100vh;
        transition: 0.3s ease-in-out;
        box-shadow: 0 10px 20px rgba(0,0,0,0.05);
        z-index: 105;
        order: 0;
        margin-left: 0;
        margin-right: 0;
    }
    
    body.dark-theme .nav {
        background-color: #0f172a; /* Темний фон для меню в темній темі */
    }
    
    .nav.active {
        left: 0; /* Виїжджає на екран при кліку */
    }
    
    /* Кожен пункт меню строго в окремому рядку */
    .nav a {
        display: block;
        width: auto;
        text-align: center;
        margin: 0;
        font-size: 24px; /* Зручний великий розмір для пальця */
        font-weight: 600;
    }

    /* Мобільна кнопка "Надіслати запит" всередині меню */
    .nav .btn {
        font-size: 24px;
        padding: 0;
    }
}

html, body {
    overflow-x: hidden;
    width: 100%;
}