/* --- CSS Variables --- */
:root {
    --primary-color: #1B263B; /* Вугільно-синій */
    --secondary-color: #415A77; /* Більш світлий синьо-сірий */
    --accent-color: #E74C3C; /* Яскраво-червоний для CTA */
    --background-color: #FFFFFF; /* Білий фон */
    --light-gray-bg: #F8F9FA; /* Світло-сірий для секцій */
    --text-color: #333333; /* Темно-сірий для тексту */
    --heading-font: 'Montserrat', sans-serif;
    --body-font: 'Open Sans', sans-serif;
    --container-width: 1140px;
    --border-radius: 5px;
}

/* --- Global Styles & Reset --- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--body-font);
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-color);
    background-color: var(--background-color);
    transition: background-color 0.3s;
}

body.nav-open {
    overflow: hidden;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

h1, h2, h3, h4 {
    font-family: var(--heading-font);
    color: var(--primary-color);
    line-height: 1.3;
    margin-bottom: 20px;
}

h1 { font-size: 2.8rem; }
h2 { font-size: 2.2rem; text-align: center; }
h3 { font-size: 1.5rem; }
p { margin-bottom: 15px; }

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #c0392b;
}

ul, ol {
    list-style-position: inside;
}

img {
    max-width: 100%;
    height: auto;
}

/* --- Utility Classes --- */
.section-bg { background-color: var(--light-gray-bg); }
section { padding: 80px 0; }
.section-title { margin-bottom: 25px; }
.section-subtitle {
    max-width: 800px;
    margin: 0 auto 50px auto;
    text-align: center;
    font-size: 1.1rem;
    color: var(--secondary-color);
}

.btn {
    display: inline-block;
    padding: 12px 28px;
    font-family: var(--heading-font);
    font-weight: 600;
    font-size: 1rem;
    border-radius: var(--border-radius);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.btn-accent {
    background-color: var(--accent-color);
    color: #fff;
}

.btn-accent:hover {
    background-color: #c0392b;
    color: #fff;
}

/* --- Header & Navigation --- */
.main-header {
    background-color: #fff;
    border-bottom: 1px solid #e0e0e0;
    padding: 10px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo img {
    max-height: 50px;
    width: auto;
    display: block;
}

.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 30px;
}

.main-nav a {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1rem;
    padding: 5px 0;
    border-bottom: 2px solid transparent;
}

.main-nav a:hover {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
}

.mobile-nav-controls {
    display: none;
    align-items: center;
    gap: 15px;
}

.burger-menu {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1011;
}

.burger-menu span {
    width: 30px;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 5px;
    transition: all 0.3s linear;
    position: relative;
    transform-origin: 1px;
}

.burger-menu.active span:nth-child(1) { transform: rotate(45deg); }
.burger-menu.active span:nth-child(2) { opacity: 0; transform: translateX(20px); }
.burger-menu.active span:nth-child(3) { transform: rotate(-45deg); }


/* --- Hero Section (#hero) --- */
#hero {
    padding-top: 60px;
    padding-bottom: 60px;
    text-align: center;
}

#hero h1 { max-width: 900px; margin-left: auto; margin-right: auto; }
#hero p { max-width: 800px; margin: 0 auto 40px auto; font-size: 1.1rem; color: var(--secondary-color); }

.hero-videos-grid {
    display: flex;
    justify-content: center; /* Центрує вміст по горизонталі */
    overflow-x: auto;
    gap: 20px;
    margin-bottom: 40px;
    padding-bottom: 15px;
    -webkit-overflow-scrolling: touch;
}

.hero-videos-grid::-webkit-scrollbar { height: 8px; }
.hero-videos-grid::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 4px; }
.hero-videos-grid::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }
.hero-videos-grid::-webkit-scrollbar-thumb:hover { background: #aaa; }

.video-thumbnail {
    position: relative;
    aspect-ratio: 9 / 16;
    background-size: cover;
    background-position: center;
    border-radius: var(--border-radius);
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.3s ease;
    flex: 0 0 270px;
}

/* <<< ЗМІНА ТУТ >>> */
/* Стиль для одного відео, щоб воно було більшим на десктопі */
.video-thumbnail.single-video {
    flex-basis: 320px; /* Робить одне відео трохи ширшим */
    max-width: 320px;
}
/* <<< КІНЕЦЬ ЗМІН >>> */

.video-thumbnail::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(0,0,0,0.2);
    transition: background-color 0.3s ease;
}
.video-thumbnail:hover { transform: scale(1.03); }
.video-thumbnail:hover::before { background-color: rgba(0,0,0,0.4); }

