/* Мобильная адаптация для SANANDREO */

/* Бургер-меню должно быть скрыто только на экранах больше 768px */
@media (min-width: 769px) {
    .mobile-menu-toggle {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }
    
    /* Мобильное меню и overlay тоже скрыты на desktop */
    .mobile-menu {
        display: none !important;
        visibility: hidden !important;
    }
    
    .mobile-menu-overlay {
        display: none !important;
        visibility: hidden !important;
    }
}

/* Основные media queries */
@media (max-width: 768px) {
    
    /* Показываем бургер-меню только на мобильных */
    .mobile-menu-toggle {
        display: flex !important;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        width: 32px;
        height: 32px;
        background: none;
        border: none;
        cursor: pointer;
        padding: 0;
        z-index: 1001;
        transition: all 0.3s ease;
    }
    
    .mobile-menu-toggle span {
        display: block;
        width: 24px;
        height: 3px;
        background: #1976d2;
        border-radius: 2px;
        transition: all 0.3s ease;
        transform-origin: center;
    }
    
    .mobile-menu-toggle span:not(:last-child) {
        margin-bottom: 4px;
    }
    
    /* Скрываем desktop навигацию */
    .header-contacts {
        display: none;
    }
    
    .main-navigation {
        display: none;
    }
    
    /* Адаптируем хедер для мобильных */
    .header-top-row {
        padding: 0 16px;
        height: 60px;
        position: relative;
    }
    
    .logo-container .logo {
        font-size: 24px;
        font-weight: 800;
    }
    
    /* Анимация бургера в крестик */
    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(6px, 6px);
    }
    
    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
        transform: translateX(-20px);
    }
    
    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px);
    }
    
    /* Мобильное меню */
    .mobile-menu {
        position: fixed;
        top: 0;
        left: -100%;
        width: 280px;
        height: 100vh;
        background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
        box-shadow: 4px 0 32px rgba(0, 0, 0, 0.15);
        transition: left 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
        z-index: 1000;
        overflow-y: auto;
    }
    
    .mobile-menu.active {
        left: 0;
    }
    
    .mobile-menu-header {
        padding: 20px;
        background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
        color: white;
        text-align: center;
    }
    
    .mobile-menu-header .logo {
        font-size: 22px;
        font-weight: 800;
        color: white;
        text-decoration: none;
        letter-spacing: 1.5px;
    }
    
    .mobile-menu-nav {
        padding: 24px 0;
    }
    
    .mobile-menu-nav ul {
        list-style: none;
        margin: 0;
        padding: 0;
    }
    
    .mobile-menu-nav li {
        border-bottom: 1px solid #f1f5f9;
    }
    
    .mobile-menu-nav li:last-child {
        border-bottom: none;
    }
    
    .mobile-menu-nav a {
        display: flex;
        align-items: center;
        padding: 16px 24px;
        color: #334155;
        text-decoration: none;
        font-weight: 500;
        font-size: 16px;
        transition: all 0.3s ease;
    }
    
    .mobile-menu-nav a:hover {
        background: #f8fafc;
        color: #1976d2;
        padding-left: 32px;
    }
    
    /* Скрываем красный badge в мобильном меню когда корзина пуста */
    .mobile-menu-nav .cart-badge {
        display: none;
    }
    
    .mobile-menu-nav .cart-badge:not(:empty) {
        display: inline-block;
        background: #1976d2;
        color: white;
        border-radius: 50%;
        padding: 2px 6px;
        font-size: 11px;
        font-weight: bold;
        margin-left: 8px;
    }
    
    .mobile-menu-nav i {
        margin-right: 12px;
        font-size: 18px;
        width: 20px;
        text-align: center;
        color: #64748b;
    }
    
    .mobile-menu-nav a:hover i {
        color: #1976d2;
    }
    
    /* Контакты в мобильном меню */
    .mobile-menu-contacts {
        padding: 20px 24px;
        background: #f8fafc;
        border-top: 1px solid #e2e8f0;
        margin-top: auto;
    }
    
    .mobile-menu-contacts h4 {
        margin: 0 0 16px 0;
        font-size: 14px;
        font-weight: 600;
        color: #475569;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
    
    .mobile-contact-item {
        display: flex;
        align-items: center;
        margin-bottom: 12px;
        font-size: 14px;
        color: #64748b;
    }
    
    .mobile-contact-item:last-child {
        margin-bottom: 0;
    }
    
    .mobile-contact-item i {
        margin-right: 10px;
        font-size: 16px;
        width: 18px;
        text-align: center;
        color: #1976d2;
    }
    
    /* Overlay для мобильного меню */
    .mobile-menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(4px);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 999;
    }
    
    .mobile-menu-overlay.active {
        opacity: 1;
        visibility: visible;
    }
    
    /* Адаптируем hero секцию для мобильных */
    .hero-section {
        min-height: 400px;
        padding: 80px 0 60px 0;
        position: relative;
        background: linear-gradient(135deg, #4f8ef7 0%, #2563eb 100%);
        overflow: hidden;
    }
    
    .hero-content h1 {
        font-size: 28px;
        line-height: 1.2;
        margin: 0 0 20px 0;
        font-weight: 600;
        text-shadow: none;
        color: white;
        text-align: center;
        width: 100%;
        letter-spacing: -0.5px;
    }
    
    .hero-content p {
        font-size: 18px;
        margin: 0 0 40px 0;
        line-height: 1.4;
        opacity: 0.9;
        text-shadow: none;
        color: white;
        text-align: center;
        width: 100%;
        font-weight: 400;
    }
    
    .hero-features {
        gap: 12px;
        margin-top: 0;
    }
    
    .feature-item {
        padding: 16px 12px;
        min-width: 75px;
        border-radius: 14px;
    }
    
    .feature-item i {
        font-size: 20px;
        margin-bottom: 8px;
    }
    
    .feature-item span {
        font-size: 12px;
        font-weight: 500;
    }
    
    /* Отключаем анимации на мобильных для производительности */
    .hero-background-animation {
        display: none !important;
    }
    
    .hero-photo-carousel {
        display: none; /* Скрываем слайдер на мобильных */
    }
    
    .hero-overlay {
        background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.2) 100%);
        z-index: 2;
    }
    
    .hero-content {
        position: relative;
        z-index: 3;
        text-align: center;
        color: white;
        padding: 0;
        margin: 0;
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }
    
    .hero-content .container {
        padding: 0 20px !important;
        margin: 0 !important;
        width: 100%;
        max-width: 600px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
    }
    
    .hero-content h1 {
        font-size: 28px;
        line-height: 1.2;
        margin: 0 0 20px 0;
        font-weight: 600;
        text-shadow: none;
        color: white;
        text-align: center;
        width: 100%;
        letter-spacing: -0.5px;
    }
    
    .hero-content p {
        font-size: 18px;
        margin: 0 0 40px 0;
        line-height: 1.4;
        opacity: 0.9;
        text-shadow: none;
        color: white;
        text-align: center;
        width: 100%;
        font-weight: 400;
    }
    
    .hero-features {
        display: flex;
        flex-direction: row;
        justify-content: center;
        gap: 16px;
        align-items: center;
        margin-top: 0;
        flex-wrap: wrap;
        max-width: 100%;
    }
    
    .feature-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        width: auto;
        min-width: 90px;
        background: rgba(255, 255, 255, 0.1);
        backdrop-filter: blur(20px);
        border-radius: 16px;
        padding: 20px 16px;
        border: 1px solid rgba(255, 255, 255, 0.15);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    }
    
    .feature-item:hover {
        background: rgba(255, 255, 255, 0.2);
        transform: translateY(-4px);
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    }
    
    .feature-item i {
        font-size: 24px;
        margin-bottom: 12px;
        color: #ffffff;
        filter: none;
    }
    
    .feature-item span {
        font-size: 13px;
        font-weight: 500;
        color: rgba(255, 255, 255, 0.95);
    }
    
    /* Адаптируем фильтры для мобильных */
    .filter-tab {
        position: fixed;
        bottom: 20px;
        right: 20px;
        top: auto;
        transform: none;
        border-radius: 50%;
        width: 56px;
        height: 56px;
        min-width: unset;
        max-width: unset;
        box-shadow: 0 4px 20px rgba(52, 152, 219, 0.4);
    }
    
    .filter-tab .filter-arrow {
        display: block;
        font-size: 16px;
        margin-bottom: 0;
    }
    
    .filter-tab .filter-text {
        display: none;
    }
    
    .filter-tab::before {
        display: none;
    }
    
    .filter-panel {
        width: 100%;
        right: -100%;
        border-radius: 20px 20px 0 0;
        height: 80vh;
        top: 20vh;
    }
    
    .filter-panel.open {
        right: 0;
    }
    
    .filter-panel-header {
        border-radius: 20px 20px 0 0;
        padding: 20px;
    }
    
    .filter-panel-content {
        padding: 20px;
        height: calc(80vh - 80px);
    }
    
    /* Адаптируем товары */
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
        padding: 0 16px;
    }
    
    .product-card {
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    }
    
    .product-info {
        padding: 12px 15px;
    }
    
    .product-info h3 {
        font-size: 14px;
        line-height: 1.4;
        margin-left: 6px;
    }
    
    .product-price {
        font-size: 16px;
        margin-left: 6px;
    }
    
    .product-article,
    .product-brand,
    .product-availability {
        margin-left: 6px;
    }

    .add-to-cart {
        padding: 8px 12px;
        font-size: 12px;
        background-color: #007bff;
        margin: 0 15px 12px 15px;
        width: calc(100% - 30px);
    }
    
    .add-to-cart:hover {
        background-color: #0056b3;
    }
    
    /* Адаптируем модальные окна */
    .modal-content {
        width: 95%;
        max-width: 95%;
        margin: 5% auto;
        padding: 20px;
        border-radius: 16px;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    /* Специальная адаптация для модального окна товара */
    .product-modal-content {
        width: 95% !important;
        max-width: 95% !important;
        margin: 2% auto !important;
        padding: 16px !important;
        max-height: 96vh !important;
    }
    
    .product-details {
        flex-direction: column !important;
        gap: 16px !important;
    }
    
    .product-image {
        width: 100% !important;
        max-width: none !important;
        text-align: center;
    }
    
    .product-image img {
        width: 100% !important;
        max-width: 280px !important;
        height: auto !important;
        border-radius: 12px;
    }
    
    .product-info {
        width: 100% !important;
        padding: 0 !important;
    }
    
    .product-info h2 {
        font-size: 18px !important;
        line-height: 1.3 !important;
        margin-bottom: 12px !important;
        word-wrap: break-word !important;
        hyphens: auto !important;
    }
    
    .product-article,
    .product-brand-modal,
    .product-availability-modal {
        font-size: 14px !important;
        margin-bottom: 8px !important;
        word-wrap: break-word !important;
    }
    
    .product-price {
        font-size: 20px !important;
        margin-bottom: 16px !important;
        font-weight: 700 !important;
    }
    
    .product-description {
        margin-top: 20px !important;
        padding-top: 20px !important;
        border-top: 1px solid #e2e8f0 !important;
    }
    
    .product-description h3 {
        font-size: 16px !important;
        margin-bottom: 12px !important;
    }
    
    .product-description p {
        font-size: 14px !important;
        line-height: 1.5 !important;
        word-wrap: break-word !important;
        hyphens: auto !important;
    }
    
    /* Адаптация кнопки в модальном окне */
    .product-modal-content .add-to-cart {
        width: 100% !important;
        padding: 12px 16px !important;
        font-size: 16px !important;
        margin-top: 16px !important;
        border-radius: 12px !important;
    }
    
    /* Адаптируем поисковое модальное окно */
    .search-modal-content {
        width: 95%;
        margin: 2% auto;
        padding: 16px;
        max-height: 96vh;
    }
    
    .search-modal-content h2 {
        font-size: 20px;
        margin-bottom: 16px;
    }
    
    .search-input-container {
        flex-direction: column;
        gap: 12px;
    }
    
    .search-input-container input {
        width: 100%;
        font-size: 16px; /* Предотвращает zoom на iOS */
        padding: 12px 16px;
    }
    
    .search-input-container button {
        width: 100%;
        padding: 12px;
    }
    
    .search-results-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    /* Адаптируем корзину */
    .modern-cart-item {
        padding: 12px;
        grid-template-columns: 60px 1fr auto;
        gap: 12px;
    }
    
    .modern-cart-item-img {
        width: 60px;
        height: 60px;
    }
    
    .modern-cart-item-title {
        font-size: 14px;
    }
    
    .modern-cart-item-price {
        font-size: 14px;
    }
    
    .modern-qty-btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .modern-qty-input {
        width: 50px;
        height: 32px;
        font-size: 14px;
    }
    
    /* Адаптируем чат - Новый синий-белый дизайн */
    .chat-modal .modal-content {
        width: 96%;
        height: 85vh;
        margin: 1vh auto;
        border-radius: 12px;
        background: #ffffff;
        box-shadow: 0 20px 40px rgba(0, 123, 255, 0.08);
        border: 1px solid rgba(0, 123, 255, 0.1);
        display: flex;
        flex-direction: column;
    }

    .chat-modal-content h3 {
        padding: 16px 18px;
        font-size: 1.1rem;
        background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
        color: white;
        border-radius: 12px 12px 0 0;
        margin: 0;
        font-weight: 600;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
    }
    
    .chat-messages {
        height: calc(85vh - 140px);
        flex: 1;
        padding: 16px;
        background: #fafbfc;
        overflow-y: auto;
        scrollbar-width: thin;
        scrollbar-color: rgba(0, 123, 255, 0.2) transparent;
    }

    .chat-message {
        max-width: 80%;
        padding: 10px 14px;
        font-size: 0.9rem;
        margin-bottom: 12px;
        border-radius: 14px;
        word-wrap: break-word;
        line-height: 1.4;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    }

    .chat-message.user {
        background: #007bff;
        color: white;
        margin-left: auto;
        border-bottom-right-radius: 4px;
    }

    .chat-message.admin {
        background: #ffffff;
        color: #495057;
        border: 1px solid #e9ecef;
        margin-right: auto;
        border-bottom-left-radius: 4px;
    }

    .chat-message.system {
        background: #f8f9fa;
        color: #6c757d;
        text-align: center;
        max-width: 100%;
        border-radius: 10px;
        font-style: italic;
    }

    .chat-input-area {
        padding: 12px 16px;
        background: #ffffff;
        border-top: 1px solid #e9ecef;
        display: flex;
        gap: 8px;
        align-items: flex-end;
    }
    
    .chat-input-area textarea {
        flex: 1;
        min-height: 36px;
        max-height: 80px;
        font-size: 16px; /* Предотвращает zoom на iOS */
        padding: 10px 14px;
        border: 1px solid #ced4da;
        border-radius: 18px;
        background: #ffffff;
        resize: none;
        font-family: inherit;
        line-height: 1.3;
        transition: all 0.2s ease;
    }

    .chat-input-area textarea:focus {
        outline: none;
        border-color: #007bff;
        box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.1);
    }

    .chat-input-area textarea::placeholder {
        color: #adb5bd;
    }

    .chat-input-area button {
        width: 36px;
        height: 36px;
        min-width: 36px;
        background: #007bff;
        color: white;
        border: none;
        border-radius: 50%;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.2s ease;
        box-shadow: 0 2px 6px rgba(0, 123, 255, 0.2);
    }

    .chat-input-area button:hover {
        background: #0056b3;
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
    }

    .chat-input-area button:disabled {
        background: #adb5bd;
        cursor: not-allowed;
        transform: none;
        box-shadow: none;
    }

    .chat-close-btn {
        position: absolute;
        top: 12px;
        right: 16px;
        background: rgba(255, 255, 255, 0.2);
        color: white;
        border: none;
        border-radius: 50%;
        width: 28px;
        height: 28px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        font-size: 1rem;
        transition: all 0.2s ease;
        z-index: 10;
    }

    .chat-close-btn:hover {
        background: rgba(255, 255, 255, 0.3);
        transform: rotate(90deg);
    }

    /* Welcome экран для мобильных */
    .chat-welcome {
        text-align: center;
        padding: 30px 16px;
        color: #6c757d;
    }

    .chat-welcome-icon i {
        font-size: 3rem;
        color: #007bff;
        opacity: 0.8;
        margin-bottom: 16px;
        display: block;
    }

    .chat-welcome h3 {
        font-size: 1.2rem;
        color: #495057;
        margin-bottom: 8px;
        font-weight: 600;
    }

    .chat-welcome p {
        font-size: 0.9rem;
        color: #6c757d;
        line-height: 1.4;
        margin: 0;
    }
    
    /* Улучшаем контейнеры */
    .container {
        padding: 0 16px;
    }
    
    /* Категории */
    .category-header {
        padding: 20px 0;
    }
    
    .category-header h1 {
        font-size: 24px;
    }
    
    .breadcrumbs {
        font-size: 14px;
    }
}

