/* 📱 ЭКСТРА МОБИЛЬНАЯ ОПТИМИЗАЦИЯ - ПОДКЛЮЧАТЬ ПОСЛЕДНИМ */

/* Глобальные правила для очень маленьких экранов */
@media (max-width: 400px) {
    /* БАЗОВЫЕ НАСТРОЙКИ */
    html {
        font-size: 13px !important; /* Уменьшаем базовый размер */
    }
    
    body {
        font-size: 12px !important;
        line-height: 1.3 !important; /* Плотнее строки */
    }
    
    /* ЗАГОЛОВКИ */
    h1 { font-size: 1.4rem !important; }
    h2 { font-size: 1.2rem !important; }
    h3 { font-size: 1.1rem !important; }
    h4 { font-size: 1rem !important; }
    h5 { font-size: 0.9rem !important; }
    h6 { font-size: 0.8rem !important; }
    
    /* ПАРАГРАФЫ И ТЕКСТ */
    p, span, div {
        font-size: 12px !important;
        line-height: 1.3 !important;
    }
    
    /* ТАБЛИЦЫ - МАКСИМАЛЬНО СЖАТО */
    table {
        font-size: 8px !important;
    }
    
    th, td {
        padding: 2px 1px !important;
        font-size: 8px !important;
    }
    
    /* КНОПКИ */
    button, .btn, input[type="button"], input[type="submit"] {
        font-size: 10px !important;
        padding: 6px 10px !important;
    }
    
    /* ФОРМЫ */
    input, select, textarea {
        font-size: 11px !important;
        padding: 8px 10px !important;
    }
    
    /* ССЫЛКИ */
    a {
        font-size: inherit !important;
    }
    
    /* КОНТЕЙНЕРЫ */
    .container, .content, .wrapper {
        padding: 8px !important;
    }
}

/* Дополнительная оптимизация для iPhone SE и подобных */
@media (max-width: 375px) {
    /* ЦЕНЫ В ТАБЛИЦАХ - КРИТИЧЕСКИ ВАЖНО */
    .price-adult, .price-child, 
    .tours-table .price-adult, 
    .tours-table .price-child {
        font-size: 7px !important;
        font-weight: 700 !important; /* Делаем жирнее для читаемости */
        color: #000 !important; /* Черный цвет для контраста */
    }
    
    /* НАЗВАНИЯ ТУРОВ */
    .tour-name, .tours-table .tour-name {
        font-size: 7px !important;
        line-height: 1.1 !important;
    }
    
    /* ОСТАЛЬНЫЕ ЭЛЕМЕНТЫ ТАБЛИЦЫ */
    .duration, .extras, .actions {
        font-size: 6px !important;
    }
    
    /* ЗАГОЛОВКИ ТАБЛИЦ */
    .tours-table th {
        font-size: 7px !important;
        font-weight: 600 !important;
        padding: 4px 1px !important;
    }
    
    /* ФИЛЬТРЫ И ЗАГОЛОВКИ */
    .filter-btn {
        font-size: 9px !important;
        padding: 6px 8px !important;
    }
    
    .prices-header h1 {
        font-size: 1.1rem !important;
    }
    
    .location-title {
        font-size: 1rem !important;
    }
}

/* Оптимизация для ландшафтной ориентации мобильных */
@media (max-height: 500px) and (orientation: landscape) {
    .gradient-bg {
        height: 50vh !important;
    }
    
    .overlay-text h2 {
        font-size: 1.2rem !important;
    }
    
    .overlay-text p {
        font-size: 0.75rem !important;
    }
}

/* Принудительная оптимизация для всех мобильных устройств */
@media (hover: none) and (pointer: coarse) {
    /* Это правило срабатывает только на touch устройствах */
    
    /* Увеличиваем контрастность для цен */
    .price-adult, .price-child {
        background-color: rgba(255, 255, 0, 0.1) !important; /* Легкий желтый фон */
        border-radius: 3px !important;
        padding: 1px 2px !important;
    }
    
    /* Делаем кликабельные элементы больше */
    button, .btn, a[href] {
        min-height: 32px !important; /* Минимальная высота для touch */
        min-width: 32px !important;
    }
    
    /* Убираем hover эффекты на мобильных */
    *:hover {
        transform: none !important;
        box-shadow: inherit !important;
    }
}