.play-button {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 70px; height: 70px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.3s ease, background-color 0.3s ease;
}
.play-button::after {
    content: '';
    width: 0; height: 0;
    border-style: solid;
    border-width: 15px 0 15px 25px;
    border-color: transparent transparent transparent var(--accent-color);
    margin-left: 5px;
}
.video-thumbnail:hover .play-button {
    transform: translate(-50%, -50%) scale(1.1);
    background-color: #fff;
}


.hero-form {
    max-width: 700px;
    margin: 0 auto;
    background-color: var(--light-gray-bg);
    padding: 30px;
    border-radius: var(--border-radius);
    border: 1px solid #ddd;
    text-align: left;
}

.hero-form h3 { text-align: center; }
.form-group { display: flex; gap: 20px; margin-bottom: 15px; }

input[type="text"], input[type="tel"], input[type="email"], textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ccc;
    border-radius: var(--border-radius);
    font-family: var(--body-font);
    font-size: 1rem;
}
textarea { resize: vertical; margin-bottom: 15px; }
.hero-form button { width: 100%; font-size: 1.2rem; padding: 15px; }

/* --- Form Status Messages --- */
.form-status { margin-top: 15px; padding: 10px; border-radius: var(--border-radius); text-align: center; font-weight: 600; display: none; }
.form-status.sending, .form-status.success, .form-status.error { display: block; }
.form-status.sending { background-color: #e9ecef; color: var(--secondary-color); }
.form-status.success { background-color: #d4edda; color: #155724; }
.form-status.error { background-color: #f8d7da; color: #721c24; }

/* --- Consent Checkbox --- */
.consent-group { display: flex; align-items: flex-start; gap: 10px; margin: 20px 0; }
.consent-group input[type="checkbox"] { width: auto; margin-top: 5px; flex-shrink: 0; }
.consent-group label { font-size: 0.9rem; color: var(--secondary-color); text-align: left; line-height: 1.5; }
.consent-group label a { color: var(--primary-color); text-decoration: underline; }
.consent-group label a:hover { color: var(--accent-color); }

/* --- Grids, Cards, Other sections ... (no changes) --- */
.grid-container { display: grid; gap: 30px; }
.grid-4-cols { grid-template-columns: repeat(4, 1fr); }
.grid-3-cols { grid-template-columns: repeat(3, 1fr); }
.card { background-color: #fff; padding: 30px; border: 1px solid #e0e0e0; border-radius: var(--border-radius); transition: transform 0.3s ease, box-shadow 0.3s ease; }
.card:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0, 0, 0, 0.07); }
.card h3 { margin-bottom: 15px; }
#problemas .conclusion-text { text-align: center; font-size: 1.2rem; margin-top: 50px; max-width: 900px; margin-left: auto; margin-right: auto; }
.customization-section { margin-top: 60px; background-color: var(--light-gray-bg); padding: 40px; border-radius: var(--border-radius); text-align: center; }
.customization-section ul { list-style: none; padding: 0; display: flex; justify-content: center; gap: 25px; margin-top: 20px; font-weight: 600; }
.feature-item { text-align: center; }
.feature-item .icon { font-size: 3.5rem; line-height: 1; margin-bottom: 20px; }
.testimonials { margin-top: 70px; display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.testimonial-card { background-color: #fff; padding: 30px; border-left: 5px solid var(--accent-color); border-radius: 0 var(--border-radius) var(--border-radius) 0; }
.testimonial-card blockquote { font-style: italic; margin-bottom: 15px; color: var(--secondary-color); }
.testimonial-card cite { font-weight: 600; color: var(--primary-color); }
.process-steps { list-style: none; padding: 0; counter-reset: step-counter; display: flex; justify-content: space-between; gap: 30px; }
.process-steps li { position: relative; padding-left: 50px; flex: 1; }
.process-steps li h4 span { position: absolute; left: 0; top: 0; width: 35px; height: 35px; background-color: var(--accent-color); color: #fff; border-radius: 50%; display: flex; justify-content: center; align-items: center; font-size: 1.2rem; font-weight: 700; }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: start; }
.contact-info ul { list-style: none; padding: 0; margin: 20px 0; }
.contact-info li { margin-bottom: 10px; padding-left: 30px; position: relative; }
.map-container { overflow: hidden; position: relative; height: 0; padding-bottom: 75%; border: 1px solid #ddd; border-radius: var(--border-radius); margin-top: 20px; }
.map-container iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.contact-form-wrapper { background-color: #fff; padding: 40px; border-radius: var(--border-radius); border: 1px solid #ddd; }
.contact-form input, .contact-form textarea { margin-bottom: 15px; }
.contact-form button { width: 100%; padding: 15px; font-size: 1.1rem; }
.main-footer { background-color: var(--primary-color); color: #fff; padding: 25px 0; text-align: center; margin-top: 60px; }
.video-modal { display: none; position: fixed; z-index: 2000; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0,0,0,0.85); align-items: center; justify-content: center; }
.video-modal.active { display: flex; }
.video-modal-content { position: relative; margin: auto; padding: 0; width: auto; max-width: 450px; max-height: 90vh; }
#video-container video { width: 100%; height: auto; display: block; border-radius: var(--border-radius); }
.close-modal-btn { position: absolute; top: -40px; right: 0; color: #fff; font-size: 40px; font-weight: bold; transition: color 0.3s; cursor: pointer; }
.close-modal-btn:hover, .close-modal-btn:focus { color: #bbb; text-decoration: none; }
.fade-in { opacity: 0; transform: translateY(20px); transition: opacity 0.6s ease-out, transform 0.6s ease-out; }
.marcas-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 15px; max-width: 900px; margin: 0 auto; }
.marcas-list a { display: inline-block; padding: 10px 20px; background-color: #fff; border: 1px solid #ddd; border-radius: var(--border-radius); color: var(--primary-color); font-weight: 600; font-family: var(--heading-font); text-decoration: none; transition: all 0.3s ease; }
.marcas-list a:hover { background-color: var(--primary-color); color: #fff; border-color: var(--primary-color); transform: translateY(-3px); box-shadow: 0 5px 15px rgba(0,0,0,0.1); }


/* --- Responsive Design --- */
@media (max-width: 992px) {
    h1 { font-size: 2.4rem; }
    h2 { font-size: 2rem; }
    
    .hero-videos-grid {
        justify-content: flex-start; /* На планшетах повертаємо вирівнювання по лівому краю для скролу */
    }

    /* Якщо відео одне, центруємо його і на планшеті */
    .hero-videos-grid:has(.single-video) {
        justify-content: center;
    }
    
    .grid-4-cols, .grid-3-cols { grid-template-columns: 1fr 1fr; }
    .contact-grid { grid-template-columns: 1fr; }
    .process-steps { flex-direction: column; }
}

@media (max-width: 768px) {
    section { padding: 60px 0; }
    .main-nav { position: fixed; top: 0; right: 0; height: 100vh; width: 75%; max-width: 320px; background-color: #fff; flex-direction: column; justify-content: center; align-items: center; transform: translateX(100%); transition: transform 0.3s ease-in-out; box-shadow: -5px 0 15px rgba(0,0,0,0.1); z-index: 1010; }
    .main-nav.active { transform: translateX(0); }
    .main-nav ul { flex-direction: column; align-items: center; text-align: center; width: 100%; gap: 0; }
    .main-nav li { width: 100%; }
    .main-nav a { font-size: 1.5rem; padding: 20px; display: block; border-bottom: 1px solid #f0f0f0; }
    .main-nav a:hover { background-color: var(--light-gray-bg); }
    .main-nav .desktop-contact-item { display: none; }
    .mobile-nav-controls { display: flex; }
    .burger-menu { display: flex; }
    .mobile-contact-btn { padding: 8px 16px; font-size: 0.9rem; }
    
    .hero-videos-grid {
        scroll-snap-type: x mandatory;
    }
    
    .video-thumbnail {
        flex: 0 0 75%;
        scroll-snap-align: center;
    }

    /* <<< ЗМІНА ТУТ >>> */
    /* На мобільних одне відео має ту саму ширину, але буде відцентровано завдяки justify-content: center у батьківському блоці */
    .video-thumbnail.single-video {
        flex-basis: 75%;
    }
    
    .grid-4-cols, .grid-3-cols, .testimonials { grid-template-columns: 1fr; }
    .hero-form .form-group { flex-direction: column; gap: 15px; }
    .customization-section ul { flex-direction: column; gap: 10px; }
}

/* --- Language Switcher --- */
.lang-switcher {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    margin-left: 12px;
    flex-shrink: 0;
}
.lang-switcher .lang-current {
    color: var(--accent-color);
    padding: 3px 7px;
    border: 1px solid var(--accent-color);
    border-radius: var(--border-radius);
}
.lang-switcher .lang-link {
    color: var(--primary-color);
    text-decoration: none;
    opacity: 0.6;
    padding: 3px 7px;
    border: 1px solid transparent;
    border-radius: var(--border-radius);
    transition: opacity 0.2s, border-color 0.2s;
}
.lang-switcher .lang-link:hover {
    opacity: 1;
    border-color: var(--primary-color);
    color: var(--primary-color);
}
