/* --- Глобальные переменные и стили --- */
:root {
    --primary-color: #1a365d;
    --secondary-color: #2d3748;
    --accent-color: #3182ce;
    --background-color: #f7fafc;
    --text-color: #2d3748;
    --white-color: #ffffff;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    margin: 0;
    padding: 0;
}

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

h1, h2, h3 {
    color: var(--primary-color);
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
    text-align: center;
    margin-bottom: 40px;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background-color: var(--accent-color);
    color: var(--white-color);
}

.btn-primary:hover {
    background-color: #2b6cb0; /* Darker accent */
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background-color: var(--primary-color);
    color: var(--white-color);
}

.btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    color: var(--white-color);
}

/* --- Header --- */
.header {
    background-color: var(--white-color);
    padding: 15px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.logo {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}

.logo svg {
    height: 50px;
    width: auto;
    margin-right: 10px;
    color: var(--accent-color);
}

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

.main-nav li {
    margin-left: 25px;
}

.main-nav a {
    text-decoration: none;
    color: var(--secondary-color);
    font-weight: 500;
    transition: color 0.3s ease;
}

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

.hamburger-menu {
    display: none; /* Скрыто на десктопе */
    cursor: pointer;
    background: none;
    border: none;
    z-index: 1001; /* Выше чем .main-nav */
}

.hamburger-menu span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--primary-color);
    margin: 5px 0;
    transition: all 0.3s ease-in-out;
}

.hamburger-menu.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}
.hamburger-menu.active span:nth-child(2) {
    opacity: 0;
}
.hamburger-menu.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}


/* --- Hero Section --- */
#hero {
    background: url('../assets/images/hero-bg.jpg') no-repeat center center/cover;
    color: var(--white-color);
    text-align: center;
    padding: 100px 0;
    position: relative;
}

#hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(26, 54, 93, 0.7); /* Overlay */
}


#hero .container {
    position: relative;
    z-index: 2;
}

#hero h1 {
    color: var(--white-color);
    margin-bottom: 20px;
}

#hero p {
    font-size: 1.2rem;
    margin-bottom: 30px;
}

.hero-buttons .btn {
    margin: 0 10px;
}


/* --- Sections General --- */
section {
    padding: 60px 0;
}

section:nth-child(even) {
    background-color: var(--white-color);
}

/* --- Features Section --- */
#features .container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    text-align: center;
}

.feature-item img {
    height: 50px;
    margin-bottom: 15px;
}

.feature-item svg {
    width: 50px;
    height: 50px;
    margin-bottom: 15px;
    color: var(--accent-color);
}

/* --- Services Section --- */
#services .service-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.service-card {
    background-color: var(--white-color);
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s, box-shadow 0.3s;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.service-card img, .service-card svg {
    width: 50px;
    height: 50px;
    margin-bottom: 15px;
}

.service-card svg {
    width: 50px;
    height: 50px;
    margin-bottom: 15px;
    color: var(--accent-color);
}

.service-card h3 {
    margin-top: 0;
}

.service-card ul {
    list-style: none;
    padding: 0;
    margin-bottom: 20px;
    flex-grow: 1; /* Заставляет список растягиваться */
}

.service-card li {
    padding-left: 20px;
    position: relative;
    margin-bottom: 10px;
}

.service-card li::before {
    content: '✓';
    color: var(--accent-color);
    position: absolute;
    left: 0;
}

/* --- Cooperation Section --- */
#cooperation .cooperation-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 40px;
}

.cooperation-card {
    background-color: #e2e8f0; /* Slightly different background */
    padding: 25px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #cbd5e0;
}

.cooperation-card svg {
    width: 40px;
    height: 40px;
    margin-bottom: 15px;
    color: var(--primary-color);
}


/* --- Portfolio Section --- */
#portfolio {
    background-color: var(--white-color);
}

.portfolio-slider {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 80%;
    gap: 20px;
    overflow-x: auto;
    padding-bottom: 20px; /* Для тени и скроллбара */
    margin-bottom: 30px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch; /* Плавная прокрутка на iOS */
}

@media (min-width: 768px) {
    .portfolio-slider {
        grid-auto-columns: 40%;
    }
}

