/* ==========================================================================
   ЧАСТИНА 1: БАЗА ТА ДЕСКТОП (Монітори від ноутбуків до 1920x1080+)
   ========================================================================== */

/* --- Змінні --- */
:root {
    --primary: #00274c; 
    --accent: #0066cc;  
    --icon-color: #004a99; 
    --light: #ffffff;
    --bg-light: #f0f4f8; 
    --text: #333;
    --transition: all 0.3s ease;
    --shadow: 0 10px 30px rgba(0, 39, 76, 0.15);
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Montserrat', sans-serif;
    margin: 0;
    padding: 0;
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    background: linear-gradient(to bottom, #001a33 0%, #ffffff 25%, #ffffff 100%);
}

/* --- Загальні класи --- */
.container {
    width: 90%;
    max-width: clamp(1140px, 80vw, 1500px); 
    margin: 0 auto;
}

.section { 
    padding: clamp(80px, 8vw, 130px) 0; 
}

.text-center {
    text-align: center !important;
}

/* --- Шапка та Навігація --- */
header {
    position: fixed;
    top: 0;
    width: 100%;
    background: transparent;
    z-index: 1000;
    transition: 0.4s;
    height: 80px; 
    display: flex;
    align-items: center;
}

header.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    height: 70px; 
}

.header-container { display: flex; justify-content: space-between; align-items: center; width: 100%; }
.logo-wrapper { position: relative; display: flex; align-items: center; width: 200px; height: 50px; text-decoration: none; }
.logo-white, .logo-blue { position: absolute; left: 0; top: 50%; transform: translateY(-50%); max-height: 100%; width: auto; transition: opacity 0.4s ease; }
.logo-white { opacity: 1; }
.logo-blue { opacity: 0; }
header.scrolled .logo-white { opacity: 0; }
header.scrolled .logo-blue { opacity: 1; }

nav ul { display: flex; list-style: none; margin: 0; padding: 0; align-items: center; }
nav ul li { margin-left: 30px; }
nav a { color: var(--light); text-decoration: none; font-weight: 600; font-size: 14px; text-transform: uppercase; letter-spacing: 0.5px; position: relative; transition: var(--transition); padding: 5px 0; }
header.scrolled nav a { color: var(--primary); }
nav a:not(.btn-call)::after { content: ''; position: absolute; width: 0; height: 2px; background: var(--accent); bottom: 0; left: 0; transition: 0.3s; }
nav a:not(.btn-call):hover::after { width: 100%; }

.btn-call { background: var(--accent); color: var(--light) !important; padding: 12px 25px; border-radius: 4px; font-weight: 700; }
.btn-call:hover { background: var(--primary); transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0, 102, 204, 0.4); }

.hamburger { display: none; cursor: pointer; margin-left: auto; z-index: 1500; position: relative; }
.hamburger div { width: 30px; height: 3px; background-color: var(--light); margin: 6px auto; border-radius: 3px; transition: all 0.4s ease-in-out; }
header.scrolled .hamburger div { background-color: var(--primary); }
.hamburger.active div:nth-child(1) { transform: translateY(9px) rotate(45deg); background-color: var(--primary); }
.hamburger.active div:nth-child(2) { opacity: 0; }
.hamburger.active div:nth-child(3) { transform: translateY(-9px) rotate(-45deg); background-color: var(--primary); }

/* --- Hero Секція --- */
.hero { height: 100vh; background: url('image_1.png') no-repeat center center/cover; position: relative; display: flex; align-items: center; text-align: center; color: var(--light); padding-top: 60px; }
.hero-overlay { 
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; 
    background: linear-gradient(135deg, rgba(0, 25, 50, 0.85), rgba(0, 50, 100, 0.2)); 
}
.hero-content { position: relative; z-index: 2; opacity: 0; transform: translateY(30px); animation: fadeUp 1s forwards 0.5s; max-width: 900px; }

@keyframes fadeUp { to { opacity: 1; transform: translateY(0); } }

.hero h1 { font-size: clamp(2.5rem, 4vw + 1rem, 4.5rem); font-weight: 800; margin-bottom: 20px; line-height: 1.2; color: var(--light) !important; text-shadow: 0 3px 15px rgba(0,0,0,0.6) !important; }
.hero p { font-size: clamp(1.1rem, 2vw + 0.5rem, 1.5rem); margin-bottom: 40px; opacity: 0.95; color: var(--light) !important; }

