/* Основные стили */
body {
    font-family: 'Roboto', sans-serif; /* Use Roboto */
    margin: 0;
    padding: 0;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa; /* Светлый фон */
}

.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Ensure this general rule is present --- */
img {
    max-width: 100%; /* Key rule for responsiveness */
    height: auto;    /* Maintain aspect ratio */
    display: block;  /* Prevents extra space below image */
    vertical-align: middle; /* Better alignment */
}
/* --- End general image rule ---*/

a {
    text-decoration: none;
    color: #007bff; /* Основной цвет ссылок */
    transition: color 0.3s ease;
}

a:hover {
    color: #0056b3;
}

h1, h2, h3 {
    margin-top: 0;
    font-weight: 700;
}

h2 {
    text-align: center;
    margin-bottom: 40px;
    font-size: 2.5rem;
    color: #343a40;
}

section {
    padding: 60px 0; /* Vertical padding */
}

/* Шапка */
header {
    background-color: #ffffff; /* Белая шапка */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 15px 0;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header .logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: #343a40;
}

header nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
}

header nav ul li {
    margin-left: 25px;
}

header nav ul li a {
    color: #343a40;
    font-weight: 400;
    transition: color 0.3s ease;
}

header nav ul li a:hover {
    color: #007bff;
}

/* Секция Hero */
.hero-section {
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('images/dev-bg.jpg') no-repeat center center/cover;
    color: #fff;
    text-align: center;
    padding: 120px 0;
}

.hero-section h1 {
    font-size: 3.5rem;
    margin-bottom: 20px;
}

.hero-section p {
    font-size: 1.2rem;
    margin-bottom: 30px;
}

.cta-button {
    display: inline-block;
    background-color: #2fc6f6; /* Цвет Битрикс24 */
    color: #fff;
    padding: 15px 30px;
    border-radius: 5px;
    font-size: 1.1rem;
    font-weight: 700;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.cta-button:hover {
    background-color: #1db0e0;
    color: #fff;
    transform: translateY(-2px);
}

/* Секция "О нас" */
.about-section {
    background-color: #ffffff;
}

.about-content {
    display: flex;
    align-items: center;
    gap: 40px; /* Пространство между картинкой и текстом */
}

.about-image { /* Specific style for this image */
    width: 40%;
    border-radius: 8px;
    /* General img rule handles max-width/height */
}

.about-content p {
    flex: 1; /* Текст занимает оставшееся пространство */
    font-size: 1.1rem;
    color: #555;
}


/* Секция Услуги */
.services-section {
    background-color: #f8f9fa;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.service-card {
    background-color: #ffffff;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #e9ecef;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(47, 198, 246, 0.1);
    border-color: #2fc6f6;
}

.service-card img { /* Specific styles for service icons */
    width: 60px; /* Размер иконок */
    height: 60px;
    margin: 0 auto 20px auto;
     /* General img rule handles max-width */
}

.service-card h3 {
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.service-card p {
    font-size: 1rem;
    color: #555;
}

/* Секция Портфолио */
.portfolio-section {
    background-color: #ffffff;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}


.portfolio-item {
    background-color: #f8f9fa;
    border-radius: 8px;
    overflow: hidden; /* Обрезка изображения по рамке */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.portfolio-item:hover {
     transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.portfolio-item img { /* Specific styles for portfolio images */
    width: 100%; /* Ensure it takes full width of container */
    height: 200px; /* Фиксированная высота для изображений */
    object-fit: cover; /* Масштабирование с сохранением пропорций */
    /* General img rule handles max-width */
}

.portfolio-item h3,
.portfolio-item p {
    padding: 0 20px;
}
.portfolio-item h3 {
    margin-top: 15px;
    margin-bottom: 10px;
    font-size: 1.3rem;
}
.portfolio-item p {
     margin-bottom: 15px;
     font-size: 0.95rem;
     color: #555;
}

/* Секция Контакты - Using the refined styles from last step */
.contact-section {
    background-color: #f8f9fa;
}

.contact-section h2 {
    color: #343a40;
    /* font-size and margin are handled by general h2 rule */
}

/* Target the paragraph directly inside contact-section container */
.contact-section > .container > p {
    text-align: center;
    margin-bottom: 40px;
    font-size: 1.1rem;
    color: #6c757d;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

#contactForm {
    max-width: 800px;
    margin: 0 auto;
    background-color: #ffffff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

#contactForm label {
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    color: #495057;
}

#contactForm input[type="text"],
#contactForm input[type="email"],
#contactForm input[type="tel"],
#contactForm textarea {
    padding: 15px;
    border: 1px solid #ced4da;
    border-radius: 5px;
    font-size: 1rem;
    font-family: inherit;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#contactForm input[type="text"]:focus,
#contactForm input[type="email"]:focus,
#contactForm input[type="tel"]:focus,
#contactForm textarea:focus {
    border-color: #007bff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

#contactForm textarea {
    resize: vertical;
    min-height: 120px;
}

.submit-button {
    grid-column: 1 / -1;
    background-color: #2fc6f6;
    color: #fff;
    padding: 15px 30px;
    border: none;
    border-radius: 5px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    width: auto;
    justify-self: center;
    margin-top: 10px;
}

.submit-button:hover {
    background-color: #1db0e0;
    transform: translateY(-2px);
}


/* Футер */
footer {
    background-color: #343a40; /* Темный футер */
    color: #adb5bd; /* Светло-серый текст */
    text-align: center;
    padding: 30px 0;
    margin-top: 60px; /* Отступ сверху */
}

footer p {
    margin: 5px 0;
    font-size: 0.9rem;
}

/* Адаптивность (Общая + Форма) */
@media (max-width: 992px) {
    .container { max-width: 960px; }
    h2 { font-size: 2.2rem; }
    .hero-section h1 { font-size: 2.8rem; }
    .about-content { flex-direction: column; text-align: center; }
    .about-image { width: 60%; margin: 0 auto 30px auto; } /* Center image when stacked */
}

@media (max-width: 768px) {
    .container { max-width: 720px; }
    header .container { flex-direction: column; }
    header nav { margin-top: 15px; }
    header nav ul { justify-content: center; } /* Center nav items */
    header nav ul li { margin: 0 10px; }
    .hero-section h1 { font-size: 2.5rem; }
    .hero-section { padding: 80px 0; }
    section { padding: 40px 0; }
    h2 { font-size: 2rem; margin-bottom: 30px; }

    /* Form adjustments from previous step */
    #contactForm {
        grid-template-columns: 1fr;
        padding: 30px;
    }
    .form-group.full-width {
        grid-column: 1 / 1; /* Ensure it works with single column */
    }
    .submit-button {
        width: 100%;
    }
    .about-image { width: 80%; }
}

@media (max-width: 576px) {
    .container { max-width: 100%; } /* Full width container */
    header .logo { font-size: 1.5rem; }
    header nav ul li { margin: 0 8px; }
    .hero-section h1 { font-size: 2rem; }
    .hero-section p { font-size: 1rem; }
    .cta-button { padding: 12px 25px; font-size: 1rem; }
    h2 { font-size: 1.8rem; }
    .service-card, .portfolio-item { padding: 20px; } /* Reduce padding slightly */
    .services-grid, .portfolio-grid { grid-template-columns: 1fr; gap: 20px; } /* Stack cards, reduce gap */
    #contactForm { padding: 20px; gap: 15px; } /* Reduce form padding and gap */
    .about-image { width: 90%; }
}
