/* =======================================
   MOBILE FIXES - Header & Menu
   Исправления для мобильной версии
   ======================================= */

/* ===== HEADER MOBILE FIX ===== */
@media (max-width: 768px) {
    /* Header container */
    .header {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        padding: 8px 0;
        background: rgba(26, 35, 50, 0.98);
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        z-index: 999;
    }
    
    /* Navbar */
    .navbar {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0 15px;
        width: 100%;
        max-width: 100%;
    }
    
    /* Logo */
    .logo {
        flex-shrink: 1;
        min-width: 0;
        max-width: 60%;
    }
    
    .logo h1 {
        font-size: 16px !important;
        margin: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        line-height: 1.2;
    }
    
    /* Hide phone button on mobile */
    .nav-contact {
        display: none !important;
    }
    
    /* Hamburger menu */
    .hamburger {
        display: flex;
        flex-direction: column;
        gap: 4px;
        cursor: pointer;
        z-index: 1001;
        padding: 8px;
        width: 40px;
        height: 40px;
        justify-content: center;
        align-items: center;
    }
    
    .hamburger span {
        width: 25px;
        height: 3px;
        background: white;
        transition: all 0.3s ease;
        display: block;
    }
    
    .hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(6px, 6px);
    }
    
    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }
    
    .hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -7px);
    }
    
    /* Mobile menu */
    .nav-menu {
        position: fixed;
        top: 56px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 56px);
        background: rgba(26, 35, 50, 0.98);
        transition: left 0.3s ease;
        overflow-y: auto;
        z-index: 998;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-list {
        flex-direction: column;
        padding: 0;
        margin: 0;
        width: 100%;
    }
    
    .nav-list li {
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        margin: 0;
    }
    
    .nav-link {
        display: block;
        padding: 18px 20px;
        font-size: 16px;
        color: white;
        text-decoration: none;
        width: 100%;
    }
    
    .nav-link:hover,
    .nav-link.active {
        background: rgba(255, 107, 53, 0.1);
        color: #ff6b35;
    }
    
    /* Hero section - добавляем отступ */
    .hero {
        margin-top: 56px;
        padding: 60px 0 40px;
        min-height: calc(100vh - 56px);
    }
    
    .hero-title {
        font-size: 24px !important;
        line-height: 1.3;
        margin-bottom: 15px;
    }
    
    .hero-subtitle {
        font-size: 14px !important;
        line-height: 1.5;
        margin-bottom: 25px;
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }
    
    .hero-buttons .btn {
        width: 100%;
        padding: 14px 20px;
        font-size: 14px;
    }
}

/* ===== LANGUAGE MENU MOBILE FIX ===== */
@media (max-width: 768px) {
    .language-switcher {
        position: fixed;
        top: 8px;
        right: 60px;
        z-index: 1000;
    }
    
    .lang-dropdown {
        position: relative;
    }
    
    .lang-current {
        padding: 6px 10px;
        background: rgba(255, 255, 255, 0.95);
        border-radius: 20px;
        display: flex;
        align-items: center;
        gap: 5px;
        min-width: auto;
    }
    
    .lang-current img {
        width: 20px;
        height: 20px;
    }
    
    .lang-current span {
        font-size: 12px;
        display: none;
    }
    
    .lang-arrow {
        font-size: 10px;
    }
    
    .lang-options {
        position: fixed;
        top: 56px;
        right: 10px;
        left: auto;
        width: calc(100% - 20px);
        max-width: 280px;
        margin-top: 10px;
        background: white;
        border-radius: 12px;
        box-shadow: 0 5px 25px rgba(0,0,0,0.2);
    }
    
    .lang-option {
        padding: 14px 16px;
        font-size: 15px;
    }
    
    .lang-option img {
        width: 22px;
        height: 22px;
    }
}

/* ===== CONTAINER FIX ===== */
@media (max-width: 768px) {
    .container {
        padding-left: 15px;
        padding-right: 15px;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    /* Sections padding */
    section {
        padding: 50px 0;
    }
    
    .section-title {
        font-size: 24px !important;
        line-height: 1.3;
        margin-bottom: 12px;
    }
    
    .section-subtitle {
        font-size: 14px !important;
        line-height: 1.5;
    }
    
    .section-description {
        font-size: 14px !important;
        line-height: 1.6;
    }
}

/* ===== BUTTONS MOBILE ===== */
@media (max-width: 768px) {
    .btn {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .btn-block {
        width: 100%;
        display: block;
    }
}

/* ===== WHATSAPP BUTTON MOBILE ===== */
@media (max-width: 768px) {
    .whatsapp-float {
        bottom: 20px;
        right: 15px;
        width: 55px;
        height: 55px;
    }
    
    .whatsapp-float i {
        font-size: 28px;
    }
}

/* ===== BACK TO TOP MOBILE ===== */
@media (max-width: 768px) {
    .back-to-top {
        bottom: 85px !important;
        right: 15px !important;
        width: 45px !important;
        height: 45px !important;
    }
}

/* ===== PREVENT HORIZONTAL SCROLL ===== */
@media (max-width: 768px) {
    body {
        overflow-x: hidden;
    }
    
    * {
        max-width: 100%;
    }
    
    img {
        max-width: 100%;
        height: auto;
    }
}

/* ===== ABOUT SECTION MOBILE ===== */
@media (max-width: 768px) {
    .about-content {
        flex-direction: column;
    }
    
    .about-image,
    .about-text {
        width: 100%;
    }
    
    .about-image {
        margin-bottom: 30px;
    }
    
    .about-features {
        font-size: 14px;
    }
    
    .about-features li {
        padding: 8px 0;
    }
}

/* ===== SERVICES MOBILE ===== */
@media (max-width: 768px) {
    .services-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .service-card {
        padding: 25px 20px;
    }
    
    .service-card h3 {
        font-size: 18px;
    }
    
    .service-card p {
        font-size: 14px;
    }
}

/* ===== STATS MOBILE ===== */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .stat-card {
        padding: 20px 15px;
    }
    
    .stat-number {
        font-size: 32px;
    }
    
    .stat-label {
        font-size: 12px;
    }
}

/* ===== CONTACT FORM MOBILE ===== */
@media (max-width: 768px) {
    .contact-content {
        flex-direction: column;
    }
    
    .contact-info,
    .contact-form {
        width: 100%;
    }
    
    .contact-info {
        margin-bottom: 30px;
    }
    
    .form-group input,
    .form-group textarea {
        font-size: 15px;
        padding: 12px 15px;
    }
}

/* ===== FOOTER MOBILE ===== */
@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .footer-col {
        text-align: center;
    }
    
    .footer-col h3 {
        font-size: 16px;
    }
    
    .footer-col p,
    .footer-col ul li {
        font-size: 13px;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
}

/* ===== ALERTS MOBILE ===== */
@media (max-width: 768px) {
    .alert {
        padding: 15px;
        font-size: 14px;
        margin: 15px 0;
    }
    
    .alert i {
        font-size: 20px;
    }
}

/* ===== FIX SPECIFIC ISSUES ===== */
@media (max-width: 768px) {
    /* Prevent text overflow */
    h1, h2, h3, h4, h5, h6 {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    /* Fix long words */
    p, span, div {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    /* Ensure no elements exceed viewport */
    .container,
    .section,
    .row {
        max-width: 100vw;
        overflow-x: hidden;
    }
}