/* Общие стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Заголовок */
.header {
    background: linear-gradient(135deg, #2c3e50, #3498db);
    color: white;
    padding: 1rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    color: #fff;
}

.nav a {
    color: white;
    text-decoration: none;
    margin-left: 2rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav a:hover {
    color: #f39c12;
}

/* Главная секция */
.hero {
    position: relative;
    color: white;
    text-align: center;
    padding: 120px 0 80px;
    margin-top: 70px;
    overflow: hidden;
}

.hero-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
}

.hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(44, 62, 80, 0.8), rgba(52, 152, 219, 0.8));
    z-index: -1;
}

.hero .container {
    position: relative;
    z-index: 1;
}

.hero h2 {
    font-size: 3rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.hero p {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

/* Кнопки */
.btn {
    display: inline-block;
    padding: 12px 30px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn-primary {
    background: linear-gradient(45deg, #e74c3c, #f39c12);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(45deg, #c0392b, #e67e22);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* Секция услуг */
.services {
    padding: 80px 0;
    background: white;
}

.services h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: #2c3e50;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.service-card {
    background: white;
    padding: 0;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #ecf0f1;
    overflow: hidden;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.service-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.service-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.service-card:hover .service-image img {
    transform: scale(1.05);
}

.service-card h3 {
    padding: 1.5rem 1.5rem 0.5rem;
    color: #2c3e50;
    margin-bottom: 0;
    font-size: 1.3rem;
}

.service-card p {
    padding: 0 1.5rem 1.5rem;
    color: #7f8c8d;
    line-height: 1.6;
    margin-bottom: 0;
}


/* Секция контактов */
.contact {
    padding: 80px 0;
    background: #f8f9fa;
}

.contact h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: #2c3e50;
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-top: 2rem;
}

/* Форма */
.contact-form {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.contact-form h3 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #2c3e50;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #ecf0f1;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* Контактная информация */
.contact-info {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.contact-info h3 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.contact-item {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #ecf0f1;
}

.contact-item:last-child {
    border-bottom: none;
}

.contact-item strong {
    color: #2c3e50;
    display: block;
    margin-bottom: 0.5rem;
}

.contact-item a {
    color: #3498db;
    text-decoration: none;
    transition: color 0.3s ease;
}

.contact-item a:hover {
    color: #2980b9;
}

.contact-item span {
    color: #7f8c8d;
}

/* Подвал */
.footer {
    background: #2c3e50;
    color: white;
    text-align: center;
    padding: 2rem 0;
}

/* Мобильная навигация */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #2c3e50, #3498db);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    z-index: 1000;
}

.mobile-nav.active {
    display: block;
}

.mobile-nav a {
    display: block;
    color: white;
    text-decoration: none;
    padding: 1rem 2rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    transition: background-color 0.3s ease;
}

.mobile-nav a:hover {
    background-color: rgba(255,255,255,0.1);
}

/* Адаптивность */
/* Планшеты */
@media (max-width: 1024px) {
    .container {
        padding: 0 30px;
    }
    
    .hero h2 {
        font-size: 2.5rem;
    }
    
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .service-image {
        height: 180px;
    }
}

/* Мобильные устройства */
@media (max-width: 768px) {
    .container {
        padding: 0 20px;
    }
    
    .header .container {
        justify-content: space-between;
    }
    
    .logo {
        font-size: 1.4rem;
    }
    
    .nav {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .hero {
        padding: 100px 0 60px;
    }
    
    .hero h2 {
        font-size: 2rem;
        line-height: 1.2;
    }
    
    .hero p {
        font-size: 1.1rem;
        margin-bottom: 1.5rem;
    }
    
    .btn {
        padding: 10px 25px;
        font-size: 0.9rem;
    }
    
    .services {
        padding: 60px 0;
    }
    
    .services h2 {
        font-size: 2rem;
        margin-bottom: 2rem;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .service-image {
        height: 200px;
    }
    
    .service-card h3 {
        font-size: 1.2rem;
        padding: 1rem 1rem 0.5rem;
    }
    
    .service-card p {
        padding: 0 1rem 1rem;
        font-size: 0.95rem;
    }
    
    .contact {
        padding: 60px 0;
    }
    
    .contact h2 {
        font-size: 2rem;
        margin-bottom: 2rem;
    }
    
    .contact-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .contact-form,
    .contact-info {
        padding: 1.5rem;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 10px;
        font-size: 16px; /* Предотвращает зум на iOS */
    }
    
    .contact-item {
        margin-bottom: 1rem;
        padding-bottom: 0.8rem;
    }
    
    .contact-item strong {
        font-size: 0.9rem;
    }
}

/* Маленькие мобильные устройства */
@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .logo {
        font-size: 1.2rem;
        line-height: 1.3;
    }
    
    .hero {
        padding: 90px 0 50px;
    }
    
    .hero h2 {
        font-size: 1.8rem;
        margin-bottom: 1rem;
    }
    
    .hero p {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .btn {
        padding: 12px 20px;
        font-size: 0.9rem;
        width: 100%;
        max-width: 280px;
    }
    
    .services,
    .contact {
        padding: 50px 0;
    }
    
    .services h2,
    .contact h2 {
        font-size: 1.8rem;
        margin-bottom: 1.5rem;
    }
    
    .service-card,
    .contact-form,
    .contact-info {
        padding: 1rem;
        margin: 0 5px;
    }
    
    .service-image {
        height: 180px;
    }
    
    .service-card h3 {
        font-size: 1.1rem;
        padding: 0.8rem 0.8rem 0.3rem;
    }
    
    .service-card p {
        padding: 0 0.8rem 0.8rem;
        font-size: 0.9rem;
        line-height: 1.5;
    }
    
    .contact-form h3,
    .contact-info h3 {
        font-size: 1.3rem;
        margin-bottom: 1rem;
    }
    
    .form-group {
        margin-bottom: 1rem;
    }
    
    .form-group label {
        font-size: 0.9rem;
        margin-bottom: 0.3rem;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 8px;
        font-size: 16px;
        border-radius: 3px;
    }
    
    .contact-item {
        margin-bottom: 0.8rem;
        padding-bottom: 0.6rem;
    }
    
    .contact-item strong {
        font-size: 0.85rem;
        margin-bottom: 0.3rem;
    }
    
    .contact-item a,
    .contact-item span {
        font-size: 0.9rem;
    }
    
    .footer {
        padding: 1.5rem 0;
    }
    
    .footer p {
        font-size: 0.9rem;
    }
}

/* Очень маленькие экраны */
@media (max-width: 360px) {
    .container {
        padding: 0 10px;
    }
    
    .logo {
        font-size: 1rem;
    }
    
    .hero h2 {
        font-size: 1.6rem;
    }
    
    .hero p {
        font-size: 0.95rem;
    }
    
    .services h2,
    .contact h2 {
        font-size: 1.6rem;
    }
    
    .service-card,
    .contact-form,
    .contact-info {
        padding: 0.8rem;
        margin: 0;
    }
    
    .service-image {
        height: 160px;
    }
}

/* Ландшафтная ориентация на мобильных */
@media (max-width: 768px) and (orientation: landscape) {
    .hero {
        padding: 80px 0 40px;
    }
    
    .hero h2 {
        font-size: 1.8rem;
    }
    
    .hero p {
        font-size: 1rem;
        margin-bottom: 1rem;
    }
    
    .services,
    .contact {
        padding: 40px 0;
    }
}

/* Улучшения для touch устройств */
@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: 44px; /* Минимальный размер для touch */
    }
    
    .nav a,
    .mobile-nav a {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    .service-card:hover {
        transform: none; /* Отключаем hover эффекты на touch */
    }
    
    .service-card:hover .service-image img {
        transform: none;
    }
}

/* Дополнительные стили для touch устройств */
.touch-device .btn {
    transition: transform 0.1s ease;
}

.touch-device .btn:active {
    transform: scale(0.95);
}

.touch-device .mobile-menu-toggle:active {
    transform: scale(0.9);
}

/* Улучшения для iOS */
@supports (-webkit-touch-callout: none) {
    .form-group input,
    .form-group textarea,
    .form-group select {
        -webkit-appearance: none;
        border-radius: 5px;
    }
    
    .btn {
        -webkit-appearance: none;
        border-radius: 5px;
    }
}

/* Улучшения для Android */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    .form-group input,
    .form-group textarea,
    .form-group select {
        border-radius: 5px;
    }
}

/* Оптимизация для медленных соединений */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Высокое разрешение экранов */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .service-image img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}