.btn { padding: 15px 40px; background: var(--accent); color: var(--light); border: none; border-radius: 4px; font-size: 16px; font-weight: 700; text-transform: uppercase; cursor: pointer; text-decoration: none; transition: var(--transition); display: inline-block; border: 1px solid transparent; }
.btn:hover { background: transparent; border-color: var(--accent); background-color: rgba(0, 102, 204, 0.2); backdrop-filter: blur(5px); }

/* --- Послуги (Головна сторінка) --- */
.section-header { text-align: center; margin-bottom: 60px; }
.section-header h2 { font-size: clamp(2rem, 3vw + 1rem, 3rem); color: var(--primary); margin-bottom: 15px; font-weight: 800; }

.services-grid { 
    display: grid; 
    grid-template-columns: repeat(4, 1fr); 
    gap: clamp(30px, 3vw, 50px); 
}

/* Очищений та об'єднаний клас картки послуг */
.card { 
    background: #fff; 
    padding: clamp(30px, 3vw, 50px) 30px; 
    border-radius: 8px; 
    box-shadow: var(--shadow); 
    text-align: center; 
    border: 1px solid #eef2f5; 
    display: flex; 
    flex-direction: column; 
    justify-content: space-between; 
    height: 100%; 
    box-sizing: border-box; 
    color: inherit;
    text-decoration: none !important; /* Жодних підкреслень */
    
    /* СЕКРЕТ ТУТ: Використовуємо top замість transform для анімації виїзду */
    position: relative;
    top: 50px; 
    opacity: 0; 
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease; 
}

a.card { display: block; cursor: pointer; }
a.card h3, a.card p, a.card .read-more { text-decoration: none !important; }

/* Тепер ховер працюватиме ідеально, бо анімація появи його більше не блокує */
.card:hover { 
    transform: translateY(-10px); 
    border-color: var(--accent); 
    box-shadow: 0 20px 40px rgba(0, 39, 76, 0.15); 
}

.card.visible { 
    animation: cardEntrance 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.services-grid .card:nth-child(1) { animation-delay: 0.1s; }
.services-grid .card:nth-child(2) { animation-delay: 0.3s; }
.services-grid .card:nth-child(3) { animation-delay: 0.5s; }
.services-grid .card:nth-child(4) { animation-delay: 0.7s; }

@keyframes cardEntrance {
    /* Замінили transform на top */
    to { opacity: 1; top: 0; }
}

.icon { font-size: clamp(45px, 4vw, 60px); margin-bottom: 25px; color: var(--icon-color); }
.card h3 { color: var(--primary); margin-bottom: 15px; font-weight: 700; }
.card p { text-align: center; line-height: 1.5; } /* Текст у картках на головній по центру */
.read-more { margin-top: 20px; color: var(--accent); font-weight: 800; font-size: 0.9rem; text-transform: uppercase; letter-spacing: 1px; display: inline-block; transition: 0.3s; }
.card:hover .read-more { transform: translateX(10px); color: var(--primary); }

/* --- Про компанію (Головна сторінка) --- */
.bg-light { background-color: var(--bg-light); }
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(60px, 5vw, 100px); align-items: center; }
.about-text h2 { color: var(--primary); font-size: clamp(1.8rem, 2.5vw + 1rem, 2.8rem); margin-bottom: 20px; }
.section-subtitle { color: var(--accent); text-transform: uppercase; font-weight: 800; font-size: 0.9rem; letter-spacing: 2px; margin-bottom: 15px; display: inline-block; background: rgba(0, 102, 204, 0.1); padding: 5px 15px; border-radius: 20px; }
.about-lead { font-size: clamp(1rem, 1.5vw, 1.2rem); font-weight: 600; color: var(--primary); margin-bottom: 15px; }
/* --- Дизайн кнопки "Зв'язатися з нами" --- */
.btn-about { 
    display: inline-block;
    margin-top: 45px; 
    padding: 18px 50px; 
    font-size: 1.05rem; 
    box-shadow: 0 10px 25px rgba(0, 102, 204, 0.25); 
}

/* Текст "Про компанію" по лівому краю, щоб уникнути розривів */
.about-text p, .about-text ul.styled-list li { text-align: left; line-height: 1.6; }