@media (min-width: 1024px) {
    .portfolio-slider {
        grid-auto-columns: 30%;
    }
    #services .service-cards {
        grid-template-columns: repeat(3, 1fr);
    }
}


.portfolio-item {
    background: var(--white-color);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    position: relative;
    scroll-snap-align: start;
    aspect-ratio: 4 / 3; /* Задаем пропорции контейнеру */
    background-color: #e2e8f0; /* Фон для контейнера, пока грузится img */
}

.portfolio-item img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* Масштабируем, чтобы заполнить контейнер */
    display: block;
}

.portfolio-item img.lazy {
    /* Больше не нужен отдельный фон или пропорции */
}

.portfolio-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(26, 54, 93, 0.9), rgba(26, 54, 93, 0));
    color: var(--white-color);
    padding: 40px 20px 20px;
    z-index: 2; /* Убедимся, что текст поверх картинки */
}

.portfolio-info h3 {
    color: var(--white-color);
    margin-top: 0;
    margin-bottom: 5px;
}

/* --- Modal --- */
.modal {
    display: none; /* Скрыто по умолчанию */
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 30px;
    border: 1px solid #888;
    width: 80%;
    max-width: 600px;
    border-radius: 8px;
    position: relative;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from {opacity: 0; transform: scale(0.9);}
    to {opacity: 1; transform: scale(1);}
}

.close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    top: 10px;
    right: 20px;
}

.close-button:hover,
.close-button:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}


/* --- Consultation Form --- */
.was-validated input:invalid,
.was-validated textarea:invalid {
  border-color: #e53e3e; /* Red border for invalid fields */
}

#consultation-form form {
    max-width: 600px;
    margin: 0 auto;
    display: grid;
    gap: 15px;
}

#consultation-form input, 
#consultation-form select, 
#consultation-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

/* --- About Section --- */
#about .about-content {
    display: flex;
    align-items: center;
    gap: 40px;
}

#about .about-stats {
    display: flex;
    gap: 20px;
    text-align: center;
}

.stat-item span {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-color);
}

/* --- Footer --- */
footer {
    background-color: var(--secondary-color);
    color: var(--background-color);
    padding: 40px 0;
}

footer .footer-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

footer a {
    color: var(--background-color);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

.social-links a {
    margin-right: 15px;
    color: var(--background-color);
}

.social-links svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
    stroke: currentColor;
}


.copyright {
    text-align: center;
    border-top: 1px solid #4a5568;
    padding-top: 20px;
}

/* --- Sticky CTA --- */
.sticky-cta {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999;
}

/* --- Анимация появления --- */
section, .feature-item, .service-card {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

section.visible, .feature-item.visible, .service-card.visible {
    opacity: 1;
    transform: translateY(0);
}


/* --- Адаптивность --- */
@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    .main-nav { 
        display: none; 
        position: absolute;
        top: 0;
        right: 0;
        width: 250px;
        height: 100vh;
        background-color: var(--white-color);
        box-shadow: -2px 0 5px rgba(0,0,0,0.1);
        flex-direction: column;
        padding-top: 60px;
        transform: translateX(100%);
        transition: transform 0.3s ease-in-out;
    } 

    .main-nav.active {
        display: flex;
        transform: translateX(0);
    }
    
    .main-nav ul {
        flex-direction: column;
        width: 100%;
    }

    .main-nav li {
        margin: 15px 0;
        text-align: center;
    }

    #features .container,
    #about .about-stats {
        grid-template-columns: 1fr 1fr; /* 2 колонки на средних экранах */
    }

    .footer-columns {
        grid-template-columns: 1fr; /* 1 колонка в футере */
        text-align: center;
    }

    .social-links {
        justify-content: center;
        display: flex;
    }

    .hamburger-menu { display: block; } /* Показываем гамбургер */
    
    .header .container .btn {
        display: none; /* Скрываем кнопку в хедере на мобильных */
    }

    #about .about-content {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    #features .container,
    #about .about-stats,
    #services .service-cards {
        grid-template-columns: 1fr; /* 1 колонка на малых экранах */
    }

    .hero-buttons {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
}
