/* Мобильные стили */
/* ===========================================
   СИМФОНИЯ ОКОН — Адаптивность
   Файл: public_html/assets/css/responsive.css
   
   Mobile-first подход:
   - Базовые стили — для мобильных (до 640px)
   - @media (min-width: 640px) — планшеты
   - @media (min-width: 1024px) — десктопы
   - @media (min-width: 1280px) — большие экраны
   - @media (min-width: 1536px) — очень большие экраны
   =========================================== */

/* ===========================================
   1. БРЕЙКПОИНТЫ (переменные для справки)
   =========================================== */
/*
   --breakpoint-sm: 640px;    // Большие мобильные
   --breakpoint-md: 768px;    // Планшеты
   --breakpoint-lg: 1024px;   // Маленькие десктопы
   --breakpoint-xl: 1280px;   // Десктопы
   --breakpoint-2xl: 1536px;  // Большие десктопы
*/

/* ===========================================
   2. МОБИЛЬНЫЕ УСТРОЙСТВА (до 640px)
   =========================================== */

/* Базовые стили для всех мобильных */
@media (max-width: 639px) {
    
    /* Контейнеры */
    .max-w-7xl {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Типографика */
    h1 {
        font-size: 2rem;
        line-height: 1.2;
    }
    
    h2 {
        font-size: 1.75rem;
    }
    
    h3 {
        font-size: 1.25rem;
    }
    
    /* Секции */
    .section {
        padding: 3rem 0;
    }
    
    .section-header {
        margin-bottom: 2rem;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
    
    .section-subtitle {
        font-size: 1rem;
    }
    
    /* Hero */
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .stat-card {
        padding: 0.75rem;
    }
    
    .stat-card .stat-number {
        font-size: 1.5rem;
    }
    
    .stat-card .stat-label {
        font-size: 0.75rem;
    }
    
    /* Категории */
    .category-card {
        height: 16rem !important;
    }
    
    .category-card .category-title {
        font-size: 1.25rem;
    }
    
    .category-card .category-description {
        font-size: 0.75rem;
    }
    
    /* Преимущества */
    .advantage-card {
        padding: 1.5rem;
    }
    
    .advantage-icon {
        width: 3rem;
        height: 3rem;
    }
    
    .advantage-title {
        font-size: 1.125rem;
    }
    
    /* Этапы работы */
    .step-circle {
        width: 3rem;
        height: 3rem;
        font-size: 1.25rem;
    }
    
    /* Профили */
    .profile-card {
        padding: 1.25rem;
    }
    
    .profile-name {
        font-size: 1.25rem;
    }
    
    .profile-price {
        font-size: 1.25rem;
    }
    
    /* Портфолио */
    .portfolio-card {
        height: 16rem;
    }
    
    .portfolio-title {
        font-size: 1.125rem;
    }
    
    .portfolio-description {
        display: none; /* Скрываем описание на мобильных */
    }
    
    /* Отзывы */
    .review-card {
        padding: 1.5rem;
    }
    
    .review-avatar {
        width: 2.5rem;
        height: 2.5rem;
    }
    
    /* Промо */
    .promo-card {
        padding: 1.25rem;
    }
    
    .promo-value {
        font-size: 2.25rem;
    }
    
    .promo-title {
        font-size: 1rem;
    }
    
    /* Калькулятор */
    .calculator-wrapper {
        padding: 1.5rem;
    }
    
    .calculator-result {
        padding: 1.25rem;
    }
    
    /* Контакты */
    .contact-item {
        padding: 0.875rem;
    }
    
    .contact-icon {
        width: 2.5rem;
        height: 2.5rem;
    }
    
    .contact-value {
        font-size: 1rem;
    }
    
    /* Кнопки */
    .btn-primary,
    .btn-secondary {
        padding: 0.875rem 1.5rem;
        font-size: 0.875rem;
    }
    
    /* Модалка */
    #lead-modal .modal-content {
        padding: 1.5rem;
        margin: 1rem;
    }
    
    /* Скрытие десктопных элементов */
    .hidden-mobile {
        display: none !important;
    }
    
    /* Показ мобильных элементов */
    .hidden-desktop {
        display: block !important;
    }
}

/* ===========================================
   3. БОЛЬШИЕ МОБИЛЬНЫЕ (640px - 767px)
   =========================================== */
@media (min-width: 640px) and (max-width: 767px) {
    
    .section {
        padding: 3.5rem 0;
    }
    
    .section-header {
        margin-bottom: 2.5rem;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .stat-card .stat-number {
        font-size: 1.75rem;
    }
    
    .category-card {
        height: 18rem !important;
    }
    
    .portfolio-card {
        height: 18rem;
    }
    
    .promo-value {
        font-size: 2.5rem;
    }
}

/* ===========================================
   4. ПЛАНШЕТЫ (768px - 1023px)
   =========================================== */
@media (min-width: 768px) and (max-width: 1023px) {
    
    /* Контейнеры */
    .max-w-7xl {
        padding-left: 2rem;
        padding-right: 2rem;
    }
    
    /* Секции */
    .section {
        padding: 4rem 0;
    }
    
    .section-header {
        margin-bottom: 3rem;
    }
    
    /* Hero */
    .hero-title {
        font-size: 3rem;
    }
    
    .hero-subtitle {
        font-size: 1.125rem;
    }
    
    /* Категории */
    .category-card {
        height: 20rem !important;
    }
    
    /* Преимущества */
    .advantage-card {
        padding: 1.75rem;
    }
    
    /* Портфолио */
    .portfolio-card {
        height: 20rem;
    }
    
    .portfolio-description {
        display: block; /* Показываем описание на планшетах */
    }
    
    /* Отзывы */
    .review-card {
        padding: 1.75rem;
    }
    
    /* Промо */
    .promo-value {
        font-size: 2.75rem;
    }
    
    /* Калькулятор */
    .calculator-wrapper {
        padding: 2rem;
    }
    
    /* Скрытие/показ */
    .hidden-tablet {
        display: none !important;
    }
    
    .hidden-desktop {
        display: none !important;
    }
}

/* ===========================================
   5. МАЛЕНЬКИЕ ДЕСКТОПЫ (1024px - 1279px)
   =========================================== */
@media (min-width: 1024px) and (max-width: 1279px) {
    
    /* Секции */
    .section {
        padding: 5rem 0;
    }
    
    .section-header {
        margin-bottom: 4rem;
    }
    
    /* Hero */
    .hero-title {
        font-size: 3.5rem;
    }
    
    /* Категории */
    .category-card {
        height: 22rem !important;
    }
    
    /* Портфолио */
    .portfolio-card {
        height: 22rem;
    }
    
    /* Промо */
    .promo-value {
        font-size: 3rem;
    }
    
    /* Скрытие/показ */
    .hidden-desktop {
        display: none !important;
    }
}

/* ===========================================
   6. ДЕСКТОПЫ (1280px - 1535px)
   =========================================== */
@media (min-width: 1280px) and (max-width: 1535px) {
    
    /* Базовые стили из main.css работают здесь */
    
    .hero-title {
        font-size: 3.75rem;
    }
    
    .category-card {
        height: 24rem !important;
    }
    
    .portfolio-card {
        height: 20rem;
    }
}

/* ===========================================
   7. БОЛЬШИЕ ДЕСКТОПЫ (1536px+)
   =========================================== */
@media (min-width: 1536px) {
    
    /* Увеличиваем контейнер */
    .max-w-7xl {
        max-width: 90rem;
    }
    
    /* Увеличиваем типографику */
    .hero-title {
        font-size: 4.5rem;
    }
    
    .section-title {
        font-size: 3.5rem;
    }
    
    /* Увеличиваем отступы */
    .section {
        padding: 6rem 0;
    }
    
    .category-card {
        height: 26rem !important;
    }
    
    .portfolio-card {
        height: 24rem;
    }
}

/* ===========================================
   8. ОРИЕНТАЦИЯ ЭКРАНА
   =========================================== */

/* Альбомная ориентация на мобильных */
@media (max-width: 639px) and (orientation: landscape) {
    
    .hero-title {
        font-size: 1.75rem;
    }
    
    .section {
        padding: 2rem 0;
    }
    
    .category-card {
        height: 14rem !important;
    }
    
    .portfolio-card {
        height: 14rem;
    }
}

/* ===========================================
   9. ВЫСОТНЫЕ ЭКРАНЫ (для мобильных)
   =========================================== */

/* Короткие экраны (до 600px высоты) */
@media (max-height: 599px) {
    
    .hero-title {
        font-size: 1.75rem;
    }
    
    .section {
        padding: 2rem 0;
    }
    
    .stat-card {
        padding: 0.5rem;
    }
    
    .stat-card .stat-number {
        font-size: 1.25rem;
    }
}

/* ===========================================
   10. СЕТКИ (GRID) — АДАПТИВНОСТЬ
   =========================================== */

/* Мобильные: 1 колонка */
.grid-responsive-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.grid-responsive-3 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.grid-responsive-4 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

/* Планшеты: 2 колонки */
@media (min-width: 768px) {
    .grid-responsive-2 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .grid-responsive-3 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .grid-responsive-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Десктопы: полное количество колонок */
@media (min-width: 1024px) {
    .grid-responsive-2 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .grid-responsive-3 {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .grid-responsive-4 {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ===========================================
   11. FLEXBOX — АДАПТИВНОСТЬ
   =========================================== */

/* Мобильные: вертикальное расположение */
.flex-responsive {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Планшеты и десктопы: горизонтальное */
@media (min-width: 768px) {
    .flex-responsive {
        flex-direction: row;
        align-items: center;
    }
}

/* ===========================================
   12. МОБИЛЬНОЕ МЕНЮ — ДОПОЛНИТЕЛЬНЫЕ СТИЛИ
   =========================================== */

@media (max-width: 1023px) {
    
    /* Полноэкранное меню на мобильных */
    #mobile-menu {
        position: fixed;
        top: 5rem;
        left: 0;
        right: 0;
        bottom: 0;
        background: white;
        z-index: 40;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Анимация появления */
    #mobile-menu:not(.hidden) {
        animation: slideDown 0.3s ease;
    }
    
    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    /* Увеличиваем кликабельные области */
    #mobile-menu a,
    #mobile-menu button {
        min-height: 44px; /* Рекомендация Apple для touch-targets */
    }
    
    /* Раскрывающиеся разделы */
    #mobile-windows-section {
        transition: max-height 0.3s ease;
        overflow: hidden;
    }
    
    #mobile-windows-section:not(.hidden) {
        max-height: 500px;
    }
}

/* ===========================================
   13. ШАПКА — АДАПТИВНОСТЬ
   =========================================== */

@media (max-width: 1023px) {
    
    /* Уменьшаем высоту шапки на мобильных */
    #site-header {
        height: 4rem;
    }
    
    #site-header .h-20 {
        height: 4rem;
    }
    
    /* Отступ под шапкой */
    .h-20[aria-hidden="true"] {
        height: 4rem;
    }
}

/* ===========================================
   14. ФУТЕР — АДАПТИВНОСТЬ
   =========================================== */

@media (max-width: 767px) {
    
    /* Уменьшаем отступы в футере */
    footer {
        padding-top: 3rem;
        padding-bottom: 2rem;
    }
    
    footer .grid > div {
        margin-bottom: 2rem;
    }
    
    /* Кнопка "Заказать звонок" на всю ширину */
    footer button {
        width: 100%;
    }
}

/* ===========================================
   15. ИЗОБРАЖЕНИЯ — АДАПТИВНОСТЬ
   =========================================== */

/* Lazy loading для изображений */
img[data-src] {
    opacity: 0;
    transition: opacity 0.3s ease;
}

img[data-src].loaded,
img:not([data-src]) {
    opacity: 1;
}

/* Запрет растягивания изображений */
img {
    max-width: 100%;
    height: auto;
}

/* ===========================================
   16. ФОРМЫ — АДАПТИВНОСТЬ
   =========================================== */

@media (max-width: 639px) {
    
    /* Увеличиваем размер шрифта в полях (чтобы iOS не зумил) */
    input,
    textarea,
    select {
        font-size: 16px; /* Минимум 16px для iOS */
    }
    
    /* Увеличиваем отступы в полях */
    .form-input,
    .calc-input {
        padding: 0.875rem 1rem;
    }
}

/* ===========================================
   17. КНОПКИ — АДАПТИВНОСТЬ
   =========================================== */

@media (max-width: 639px) {
    
    /* Кнопки на всю ширину на мобильных */
    .btn-full-mobile {
        width: 100%;
    }
    
    /* Уменьшаем размер шрифта */
    .btn-primary,
    .btn-secondary {
        font-size: 0.875rem;
    }
}

/* ===========================================
   18. МОДАЛКА — АДАПТИВНОСТЬ
   =========================================== */

@media (max-width: 639px) {
    
    /* Модалка на весь экран на мобильных */
    #lead-modal .modal-content {
        max-width: 100%;
        margin: 0;
        border-radius: 0;
        min-height: 100vh;
    }
    
    /* Убираем скругления */
    #lead-modal .modal-content {
        border-radius: 1rem 1rem 0 0;
        margin-top: auto;
    }
    
    /* Центрируем по вертикали */
    #lead-modal .relative {
        align-items: flex-end;
    }
}

