/**
 * Адаптивный CSS для мобильных устройств
 */

/* Мобильные стили (до 768px) */
@media (max-width: 768px) {
    /* Hero секция на мобильных */
    .hero-section {
        padding: 60px 0 40px !important;
    }
    
    .hero-title {
        font-size: 1.8rem !important;
        line-height: 1.2;
    }
    
    .hero-subtitle {
        font-size: 1rem !important;
        margin-bottom: 2rem !important;
    }
    
    .search-row {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }
    
    .search-button {
        padding: 0.875rem 1.5rem !important;
        font-size: 1rem !important;
    }
    
    /* Карточки коттеджей на мобильных */
    .cottage-card {
        margin-bottom: 1.5rem;
    }
    
    .cottage-image {
        height: 200px !important;
    }
    
    .cottage-hero-section {
        height: 300px !important;
    }
    
    .cottage-hero-overlay {
        background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.4) 50%, rgba(0,0,0,0.2) 100%);
    }
    
    .cottage-hero-thumbnails {
        bottom: 10px !important;
        right: 10px !important;
    }
    
    .thumbnail {
        width: 40px !important;
        height: 30px !important;
    }
    
    /* Статистика на мобильных */
    .feature-box {
        margin-bottom: 1rem;
        padding: 1.5rem;
    }
    
    .feature-icon {
        width: 60px !important;
        height: 60px !important;
        font-size: 1.5rem !important;
        margin-bottom: 1rem;
    }
    
    /* Фильтры на мобильных */
    .sidebar {
        position: relative !important;
        width: 100% !important;
        margin-bottom: 2rem;
    }
    
    .sticky-top {
        position: static !important;
    }
    
    /* Админ-панель на мобильных */
    .admin-nav {
        background: var(--success-green);
        padding: 1rem 0;
        margin-bottom: 1rem;
        border-radius: 0.5rem;
    }
    
    .admin-nav .nav-link {
        padding: 0.5rem 1rem;
        margin-bottom: 0.25rem;
        border-radius: 0.25rem;
        color: white !important;
        background: rgba(255, 255, 255, 0.1);
    }
    
    .admin-nav .nav-link:hover,
    .admin-nav .nav-link.active {
        background: rgba(255, 255, 255, 0.2);
    }
    
    /* Таблицы на мобильных */
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .table td,
    .table th {
        padding: 0.5rem !important;
        vertical-align: middle;
    }
    
    /* Кнопки действий на мобильных */
    .btn-group-sm .btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
        margin: 0.125rem;
    }
    
    /* Формы на мобильных */
    .form-control {
        font-size: 16px; /* Предотвращает zoom в iOS */
    }
    
    .form-check {
        margin-bottom: 0.75rem;
    }
    
    /* Модальные окна на мобильных */
    .modal-dialog {
        margin: 1rem;
        max-width: 95%;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    /* Пагинация на мобильных */
    .pagination {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .page-item {
        margin: 0.25rem;
    }
    
    .page-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
}

/* Маленькие мобильные устройства (до 576px) */
@media (max-width: 576px) {
    .hero-title {
        font-size: 1.5rem !important;
    }
    
    .search-input {
        font-size: 16px !important; /* iOS fix */
        padding: 0.75rem !important;
    }
    
    .cottage-card .card-body {
        padding: 1rem;
    }
    
    .amenities {
        justify-content: flex-start;
    }
    
    .amenity-icon {
        width: 24px !important;
        height: 24px !important;
        font-size: 0.625rem;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .btn-group {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-group .btn {
        margin-bottom: 0.5rem;
        margin-right: 0 !important;
        border-radius: 0.375rem !important;
    }
}

/* Сенсорные экраны (таблицы) */
@media (max-width: 992px) and (orientation: landscape) {
    .hero-section {
        padding: 40px 0 !important;
    }
    
    .hero-title {
        font-size: 2rem !important;
        margin-bottom: 1rem !important;
    }
    
    .search-row {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.5rem !important;
    }
    
    .search-input {
        padding: 0.5rem !important;
        font-size: 0.875rem !important;
    }
}

/* Печать */
@media print {
    .hero-section,
    .navbar,
    .btn,
    .sidebar {
        display: none !important;
    }
    
    .cottage-card,
    .cottage-hero-section {
        page-break-inside: avoid;
    }
    
    .cottage-image {
        max-width: 200px !important;
        max-height: 150px !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
}

/* Дополнительные утилиты для мобильных */
.mobile-only {
    display: none;
}

@media (max-width: 768px) {
    .mobile-only {
        display: block;
    }
    
    .desktop-only {
        display: none !important;
    }
}

/* Улучшения для тач-устройств */
@media (hover: none) and (pointer: coarse) {
    .btn,
    .cottage-card,
    .page-link,
    .nav-link {
        min-height: 44px;
        min-width: 44px;
    }
    
    .form-control,
    .form-select {
        min-height: 44px;
    }
    
    .form-check-input {
        min-width: 20px;
        min-height: 20px;
    }
}

/* Оптимизация для Android */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    select,
    textarea,
    input[type="text"],
    input[type="password"],
    input[type="datetime"],
    input[type="datetime-local"],
    input[type="date"],
    input[type="month"],
    input[type="time"],
    input[type="week"],
    input[type="number"],
    input[type="email"],
    input[type="url"],
    input[type="search"],
    input[type="tel"],
    input[type="color"] {
        font-size: 16px !important;
    }
}