ul.styled-list { list-style: none; padding: 0; margin: 25px 0 35px 0; }
ul.styled-list li { font-size: clamp(0.95rem, 1vw, 1.1rem); margin-bottom: 15px; padding-left: 28px; position: relative; padding-bottom: 15px; border-bottom: 1px solid #e0e6ed; }
ul.styled-list li:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
ul.styled-list li::before { content: "✓"; color: var(--light); background: var(--accent); width: 18px; height: 18px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: bold; position: absolute; left: 0; top: 3px; }
ul.styled-list li strong { color: var(--primary); }

.stats { display: flex; gap: 40px; margin-top: 30px; }
.stat-item h3 { font-size: clamp(2.5rem, 4vw + 1rem, 4rem); color: var(--accent); margin: 0; font-weight: 800; }
.stat-item p { margin: 0; color: var(--primary); font-weight: 600; text-align: left; }

/* Інтерактивні зображення */
.about-images.interactive-images { position: relative; padding-right: 40px; padding-bottom: 40px; perspective: 1000px; }
.interactive-images .image-wrapper { transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1); }
.image-wrapper.main-image { border-radius: 10px; overflow: hidden; box-shadow: var(--shadow); position: relative; z-index: 1; transform-origin: top left; }
.image-wrapper.main-image img { width: 100%; height: auto; display: block; transition: transform 0.8s ease; }
.image-wrapper.small-image { position: absolute; bottom: -15px; right: -15px; width: 58%; border: 10px solid var(--bg-light); border-radius: 10px; overflow: hidden; box-shadow: 0 15px 35px rgba(0, 39, 76, 0.2); z-index: 2; transform-origin: bottom right; }
.image-wrapper.small-image img { width: 100%; height: auto; display: block; }
.interactive-images:hover .main-image { transform: scale(0.95) translateX(-10px); opacity: 0.8; }
.interactive-images:hover .main-image img { transform: scale(1.05); }
.interactive-images:hover .small-image { transform: scale(1.15) translateY(-15px) translateX(-10px); box-shadow: 0 25px 50px rgba(0, 39, 76, 0.3); border-color: #ffffff; z-index: 3; }

.experience-badge { position: absolute; top: 30px; left: -30px; background: var(--accent); color: var(--light); padding: 20px; border-radius: 50%; width: 120px; height: 120px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; box-shadow: 0 10px 20px rgba(0, 102, 204, 0.3); z-index: 4; }
.experience-badge .years { font-size: 2.5rem; font-weight: 800; line-height: 1; }
.experience-badge .text { font-size: 0.75rem; text-transform: uppercase; font-weight: 600; margin-top: 5px; }

/* ==========================================================================
   КЛІЄНТИ (Спеціально для JS скрипта)
   ========================================================================== */
.clients-carousel {
    overflow: hidden;
    width: 100%;
    padding: 20px 0;
    position: relative;
    cursor: pointer;
}

.clients-track {
    display: flex;
    align-items: center;
    width: max-content; 
    gap: 30px; 
    will-change: transform; 
}

.client-logo-card {
    width: 200px; 
    flex-shrink: 0; 
    display: flex;
    justify-content: center;
}

.client-logo {
    width: 100%;
    height: auto;
    object-fit: contain;
    padding: 15px 25px;
    background-color: var(--light);
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 39, 76, 0.05);
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

.client-logo:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 15px 30px rgba(0, 102, 204, 0.15);
    border-color: rgba(0, 102, 204, 0.2);
}

/* ==========================================================================
   ВНУТРІШНІ СТОРІНКИ (Екологія, Лабораторія тощо)
   ========================================================================== */
body.page-ecology { background: linear-gradient(to bottom, rgba(0, 25, 50, 0.7) 0%, rgba(0, 0, 0, 0) 30%), url('Ecology.png') no-repeat center center fixed; background-size: cover; }
body.page-lab { background: linear-gradient(to bottom, rgba(0, 25, 50, 0.7) 0%, rgba(0, 0, 0, 0) 30%), url('Lab.png') no-repeat center center fixed; background-size: cover; }
body.page-safety { background: linear-gradient(to bottom, rgba(0, 25, 50, 0.7) 0%, rgba(0, 0, 0, 0) 30%), url('safety.png') no-repeat center center fixed; background-size: cover; }
body.page-ventilation { background: linear-gradient(to bottom, rgba(0, 25, 50, 0.7) 0%, rgba(0, 0, 0, 0) 30%), url('Ventilation.png') no-repeat center center fixed; background-size: cover; }

.page-hero { height: 50vh; background: transparent !important; position: relative; display: flex; align-items: center; justify-content: center; text-align: center; color: var(--light); margin-bottom: 50px; padding: 80px 0 40px 0 !important; }
.page-hero h1 { color: white !important; text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8) !important; font-size: clamp(2.5rem, 4vw + 1rem, 4rem); }
h1, h2 { text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8); color: var(--primary); }