/* Для очень маленьких экранов */
@media (max-width: 480px) {
    .header-top-row {
        padding: 0 12px;
        height: 56px;
    }
    
    .logo-container .logo {
        font-size: 20px;
    }
    
    .header-actions {
        gap: 16px;
    }
    
    .header-icon {
        font-size: 20px;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
        padding: 0 12px;
    }
    
    .hero-content h1 {
        font-size: 24px;
    }
    
    .filter-panel {
        height: 85vh;
        top: 15vh;
    }
    
    .filter-panel-content {
        height: calc(85vh - 80px);
        padding: 16px;
    }
    
    .container {
        padding: 0 12px;
    }
    
    .hero-section {
        min-height: 300px;
        padding: 50px 0 35px 0;
    }
    
    .hero-content h1 {
        font-size: 20px;
        margin-bottom: 12px;
    }
    
    .hero-content p {
        font-size: 14px;
        margin-bottom: 25px;
        max-width: 280px;
    }
    
    .hero-features {
        gap: 16px;
        margin-top: 20px;
    }
    
    .feature-item {
        padding: 14px 10px;
        min-width: 70px;
    }
    
    .feature-item i {
        font-size: 18px;
        margin-bottom: 6px;
    }
    
    .feature-item span {
        font-size: 12px;
    }
    
    /* Уменьшаем шарики для совсем маленьких экранов */
    .hero-background-animation .blob:nth-child(1) {
        width: 45px;
        height: 45px;
    }
    
    .hero-background-animation .blob:nth-child(2) {
        width: 30px;
        height: 30px;
    }
    
    .hero-background-animation .blob:nth-child(3) {
        width: 60px;
        height: 60px;
    }
    
    .hero-background-animation .blob:nth-child(4) {
        width: 25px;
        height: 25px;
    }
    
    /* Адаптация хедера для маленьких экранов */
    .site-header .container {
        padding: 0 12px;
    }
    
    .logo {
        font-size: 20px !important;
    }
    
    .mobile-menu-toggle {
        width: 28px;
        height: 28px;
    }
    
    .mobile-menu-toggle span {
        width: 20px;
        height: 2px;
    }
    
    .breadcrumbs {
        font-size: 14px;
    }
    
    /* Адаптация мобильного меню */
    .mobile-menu {
        width: 280px;
    }
    
    .mobile-menu-nav a {
        padding: 12px 20px;
        font-size: 15px;
    }
    
    .mobile-menu-nav i {
        font-size: 16px;
    }
    
    .mobile-menu-contacts {
        padding: 16px 20px;
    }
    
    /* Адаптация фильтров */
    .filter-tab {
        bottom: 80px;
        right: 16px;
        width: 48px;
        height: 48px;
        border-radius: 50%;
        padding: 0;
        min-width: auto;
        max-width: none;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .filter-tab .filter-arrow {
        font-size: 18px;
        margin-bottom: 0;
    }
    
    .filter-tab .filter-text {
        display: none;
    }
    
    /* Адаптация модального окна товара для маленьких экранов */
    .product-modal-content {
        margin: 1% auto !important;
        padding: 12px !important;
        max-height: 98vh !important;
    }
    
    .product-info h2 {
        font-size: 16px !important;
    }
    
    .product-price {
        font-size: 18px !important;
    }
}

/* Горизонтальная ориентация на мобильных */
@media (max-width: 768px) and (orientation: landscape) {
    .hero-section {
        min-height: 200px;
        padding: 40px 0;
    }
    
    .filter-panel {
        height: 90vh;
        top: 10vh;
    }
    
    .filter-panel-content {
        height: calc(90vh - 80px);
    }
}

/* Touch-friendly улучшения */
@media (hover: none) and (pointer: coarse) {
    .header-icon {
        padding: 8px;
        min-height: 44px;
        min-width: 44px;
    }
    
    .mobile-menu-nav a {
        min-height: 48px;
        padding: 16px 24px;
    }
    
    .add-to-cart {
        min-height: 44px;
        padding: 12px 16px;
    }
    
    .filter-tab {
        width: 64px;
        height: 64px;
    }
    
    .modern-qty-btn {
        min-height: 44px;
        min-width: 44px;
    }
}

/* Дополнительные стили для клавиатуры */
.keyboard-open .modal-content {
    max-height: 50vh;
    margin-top: 10px;
}

.keyboard-open .chat-modal .modal-content {
    height: 50vh;
    margin: 10px auto;
}

.keyboard-open .filter-panel {
    height: 50vh;
    top: 0;
}

/* Стили для touch устройств */
.touch-device button:hover {
    background-color: inherit;
}

.touch-device button:active {
    transform: scale(0.98);
}

/* Стили для улучшения производительности на мобильных */
@media (max-width: 768px) {
    * {
        -webkit-tap-highlight-color: transparent;
    }
    
    /* Полностью скрываем все анимации и шарики */
    .hero-background-animation,
    .hero-background-animation *,
    .blob {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
    }
    
    /* Оптимизация анимаций для мобильных */
    .filter-panel,
    .mobile-menu {
        will-change: transform;
    }
    
    /* Скрыть скроллбары на мобильных */
    ::-webkit-scrollbar {
        width: 0px;
        background: transparent;
    }
}

/* PWA стили для полноэкранного режима */
@media (display-mode: standalone) {
    .site-header {
        padding-top: env(safe-area-inset-top);
    }
    
    .mobile-menu {
        top: env(safe-area-inset-top);
        height: calc(100vh - env(safe-area-inset-top));
    }
    
    .filter-panel {
        top: calc(20vh + env(safe-area-inset-top));
        height: calc(80vh - env(safe-area-inset-top));
    }
}

/* Базовые стили для мобильных устройств */
.mobile-menu-toggle {
    display: flex;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
    transition: all 0.3s ease;
}

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

.mobile-menu-toggle span:not(:last-child) {
    margin-bottom: 4px;
}

.mobile-menu {
    position: fixed;
    top: 0;
    left: -100%;
    width: 280px;
    height: 100vh;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 4px 0 32px rgba(0, 0, 0, 0.15);
    transition: left 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 1000;
    overflow-y: auto;
}

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
}

/* Чат для экстра маленьких экранов */
.chat-modal .modal-content {
    width: 98%;
    height: 90vh;
    margin: 0.5vh auto;
    border-radius: 8px;
}

.chat-modal-content h3 {
    padding: 14px 16px;
    font-size: 1rem;
    border-radius: 8px 8px 0 0;
}

.chat-messages {
    padding: 12px;
    height: calc(90vh - 130px);
}

.chat-message {
    max-width: 85%;
    margin-bottom: 10px;
    padding: 8px 12px;
    font-size: 0.85rem;
}

.chat-input-area {
    padding: 10px 12px;
    gap: 6px;
}

.chat-input-area textarea {
    padding: 8px 12px;
    border-radius: 16px;
    min-height: 32px;
    max-height: 70px;
    font-size: 16px;
}

.chat-input-area button {
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
}

.chat-close-btn {
    top: 10px;
    right: 12px;
    width: 24px;
    height: 24px;
    font-size: 0.9rem;
}

.chat-welcome {
    padding: 20px 12px;
}

.chat-welcome-icon i {
    font-size: 2.5rem;
}

.chat-welcome h3 {
    font-size: 1.1rem;
}

.chat-welcome p {
    font-size: 0.85rem;
} 