/**
 * Enhanced Responsive Design
 * Улучшенный адаптивный дизайн для всех устройств
 */

/* ============================================
   BREAKPOINTS
   ============================================ */
/*
   xs: 320px - 480px (маленькие телефоны)
   sm: 481px - 768px (большие телефоны)
   md: 769px - 1024px (планшеты)
   lg: 1025px - 1200px (маленькие ноутбуки)
   xl: 1201px+ (десктопы)
*/

/* ============================================
   ОБЩИЕ НАСТРОЙКИ
   ============================================ */

/* Предотвращение горизонтального скролла */
html, body {
    overflow-x: hidden;
    max-width: 100%;
}

* {
    -webkit-tap-highlight-color: rgba(212, 175, 55, 0.2);
}

/* Оптимизация изображений */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ============================================
   ПЛАНШЕТЫ (до 1024px)
   ============================================ */

@media (max-width: 1024px) {
    :root {
        --section-padding: 80px 0;
        --navbar-height: 70px;
    }

    .container {
        padding: 0 30px;
    }

    /* Заголовки */
    h1 {
        font-size: 2.5rem;
        line-height: 1.2;
    }

    h2 {
        font-size: 2rem;
    }

    h3 {
        font-size: 1.5rem;
    }

    /* Hero секция */
    .hero-section {
        min-height: 70vh;
    }

    .hero-content h1 {
        font-size: 2.8rem;
    }

    .hero-content p {
        font-size: 1.1rem;
        max-width: 600px;
    }

    /* Сетки */
    .features-grid,
    .rooms-grid,
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    /* Карточки номеров */
    .room-card {
        margin-bottom: 30px;
    }

    /* Формы */
    .booking-form,
    .contact-form {
        padding: 30px 20px;
    }

    /* Кнопки */
    .cta-btn,
    .primary-btn {
        padding: 14px 32px;
        font-size: 0.95rem;
    }
}

/* ============================================
   МОБИЛЬНЫЕ УСТРОЙСТВА (до 768px)
   ============================================ */

@media (max-width: 768px) {
    :root {
        --section-padding: 60px 0;
        --navbar-height: 60px;
    }

    .container {
        padding: 0 20px;
    }

    /* НАВИГАЦИЯ */
    .navbar {
        padding: 0 15px;
    }

    .logo, .nav-logo img {
        height: 40px;
    }

    /* Мобильное меню уже настроено в mobile-optimize.css */
    /* Не переопределяем, чтобы не конфликтовать */

    /* ЗАГОЛОВКИ */
    h1 {
        font-size: 2rem;
        line-height: 1.2;
    }

    h2 {
        font-size: 1.75rem;
        margin-bottom: 20px;
    }

    h3 {
        font-size: 1.3rem;
    }

    p {
        font-size: 0.95rem;
        line-height: 1.6;
    }

    /* HERO СЕКЦИЯ */
    .hero-section {
        min-height: 60vh;
        padding: 100px 0 60px;
    }

    .hero-content {
        text-align: center;
        padding: 0 20px;
    }

    .hero-content h1 {
        font-size: 2.2rem;
        margin-bottom: 15px;
    }

    .hero-content .subtitle {
        font-size: 1rem;
        margin-bottom: 20px;
    }

    .hero-content p {
        font-size: 0.95rem;
        margin-bottom: 25px;
    }

    .hero-buttons {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }

    .hero-buttons .cta-btn,
    .hero-buttons .secondary-btn {
        width: 100%;
        justify-content: center;
    }

    /* СЕТКИ */
    .features-grid,
    .rooms-grid,
    .services-grid,
    .amenities-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* КАРТОЧКИ */
    .room-card,
    .service-card,
    .feature-card {
        margin-bottom: 20px;
    }

    .room-card-image {
        height: 250px;
    }

    .room-card-content {
        padding: 20px;
    }

    .room-price {
        font-size: 1.5rem;
    }

    /* BOOKING WIDGET */
    .booking-widget {
        position: static;
        width: 100%;
        margin: 20px 0;
        border-radius: 15px;
    }

    .booking-form {
        padding: 25px 20px;
    }

    .booking-form-row {
        flex-direction: column;
        gap: 15px;
    }

    .form-group {
        width: 100%;
    }

    .booking-form input,
    .booking-form select {
        font-size: 16px; /* Предотвращает zoom на iOS */
    }

    /* ФОРМЫ */
    .contact-form {
        padding: 25px 20px;
    }

    .form-row {
        flex-direction: column;
    }

    .form-group {
        margin-bottom: 20px;
    }

    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="date"],
    select,
    textarea {
        font-size: 16px; /* Предотвращает zoom на iOS */
        padding: 12px 15px;
    }

    /* КНОПКИ */
    .cta-btn,
    .primary-btn,
    .secondary-btn {
        width: 100%;
        padding: 14px 25px;
        font-size: 1rem;
        text-align: center;
        justify-content: center;
    }

    /* СЕКЦИИ */
    .section {
        padding: 50px 0;
    }

    .section-title {
        font-size: 1.75rem;
        margin-bottom: 15px;
    }

    .section-subtitle {
        font-size: 0.9rem;
        margin-bottom: 30px;
    }

    /* FOOTER */
    footer {
        padding: 40px 0 20px;
    }

    .footer-content {
        flex-direction: column;
        gap: 30px;
        text-align: center;
    }

    .footer-section {
        width: 100%;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    /* СТАТИСТИКА */
    .stats-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .stat-item h3 {
        font-size: 2rem;
    }

    /* ГАЛЕРЕЯ */
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    /* ОТЗЫВЫ */
    .reviews-slider {
        padding: 0 20px;
    }

    .review-card {
        padding: 25px;
    }

    /* МОДАЛЬНЫЕ ОКНА */
    .modal-content {
        width: 95%;
        max-width: none;
        margin: 20px;
        padding: 25px 20px;
    }

    .modal-header h2 {
        font-size: 1.5rem;
    }

    /* ТАБЛИЦЫ */
    table {
        font-size: 0.9rem;
    }

    th, td {
        padding: 10px 8px;
    }

    /* ПОГОДА ВИДЖЕТ */
    .weather-widget {
        padding: 15px;
    }

    /* ЯЗЫКОВОЙ ПЕРЕКЛЮЧАТЕЛЬ */
    .language-switcher {
        position: static;
        margin: 15px 0;
    }
}