.page-content { background: rgba(255, 255, 255, 0.92); padding: clamp(20px, 4vw, 40px); margin-top: 20px; margin-bottom: 40px; border-radius: 15px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2); position: relative; z-index: 2; font-size: clamp(1rem, 1.2vw, 1.1rem); }
.page-content h2 { color: var(--primary); margin-top: 30px; margin-bottom: 15px; border-bottom: 2px solid var(--accent); display: inline-block; font-size: clamp(1.8rem, 2vw + 1rem, 2.2rem); }

.service-intro { margin-bottom: 40px; padding-bottom: 30px; border-bottom: 2px dashed #e0e6ed; }
.service-intro .lead-text { font-size: clamp(1.1rem, 1.5vw + 0.5rem, 1.3rem); font-weight: 700; color: var(--primary); margin-bottom: 15px; }

.service-details-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: clamp(20px, 3vw, 30px); }
.service-detail-card { background: #ffffff; border: 1px solid #e0e6ed; border-radius: 10px; padding: clamp(20px, 3vw, 30px); transition: var(--transition); box-shadow: 0 4px 15px rgba(0,0,0,0.03); }
.service-detail-card:hover { transform: translateY(-5px); box-shadow: 0 15px 30px rgba(0, 39, 76, 0.1); border-color: #cce0ff; }

.card-icon-wrapper { width: 60px; height: 60px; background: var(--bg-light); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin-bottom: 20px; }
.card-emoji { font-size: 30px; }
.service-detail-card h2 { font-size: clamp(1.3rem, 1.5vw + 0.5rem, 1.5rem); margin-top: 0; margin-bottom: 15px; border-bottom: none; }
.card-desc { font-size: 0.95rem; color: #555; margin-bottom: 20px; line-height: 1.5; }

/* === Вирівнювання тексту на внутрішніх сторінках === */
.service-intro p { text-align: left; }
.service-detail-card p, .service-detail-card ul li { text-align: left; line-height: 1.6; } 
.service-detail-card ul li strong { display: block; text-align: left; margin-bottom: 4px; color: var(--primary); }

.call-to-action-wrapper { text-align: center; margin-top: 40px; }
.call-to-action-wrapper .cta-text { margin-bottom: 20px; font-weight: 600; color: var(--primary); }

/* ==========================================================================
   СТОРІНКА 404 (Помилка)
   ========================================================================== */
.error-section { min-height: 80vh; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; background: linear-gradient(135deg, #001a33 0%, #004a99 100%); color: var(--light); padding: 120px 20px 80px; }
.error-section h1 { font-size: clamp(6rem, 15vw, 12rem); font-weight: 800; line-height: 1; margin: 0; color: var(--light) !important; text-shadow: 0 10px 30px rgba(0, 0, 0, 0.4) !important; letter-spacing: 5px; }
.error-section h2 { font-size: clamp(1.5rem, 3vw, 2.5rem); color: var(--light) !important; margin: 20px 0; text-shadow: none; }
.error-section p { font-size: clamp(1rem, 1.5vw, 1.1rem); margin-bottom: 40px; opacity: 0.8; max-width: 600px; margin-left: auto; margin-right: auto; text-align: center; }

/* ==========================================================================
   ФУТЕР
   ========================================================================== */
footer { background: var(--primary); color: #fff; padding: 70px 0 0; }
.footer-content { display: grid; grid-template-columns: 1fr 1.5fr 2.5fr; gap: 40px; margin-bottom: 30px; align-items: stretch; }
.footer-col h3 { color: var(--accent); margin-bottom: 20px; font-size: 1.2rem; }
.footer-nav { list-style: none; padding: 0; }
.footer-nav li { margin-bottom: 5px; }
.footer-nav a { color: white; text-decoration: none; opacity: 0.8; transition: var(--transition); }
.footer-nav a:hover { opacity: 1; color: var(--accent); }
.footer-contacts p { margin: 5px 0; line-height: 1.4; }
.map-col iframe { width: 100%; height: 100%; box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2); filter: contrast(1.1) grayscale(15%); }
.footer-brand-bar { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid rgba(255, 255, 255, 0.1); padding: 30px 0; }
.footer-brand-bar .footer-logo { height: 50px; margin-bottom: 0; }
.brand-slogan { text-align: center; max-width: 650px; line-height: 1.6; }
.footer-brand-bar p { margin: 5px 0; opacity: 0.9; }
.brand-schedule { text-align: right; }
.copyright { background: rgba(0,0,0,0.2); text-align: center; padding: 20px 0; font-size: 14px; opacity: 0.6; }

/* ==========================================================================
   МОДАЛЬНЕ ВІКНО
   ========================================================================== */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 39, 76, 0.9); display: none; justify-content: center; align-items: center; z-index: 2000; opacity: 0; transition: opacity 0.3s; }
.modal-overlay.open { display: flex; opacity: 1; }
.modal { background: #fff; padding: 40px; border-radius: 8px; width: 100%; max-width: 400px; position: relative; transform: scale(0.8); transition: transform 0.3s; }
.modal-overlay.open .modal { transform: scale(1); }
.close-modal { position: absolute; top: 15px; right: 20px; font-size: 28px; cursor: pointer; color: #999; }
.close-modal:hover { color: var(--accent); }
.modal-title { text-align: center; color: var(--primary); margin-top: 0; margin-bottom: 10px; }
.modal-subtitle { text-align: center; margin-bottom: 20px; }
.form-group { margin-bottom: 20px; }
.form-group input { width: 100%; padding: 12px; border: 2px solid #e0e6ed; border-radius: 4px; font-size: 16px; font-family: inherit; transition: 0.3s; box-sizing: border-box; }
.form-group input:focus { border-color: var(--accent); outline: none; }
.btn-full { width: 100%; }

/* --- Сучасні стилі для помилок форми --- */
.error-message { 
    color: #d93025; 
    font-size: 14px; 
    margin-top: 8px; 
    text-align: left; 
    display: none; 
    font-weight: 600; 
    background-color: #fce8e6; 
    padding: 10px 12px; 
    border-radius: 6px; 
    border-left: 4px solid #d93025; 
    animation: shake 0.3s ease-in-out; 
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.form-group input.input-error { 
    border-color: #d93025; 
    background-color: #fffaf9; 
    box-shadow: 0 0 0 4px rgba(217, 48, 37, 0.1); 
}
/* ==========================================================================
   ПРЕЛОАДЕР
   ========================================================================== */
#preloader { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: #003366; z-index: 99999; display: flex; flex-direction: column; justify-content: center; align-items: center; transition: opacity 0.6s ease, visibility 0.6s ease; }
#preloader.hidden { opacity: 0; visibility: hidden; }
.loader-logo img { width: 360px; max-width: 80vw; margin-bottom: 30px; animation: pulse 1.5s infinite; filter: brightness(1.05) contrast(1.1); }
.spinner { width: 50px; height: 50px; border: 4px solid rgba(255, 255, 255, 0.1); border-top: 4px solid #e0e0e0; border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
@keyframes pulse { 0% { transform: scale(1); opacity: 0.9; } 50% { transform: scale(1.05); opacity: 1; } 100% { transform: scale(1); opacity: 0.9; } }
/* ==========================================================================
   ЧАСТИНА 2: МОБІЛЬНА ТА ПЛАНШЕТНА ВЕРСІЯ (МЕНШЕ 1024px)
   ========================================================================== */
@media (max-width: 1024px) { 
    body.page-ecology, body.page-lab, body.page-safety, body.page-ventilation { background-attachment: scroll !important; background-size: auto 100vh !important; background-color: #001a33 !important; background-position: center top !important; background-repeat: no-repeat !important; }
    .services-grid { grid-template-columns: repeat(2, minmax(260px, 380px)); justify-content: center; }
    .hamburger { display: block; position: absolute; left: 50%; transform: translateX(-50%); }
    nav ul { position: fixed; right: -100%; top: 80px; flex-direction: column; background: #fff; width: 100%; text-align: center; transition: 0.4s ease-in-out; box-shadow: 0 5px 10px rgba(0,0,0,0.1); padding: 30px 0; }
    header.scrolled nav ul { top: 70px; }
    nav ul.active { right: 0; }
    nav ul li { margin: 15px 0; }
    nav a { color: var(--primary); font-size: 16px; }
    .btn-call { margin-top: 15px; display: inline-block; }

    /* --- Логотипи (Планшет і Телефон для JS) --- */
    .client-logo-card { width: 150px; }
    .clients-track { gap: 15px; }

    /* --- Про компанію --- */
    .about-grid { grid-template-columns: 1fr; flex-direction: column; }
    .stats { justify-content: center; }
    .about-text .btn { display: block; width: fit-content; margin-left: auto; margin-right: auto; }

    /* --- Футер --- */
    .footer-content { grid-template-columns: 1fr 1fr; gap: 40px; text-align: left; }
    .footer-col { display: flex; flex-direction: column; align-items: flex-start; }
    .map-col { grid-column: 1 / -1; height: 250px; margin-top: 0; }
    .footer-brand-bar { flex-direction: column; text-align: center; gap: 15px; }
    .brand-schedule { text-align: center; }
}

@media (max-width: 768px) {
    #header.menu-open { background-color: #ffffff !important; transition: background-color 0.05s linear !important; border-bottom: none !important; box-shadow: none !important; z-index: 1001; }
    #header.menu-open .logo-white { display: none !important; opacity: 0 !important; }
    #header.menu-open .logo-blue { display: block !important; opacity: 1 !important; visibility: visible !important; }
    #header.menu-open .hamburger div { background-color: #003366 !important; transition: background-color 0.4s ease; }
    .hamburger.active div:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .hamburger.active div:nth-child(2) { opacity: 0; }
    .hamburger.active div:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

    #nav-menu { position: absolute !important; top: 100% !important; left: 0 !important; width: 100% !important; height: auto !important; background-color: #ffffff !important; z-index: 998; padding: 10px 0 30px 0 !important; box-shadow: 0px 15px 20px rgba(0,0,0,0.1) !important; border-radius: 0 0 15px 15px !important; display: block !important; opacity: 0; visibility: hidden; transform: scaleY(0); transform-origin: top; transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1), transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.5s !important; }
    #nav-menu.active { opacity: 1 !important; visibility: visible !important; transform: scaleY(1) !important; }
    #nav-menu li { text-align: center; margin: 15px 0; }
    #nav-menu a { color: #003366 !important; font-weight: 600; text-transform: uppercase; }
    #nav-menu a.btn-call { color: #ffffff !important; }

    .services-grid, .service-details-grid { grid-template-columns: minmax(260px, 380px); justify-content: center; }
    .about-images.interactive-images { padding-right: 15px; padding-bottom: 35px; margin-left: 10px; margin-bottom: 20px; }
    .image-wrapper.small-image { width: 70%; bottom: -25px; right: -10px; border-width: 6px; }
    .experience-badge { left: -10px; top: 15px; width: 80px; height: 80px; padding: 12px; }
    .experience-badge .years { font-size: 1.5rem; }
    .experience-badge .text { font-size: 0.55rem; }
    
    .about-text { text-align: center; } 
    .about-text p, ul.styled-list li { text-align: left; } 
    
    .stats { flex-direction: column; gap: 20px; background: #fff; padding: 20px; border-radius: 10px; box-shadow: 0 5px 15px rgba(0,0,0,0.05); }
    .footer-content { grid-template-columns: 1fr; text-align: center; gap: 25px; }
    .footer-col { align-items: center; }
    .footer-col h3 { margin-bottom: 10px; }
    .footer-col p, .footer-nav li { margin-bottom: 5px; }
    .map-col { grid-column: 1 / -1; height: 300px; margin-top: 10px; }
}
/* === ФІНАЛЬНІ ПРАВКИ ДЛЯ МОБІЛЬНОЇ ВЕРСІЇ === */
@media (max-width: 1024px) {
    /* 1. Центруємо текст під синіми цифрами статистики */
    .stat-item p, 
    .stat-item h3 {
        text-align: center !important;
    }

    /* 2. Захист логотипа від сплющування на телефонах */
    .logo-wrapper {
        width: 160px !important;
    }
    .logo-white, .logo-blue {
        object-fit: contain !important;
    }
    
    /* 3. Примусово прибираємо дивні пробіли в списках на телефоні (як на 1-му скріні) */
    .service-detail-card p, 
    .service-detail-card ul li,
    ul.styled-list li {
        text-align: left !important;
    }
}
/* === ФІКС ДЛЯ ЗЛИПЛИХ ЛОГОТИПІВ НА МОБІЛЬНОМУ === */
@media (max-width: 768px) {
    .clients-track {
        gap: 20px !important; /* Жорстко задаємо відстань між картками */
    }
    .client-logo-card {
        width: 140px !important; /* Робимо їх акуратнішими для вузьких екранів */
        padding: 0 5px !important; /* Додатковий простір навколо картки */
    }
    .client-logo {
        padding: 10px 15px !important; /* Повертаємо повітря (білі поля) всередині самої картки */
    }
}