/* ===========================================
   19. TOAST — АДАПТИВНОСТЬ
   =========================================== */

@media (max-width: 639px) {
    
    /* Toast на всю ширину на мобильных */
    #toast {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
    }
}

/* ===========================================
   20. КНОПКА "НАВЕРХ" — АДАПТИВНОСТЬ
   =========================================== */

@media (max-width: 639px) {
    
    /* Уменьшаем размер кнопки */
    #scroll-to-top {
        width: 3rem;
        height: 3rem;
        bottom: 1rem;
        right: 1rem;
    }
}

/* ===========================================
   21. ПЕЧАТНАЯ ВЕРСИЯ — УЛУЧШЕНИЯ
   =========================================== */

@media print {
    
    /* Убираем все фоны */
    * {
        background: white !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
    
    /* Чёрный текст */
    body {
        color: black;
        font-size: 12pt;
    }
    
    /* Ссылки */
    a {
        color: black;
        text-decoration: underline;
    }
    
    /* Показываем URL ссылок */
    a[href^="http"]:after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }
    
    /* Изображения */
    img {
        page-break-inside: avoid;
    }
    
    /* Заголовки */
    h1, h2, h3, h4 {
        page-break-after: avoid;
    }
    
    /* Таблицы */
    table {
        border-collapse: collapse;
    }
    
    table td, table th {
        border: 1px solid #ddd;
    }
    
    /* Избегаем разрывов страниц внутри блоков */
    .section,
    .card,
    .portfolio-card {
        page-break-inside: avoid;
    }
    
    /* Поля страницы */
    @page {
        margin: 2cm;
    }
}