/* ============================================
   МАЛЕНЬКИЕ ТЕЛЕФОНЫ (до 480px)
   ============================================ */

@media (max-width: 480px) {
    :root {
        --section-padding: 40px 0;
    }

    .container {
        padding: 0 15px;
    }

    /* ЗАГОЛОВКИ */
    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.2rem;
    }

    p {
        font-size: 0.9rem;
    }

    /* HERO */
    .hero-section {
        min-height: 50vh;
        padding: 80px 0 40px;
    }

    .hero-content h1 {
        font-size: 1.8rem;
    }

    .hero-content .subtitle {
        font-size: 0.9rem;
    }

    .hero-content p {
        font-size: 0.85rem;
    }

    /* КНОПКИ */
    .cta-btn,
    .primary-btn {
        padding: 12px 20px;
        font-size: 0.9rem;
    }

    /* КАРТОЧКИ */
    .room-card-image {
        height: 200px;
    }

    .room-card-content {
        padding: 15px;
    }

    .room-price {
        font-size: 1.3rem;
    }

    /* СЕТКИ */
    .stats-container,
    .gallery-grid {
        grid-template-columns: 1fr;
    }

    /* BOOKING WIDGET */
    .booking-widget {
        padding: 20px 15px;
    }

    .booking-form {
        padding: 20px 15px;
    }

    /* ФОРМЫ */
    input,
    select,
    textarea {
        padding: 10px 12px;
        font-size: 16px;
    }

    /* МОДАЛЬНЫЕ ОКНА */
    .modal-content {
        padding: 20px 15px;
        margin: 10px;
    }

    /* FOOTER */
    footer {
        padding: 30px 0 15px;
    }

    .footer-section h4 {
        font-size: 1.1rem;
    }

    .footer-section p,
    .footer-section a {
        font-size: 0.85rem;
    }

    /* ТАБЛИЦЫ */
    table {
        font-size: 0.8rem;
    }

    th, td {
        padding: 8px 5px;
    }

    /* Скрываем на очень маленьких экранах */
    .hide-on-mobile-xs {
        display: none !important;
    }
}

/* ============================================
   LANDSCAPE РЕЖИМ НА МОБИЛЬНЫХ
   ============================================ */

@media (max-width: 768px) and (orientation: landscape) {
    .hero-section {
        min-height: 100vh;
    }

    .navbar {
        height: 50px;
    }

    .logo {
        height: 35px;
    }
}

/* ============================================
   ОЧЕНЬ БОЛЬШИЕ ЭКРАНЫ (от 1400px)
   ============================================ */

@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }

    .hero-content h1 {
        font-size: 4rem;
    }

    h2 {
        font-size: 2.5rem;
    }
}

/* ============================================
   УЛУЧШЕНИЯ ДЛЯ TOUCH УСТРОЙСТВ
   ============================================ */

@media (hover: none) and (pointer: coarse) {
    /* Увеличиваем область нажатия */
    .nav-menu a,
    .cta-btn,
    .primary-btn,
    .secondary-btn,
    .card,
    .room-card {
        min-height: 44px;
        min-width: 44px;
    }

    /* Убираем hover эффекты */
    .room-card:hover,
    .service-card:hover,
    .cta-btn:hover {
        transform: none;
    }

    /* Добавляем active состояния */
    .cta-btn:active,
    .primary-btn:active {
        transform: scale(0.98);
        opacity: 0.9;
    }
}

/* ============================================
   ACCESSIBILITY IMPROVEMENTS
   ============================================ */

/* Focus states для клавиатурной навигации */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--primary-gold);
    outline-offset: 2px;
}

/* Уменьшение анимаций для пользователей с motion sensitivity */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    .navbar,
    .hamburger,
    .mobile-menu-overlay,
    .booking-widget,
    footer,
    .cta-btn,
    .social-links {
        display: none !important;
    }

    body {
        font-size: 12pt;
        line-height: 1.5;
        color: black;
        background: white;
    }

    a {
        text-decoration: underline;
        color: black;
    }

    img {
        max-width: 100%;
        page-break-inside: avoid;
    }

    h1, h2, h3 {
        page-break-after: avoid;
    }
}
