/* Мобилна оптимизация за начална страница - ОБНОВЕНА ВЕРСИЯ */
@media screen and (max-width: 768px) {
    
    /* Основно съдържание - гарантираме, че нищо не излиза извън екрана */
    #page-content {
        overflow-x: hidden !important;
        width: 100% !important;
        max-width: 100vw !important;
        box-sizing: border-box !important;
    }
    
    #page-content * {
        max-width: 100% !important;
        word-wrap: break-word !important;
        box-sizing: border-box !important;
    }
    
    /* Херо секция - коригиране на padding и border-radius */
    #page-content h1 {
        font-size: 2rem !important;
        line-height: 1.2 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }
    
    #page-content [style*="padding: 3rem 1.5rem"] {
        padding: 2rem 1rem !important;
        border-radius: 0 0 30px 30px !important;
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    /* Херо бутони - коригирани да не излизат извън екрана */
    #page-content .hero-buttons a,
    #page-content [style*="background: #ff9f1c"],
    #page-content [style*="background: white"][style*="padding: 1rem 2.5rem"] {
        display: block !important;
        margin: 10px auto !important;
        width: 90% !important;
        max-width: 350px !important;
        padding: 1rem 0.5rem !important;
        font-size: 1.2rem !important;
        text-align: center !important;
        white-space: normal !important;
        word-break: break-word !important;
        box-sizing: border-box !important;
    }
    
    /* Секция "За нас" - тийзър */
    #page-content [style*="display: flex; flex-wrap: wrap; gap: 30px; align-items: center; background: #f8f9fa;"] {
        flex-direction: column !important;
        text-align: center !important;
        padding: 1.5rem !important;
        border-radius: 30px !important;
        margin: 1rem !important;
        width: auto !important;
    }
    
    #page-content [style*="display: flex; flex-wrap: wrap; gap: 30px; align-items: center; background: #f8f9fa;"] div {
        text-align: center !important;
        width: 100% !important;
    }
    
    /* Статистики (10+, 1500+) */
    #page-content [style*="display: flex; justify-content: center; gap: 20px; flex-wrap: wrap;"] {
        flex-direction: row !important;
        justify-content: center !important;
        gap: 15px !important;
    }
    
    #page-content [style*="display: flex; justify-content: center; gap: 20px; flex-wrap: wrap;"] div {
        min-width: 120px !important;
        width: calc(50% - 20px) !important;
        margin: 0 auto !important;
    }
    
    /* Карти с услуги - grid корекция */
    #page-content [style*="display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 25px;"] {
        display: flex !important;
        flex-direction: column !important;
        gap: 20px !important;
        padding: 0 1rem !important;
        margin: 2rem 0 !important;
    }
    
    #page-content [style*="display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 25px;"] > div {
        width: 100% !important;
        margin: 0 auto !important;
        padding: 1.5rem 1rem !important;
    }
    
    /* Предстоящи лагери - flexbox корекция */
    #page-content [style*="display: flex; flex-wrap: wrap; gap: 20px; align-items: center; background: white; border-radius: 40px;"] {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 15px !important;
        padding: 1.2rem !important;
    }
    
    #page-content [style*="display: flex; flex-wrap: wrap; gap: 20px; align-items: center; background: white; border-radius: 40px;"] > div:first-child {
        width: auto !important;
        min-width: 100px !important;
    }
    
    #page-content [style*="display: flex; flex-wrap: wrap; gap: 20px; align-items: center; background: white; border-radius: 40px;"] > div:nth-child(2) {
        width: 100% !important;
        margin-right: 0 !important;
    }
    
    #page-content [style*="display: flex; flex-wrap: wrap; gap: 20px; align-items: center; background: white; border-radius: 40px;"] a {
        width: 100% !important;
        text-align: center !important;
        margin-top: 10px !important;
    }
    
    /* Блок "Защо да изберете нас" */
    #page-content [style*="background: #1e4b7a; border-radius: 60px;"] {
        padding: 1.5rem !important;
        margin: 2rem 1rem !important;
        width: auto !important;
        border-radius: 30px !important;
    }
    
    #page-content [style*="display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px;"] {
        display: flex !important;
        flex-direction: column !important;
        gap: 15px !important;
    }
    
    #page-content [style*="display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px;"] > div {
        width: 100% !important;
        margin-bottom: 10px !important;
    }
    
    /* Бърза връзка за контакт (големия оранжев бутон) */
    #page-content [style*="font-size: 1.8rem"][style*="padding: 1.2rem 3rem"] {
        font-size: 1.3rem !important;
        padding: 1rem !important;
        width: 90% !important;
        max-width: 350px !important;
        box-sizing: border-box !important;
        white-space: normal !important;
        line-height: 1.4 !important;
        margin: 0 auto !important;
        display: block !important;
    }
    
    #page-content [style*="background: #ff9f1c; color: #1e4b7a; font-size: 1.8rem; font-weight: bold; padding: 1.2rem 3rem; border-radius: 60px;"] {
        font-size: 1.3rem !important;
        padding: 1rem 1.5rem !important;
        width: 90% !important;
        max-width: 350px !important;
        margin: 0 auto !important;
        display: block !important;
        box-shadow: 0 8px 0 #b76800 !important;
    }
    
    /* Всички секции със max-width: 1200px */
    #page-content [style*="max-width: 1200px; margin:"] {
        width: 100% !important;
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        margin-left: auto !important;
        margin-right: auto !important;
        box-sizing: border-box !important;
    }
    
    /* Коригиране на текстове */
    #page-content p {
        font-size: 1rem !important;
        line-height: 1.5 !important;
    }
    
    #page-content h2 {
        font-size: 2rem !important;
    }
    
    #page-content h3 {
        font-size: 1.5rem !important;
    }
    
    /* Поправка за flexbox контейнери с flex:1 */
    #page-content [style*="flex: 1;"] {
        min-width: 100% !important;
        margin-bottom: 1rem !important;
    }
    
    #page-content [style*="display: flex; flex-wrap: wrap; gap: 20px; align-items: center; background: white;"] {
        flex-direction: column !important;
        text-align: center !important;
    }
    
    #page-content [style*="display: flex; flex-wrap: wrap; gap: 20px; align-items: center; background: white;"] div {
        text-align: center !important;
    }
    
    /* Гарантираме, че всички изображения са responsive */
    #page-content img {
        max-width: 100% !important;
        height: auto !important;
    }
    
    /* Поправка за inline-block елементи */
    #page-content [style*="display: inline-block;"] {
        max-width: 100% !important;
        white-space: normal !important;
        word-break: break-word !important;
    }
    
    /* Поправка за първата херо секция */
    #page-content [style*="background: linear-gradient(135deg, #1e4b7a 0%, #2a6b9e 100%);"] {
        padding: 2rem 1rem !important;
        margin: 0 !important;
        width: 100% !important;
        border-radius: 0 0 30px 30px !important;
    }
	
	#page-content [style*="background: #1e4b7a; border-radius: 60px;"] [style*="display: grid"] > [style*="text-align: center;"] {
    min-height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    }
}

/* Изравняване на височините на заглавията */
#page-content [style*="background: #1e4b7a; border-radius: 60px;"] [style*="display: grid"] > [style*="text-align: center;"] h3 {
    min-height: 60px; /* Еднаква височина за всички заглавия */
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 10px 0;
}

/* Изравняване на текстовете */
#page-content [style*="background: #1e4b7a; border-radius: 60px;"] [style*="display: grid"] > [style*="text-align: center;"] p {
    min-height: 50px; /* Еднаква височина за всички параграфи */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: orange;
}