/* ===========================================
   22. ТЁМНАЯ ТЕМА (опционально, для будущих доработок)
   =========================================== */

@media (prefers-color-scheme: dark) {
    
    /* Пока не используем, но готовим основу */
    /* Можно раскомментировать и доработать в будущем */
    
    /*
    :root {
        --color-bg: #0f172a;
        --color-text: #e2e8f0;
        --color-border: #334155;
    }
    */
}

/* ===========================================
   23. УВЕЛИЧЕННАЯ АНИМАЦИЯ (доступность)
   =========================================== */

/* Уважение к настройкам пользователя */
@media (prefers-reduced-motion: reduce) {
    
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* ===========================================
   24. ВЫСОКИЙ КОНТРАСТ (доступность)
   =========================================== */

@media (prefers-contrast: high) {
    
    /* Увеличиваем контрастность */
    .btn-primary {
        border: 2px solid white;
    }
    
    .nav-link::after {
        height: 3px;
    }
    
    /* Убираем прозрачности */
    .hero-overlay {
        background: rgba(30, 58, 95, 0.95);
    }
}

/* ===========================================
   25. УТИЛИТЫ: АДАПТИВНЫЕ КЛАССЫ
   =========================================== */

/* Скрытие на разных экранах */
@media (max-width: 639px) {
    .sm\:hidden { display: none !important; }
    .sm\:block { display: block !important; }
    .sm\:flex { display: flex !important; }
    .sm\:grid { display: grid !important; }
}

@media (min-width: 640px) and (max-width: 767px) {
    .md\:hidden { display: none !important; }
    .md\:block { display: block !important; }
    .md\:flex { display: flex !important; }
    .md\:grid { display: grid !important; }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .lg\:hidden { display: none !important; }
    .lg\:block { display: block !important; }
    .lg\:flex { display: flex !important; }
    .lg\:grid { display: grid !important; }
}

@media (min-width: 1024px) {
    .xl\:hidden { display: none !important; }
    .xl\:block { display: block !important; }
    .xl\:flex { display: flex !important; }
    .xl\:grid { display: grid !important; }
}