/* Оптимизация для сенсорных устройств */

/* Увеличенные области нажатия для всех кликабельных элементов */
.touch-target {
    min-height: 44px;
    min-width: 44px;
    position: relative;
}

/* Кнопки с оптимальными размерами для касания */
.btn,
.btn-primary,
.btn-secondary,
.order-btn,
button {
    min-height: 48px;
    min-width: 48px;
    padding: 12px 24px;
    font-size: 16px;
    border-radius: 12px;
    transition: all 0.3s ease;
    touch-action: manipulation;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

/* Увеличенная область нажатия для мобильных кнопок */
@media (max-width: 768px) {
    .btn,
    .btn-primary,
    .btn-secondary,
    .order-btn,
    button {
        min-height: 56px;
        padding: 16px 28px;
        font-size: 18px;
        margin: 8px 4px;
    }
    
    /* Кнопки в hero секции */
    .hero-content .btn,
    .order-buttons .btn {
        min-height: 60px;
        padding: 18px 32px;
        font-size: 20px;
        font-weight: 600;
        margin: 10px 0;
        width: 100%;
        max-width: 320px;
    }
}

/* Навигационные ссылки */
.nav-link,
.nav a,
.dropdown-link {
    min-height: 44px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

@media (max-width: 768px) {
    .nav-link,
    .nav a,
    .dropdown-link {
        min-height: 56px;
        padding: 16px 20px;
        font-size: 18px;
    }
}

/* Форматирование ссылок в мобильном меню */
.nav.nav-open .nav-link {
    min-height: 60px !important;
    padding: 20px 0 !important;
    font-size: 20px !important;
    font-weight: 600 !important;
}

/* Гамбургер меню с улучшенной областью нажатия */
.mobile-menu-toggle {
    min-height: 48px;
    min-width: 48px;
    padding: 12px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.mobile-menu-toggle span {
    width: 24px;
    height: 3px;
    background-color: #333;
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
        min-height: 52px;
        min-width: 52px;
        padding: 14px;
    }
    
    .mobile-menu-toggle span {
        width: 26px;
        height: 3px;
    }
}

/* Анимация гамбургера */
.mobile-menu-toggle.menu-open span:nth-child(1) {
    transform: rotate(45deg) translateY(7px);
}

.mobile-menu-toggle.menu-open span:nth-child(2) {
    opacity: 0;
    transform: scale(0);
}

.mobile-menu-toggle.menu-open span:nth-child(3) {
    transform: rotate(-45deg) translateY(-7px);
}

/* Карточки с touch-friendly отступами */
.card,
.tariff-card,
.service-card {
    margin: 16px 0;
    padding: 24px;
    border-radius: 16px;
    transition: all 0.3s ease;
    touch-action: manipulation;
}

@media (max-width: 768px) {
    .card,
    .tariff-card,
    .service-card {
        margin: 20px 0;
        padding: 28px;
        border-radius: 20px;
    }
}

/* Аккордеоны и раскрывающиеся элементы */
.accordion-header,
.faq-question,
.dropdown-toggle {
    min-height: 56px;
    padding: 16px 20px;
    cursor: pointer;
    user-select: none;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.3s ease;
}

@media (max-width: 768px) {
    .accordion-header,
    .faq-question,
    .dropdown-toggle {
        min-height: 64px;
        padding: 20px 24px;
        font-size: 18px;
    }
}

/* Табы с увеличенными областями */
.tab-button,
.tab-link {
    min-height: 48px;
    padding: 12px 24px;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

@media (max-width: 768px) {
    .tab-button,
    .tab-link {
        min-height: 56px;
        padding: 16px 28px;
        font-size: 16px;
        margin: 4px 2px;
    }
}

/* Переключатель языков */
.language-switcher .lang-btn {
    min-height: 36px;
    min-width: 36px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

@media (max-width: 768px) {
    .language-switcher .lang-btn {
        min-height: 44px;
        min-width: 44px;
        padding: 8px 12px;
        font-size: 14px;
    }
}

/* Логотип и основные ссылки */
.logo-link {
    min-height: 48px;
    display: flex;
    align-items: center;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* Поддержка жестов свайп */
.swipe-container {
    touch-action: pan-x pan-y;
    -webkit-overflow-scrolling: touch;
}

/* Горизонтальный скролл для табов и карточек */
.tabs-container,
.cards-scroll {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    gap: 16px;
    padding: 0 16px;
}

.tabs-container::-webkit-scrollbar,
.cards-scroll::-webkit-scrollbar {
    display: none;
}

.tab-item,
.card-item {
    flex: 0 0 auto;
    scroll-snap-align: start;
}

/* Улучшенные формы для touch */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
textarea,
select {
    min-height: 48px;
    padding: 12px 16px;
    font-size: 16px;
    border-radius: 12px;
    border: 2px solid #e1e5e9;
    transition: all 0.3s ease;
    touch-action: manipulation;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

@media (max-width: 768px) {
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="password"],
    textarea,
    select {
        min-height: 56px;
        padding: 16px 20px;
        font-size: 18px;
        border-radius: 16px;
        margin: 8px 0;
    }
    
    textarea {
        min-height: 120px;
    }
}

/* Чекбоксы и радиокнопки */
input[type="checkbox"],
input[type="radio"] {
    min-height: 24px;
    min-width: 24px;
    margin: 8px;
    cursor: pointer;
    touch-action: manipulation;
}

@media (max-width: 768px) {
    input[type="checkbox"],
    input[type="radio"] {
        min-height: 28px;
        min-width: 28px;
        margin: 12px;
    }
    
    label {
        display: flex;
        align-items: center;
        min-height: 52px;
        padding: 8px 0;
        font-size: 16px;
        cursor: pointer;
        touch-action: manipulation;
    }
}

/* Модальные окна touch-friendly */
.modal-header,
.modal-footer {
    padding: 24px;
}

.modal-close,
.close-btn {
    min-height: 44px;
    min-width: 44px;
    padding: 12px;
    border: none;
    background: transparent;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

@media (max-width: 768px) {
    .modal-close,
    .close-btn {
        min-height: 52px;
        min-width: 52px;
        padding: 16px;
    }
}

/* Социальные ссылки */
.social-link,
.social-icon {
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

@media (max-width: 768px) {
    .social-link,
    .social-icon {
        min-height: 52px;
        min-width: 52px;
    }
}

/* Hover эффекты только для устройств с mouse */
@media (hover: hover) and (pointer: fine) {
    .btn:hover,
    .nav-link:hover,
    .card:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }
}

/* Тактильная обратная связь для touch устройств */
@media (hover: none) and (pointer: coarse) {
    .btn:active,
    .nav-link:active,
    .mobile-menu-toggle:active {
        transform: scale(0.98);
        opacity: 0.8;
    }
    
    .card:active {
        transform: scale(0.99);
    }
}

/* Предотвращение случайных касаний */
.prevent-touch {
    pointer-events: none;
    touch-action: none;
}

/* Улучшение производительности для анимаций */
.btn,
.nav-link,
.card,
.mobile-menu-toggle {
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Оптимизация скролла */
.scroll-container {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

/* Отключение выделения текста для UI элементов */
.btn,
.nav-link,
.mobile-menu-toggle,
.tab-button {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}