/* ================================================================
   BOOKING ENGINE - RESPONSIVE MOBILE CSS (CORRETTO)
   Aggiungi questo alla fine del file booking.css DOPO la riga 1271
   ================================================================ */

/* ========================================
   MEDIA QUERIES - MOBILE RESPONSIVE
   (Questi sostituiscono/espandono le media query esistenti)
   ======================================== */

/* Tablet Portrait - 768px e sotto (tutti gli orientamenti) */
@media screen and (max-width: 768px) {
    /* Container */
    .container {
        padding: 0 15px;
    }
    
    /* ========== HEADER ========== */
    .booking-header {
        padding: 15px 0;
    }
    
    .booking-header .container {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .hotel-brand h1 {
        font-size: 20px;
        margin-bottom: 3px;
    }
    
    .hotel-brand p {
        font-size: 12px;
    }
    
    .header-info {
        flex-direction: column;
        gap: 10px;
        font-size: 13px;
    }
    
    /* ========== HERO SEARCH ========== */
    .hero-search {
        min-height: auto;
        padding: 40px 0;
    }
    
    .search-card {
        padding: 25px;
        border-radius: 12px;
        max-width: 100%;
    }
    
    .search-card h2 {
        font-size: 24px;
        margin-bottom: 8px;
    }
    
    .search-card > p {
        font-size: 14px;
        margin-bottom: 20px;
    }
    
    /* ========== FORM ========== */
    .form-group {
        width: 100%;
    }
    
    .form-group label {
        font-size: 14px;
    }
    
    .form-group input,
    .form-group select {
        padding: 14px 12px;
        font-size: 16px; /* Previene zoom iOS */
    }
    
    /* ========== BOTTONI ========== */
    .btn,
    .btn-primary,
    .btn-secondary,
    .btn-success {
        width: 100%;
        padding: 16px;
        font-size: 16px;
        min-height: 48px; /* Touch target iOS */
    }
    
    .btn-large {
        padding: 18px;
        font-size: 18px;
    }
}

/* ========================================
   TABLET PORTRAIT MODE - Form 1 colonna
   ======================================== */
@media screen and (max-width: 768px) and (orientation: portrait) {
    .booking-search-form .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

/* ========================================
   TABLET LANDSCAPE MODE - Form 2 colonne  
   ======================================== */
@media screen and (max-width: 768px) and (orientation: landscape) {
    .booking-search-form .form-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .hero-search {
        min-height: 350px;
        padding: 30px 0;
    }
    
    .search-card {
        max-width: 90%;
        padding: 20px;
    }
    
    .modal-content {
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .room-image {
        height: 150px;
    }
}

/* ========================================
   CONTINUA MEDIA QUERY 768px
   ======================================== */
@media screen and (max-width: 768px) {
    .rooms-section {
        padding: 30px 0;
    }
    
    .rooms-section .container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    /* Sidebar Summary - Diventa statico su mobile */
    .booking-summary-sidebar {
        position: static;
        max-height: none;
        order: -1; /* Mette il summary sopra le camere */
    }
    
    .summary-card {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .summary-card h3 {
        font-size: 18px;
        margin-bottom: 15px;
        padding-bottom: 12px;
    }
    
    /* ========== ROOM CARDS - GIÃ€ GESTITO DA 992px ========== */
    /* Le room cards sono già ottimizzate nelle media query esistenti */
    
    #rooms-container {
        gap: 20px;
    }
    
    .room-card {
        border-radius: 10px;
    }
    
    .room-image {
        height: 200px;
    }
    
    .room-content {
        padding: 16px;
    }
    
    .room-content h3 {
        font-size: 18px;
        margin-bottom: 8px;
    }
    
    .room-features {
        gap: 6px;
        flex-wrap: wrap;
    }
    
    .room-features span {
        font-size: 11px;
        padding: 5px 8px;
    }
    
    /* ========== PREZZI ========== */
    .room-price-section {
        padding: 16px;
    }
    
    .price-option {
        padding: 12px;
        gap: 12px;
    }
    
    .price-current {
        font-size: 20px;
    }
    
    .price-label {
        font-size: 11px;
    }
    
    .price-original {
        font-size: 13px;
    }
    
    .discount-badge {
        font-size: 10px;
        padding: 3px 6px;
    }
    
    .price-option .btn {
        padding: 10px;
        font-size: 13px;
        min-width: 90px;
    }
    
    /* Bottone "Vedi altre tariffe" */
    .btn-show-more {
        padding: 12px;
        font-size: 14px;
    }
    
    .other-prices {
        gap: 12px;
    }
    
    /* ========== OFFERS BANNER ========== */
    #active-offers-banner {
        padding: 15px 20px;
        border-radius: 10px;
        gap: 10px;
        margin-bottom: 20px;
    }
    
    #active-offers-banner::before {
        font-size: 28px;
    }
    
    #offers-text {
        font-size: 14px;
    }
    
    #rooms-count {
        font-size: 16px;
        margin-bottom: 16px;
    }
    
    /* ========== MODAL ========== */
    .modal {
        padding: 10px;
    }
    
    .modal-content {
        padding: 30px 20px;
        border-radius: 16px;
        max-width: 95%;
    }
    
    .success-icon {
        width: 60px;
        height: 60px;
        font-size: 36px;
        margin-bottom: 20px;
    }
    
    .success-modal h2 {
        font-size: 24px;
        margin-bottom: 12px;
    }
    
    .booking-code {
        padding: 15px;
        margin: 20px 0;
    }
    
    .booking-code strong {
        font-size: 28px;
    }
    
    /* ========== LOADING ========== */
    .loader {
        width: 50px;
        height: 50px;
    }
    
    .loading-overlay p {
        font-size: 14px;
    }
    
    /* ========== NO RESULTS ========== */
    .no-results {
        padding: 50px 20px;
    }
    
    .no-results p {
        font-size: 16px;
    }
}

/* ========================================
   MOBILE - 480px e sotto
   ======================================== */
@media screen and (max-width: 480px) {
    body {
        font-size: 14px;
    }
    
    /* ========== HEADER ========== */
    .booking-header {
        padding: 12px 0;
    }
    
    .hotel-brand h1 {
        font-size: 18px;
    }
    
    .hotel-brand p {
        font-size: 11px;
    }
    
    .header-info {
        font-size: 12px;
        gap: 8px;
    }
    
    /* ========== SEARCH CARD ========== */
    .search-card {
        padding: 20px 15px;
        border-radius: 10px;
    }
    
    .search-card h2 {
        font-size: 20px;
        margin-bottom: 5px;
    }
    
    .search-card > p {
        font-size: 13px;
        margin-bottom: 18px;
    }
    
    /* ========== FORM - SEMPRE 1 COLONNA SU MOBILE ========== */
    .booking-search-form .form-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .form-group label {
        font-size: 13px;
        margin-bottom: 6px;
    }
    
    .form-group input,
    .form-group select {
        padding: 12px;
        font-size: 16px;
        border-radius: 8px;
    }
    
    .label-icon {
        font-size: 16px;
    }
    
    /* Date Picker Touch-Friendly */
    input[type="date"]::-webkit-calendar-picker-indicator {
        font-size: 20px;
        cursor: pointer;
    }
    
    /* ========== BOTTONI ========== */
    .btn,
    .btn-primary,
    .btn-secondary,
    .btn-success {
        padding: 14px;
        font-size: 15px;
        border-radius: 8px;
        gap: 6px;
    }
    
    .btn-large {
        padding: 16px;
        font-size: 17px;
    }
    
    /* ========== ROOMS SECTION ========== */
    .rooms-section {
        padding: 20px 0;
    }
    
    .summary-card {
        padding: 15px;
        border-radius: 10px;
    }
    
    .summary-card h3 {
        font-size: 16px;
        margin-bottom: 12px;
    }
    
    .summary-dates {
        gap: 10px;
        flex-wrap: wrap;
    }
    
    .summary-date strong {
        font-size: 14px;
    }
    
    .date-label {
        font-size: 11px;
    }
    
    .summary-nights {
        padding: 6px 10px;
        font-size: 13px;
    }
    
    .summary-guests {
        padding: 8px;
        font-size: 13px;
    }
    
    /* ========== ROOM CARDS ========== */
    #rooms-container {
        gap: 15px;
    }
    
    .room-card {
        border-radius: 8px;
        padding: 0;
        overflow: hidden;
    }
    
    .room-image {
        height: 180px;
    }
    
    .room-badge {
        top: 8px;
        right: 8px;
        font-size: 10px;
        padding: 4px 8px;
    }
    
    .room-content {
        padding: 12px;
    }
    
    .room-content h3 {
        font-size: 16px;
        margin-bottom: 6px;
    }
    
    .room-content p {
        font-size: 12px;
        line-height: 1.5;
    }
    
    .room-features {
        gap: 5px;
        margin-top: 8px;
    }
    
    .room-features span {
        font-size: 10px;
        padding: 4px 6px;
        border-radius: 4px;
    }
    
    /* ========== PREZZI MOBILE ========== */
    .room-price-section {
        padding: 12px;
    }
    
    .price-option {
        padding: 10px;
        gap: 10px;
        border-radius: 8px;
    }
    
    .price-details {
        gap: 4px;
    }
    
    .price-current {
        font-size: 18px;
    }
    
    .price-label {
        font-size: 10px;
    }
    
    .price-original {
        font-size: 12px;
    }
    
    .discount-badge {
        font-size: 9px;
        padding: 2px 5px;
    }
    
    .price-option .btn {
        padding: 8px;
        font-size: 12px;
        min-width: 80px;
    }
    
    /* Bottone espandi tariffe */
    .btn-show-more {
        padding: 10px;
        font-size: 13px;
        gap: 3px;
    }
    
    .other-prices {
        gap: 10px;
        margin-top: 8px;
    }
    
    /* ========== OFFERS BANNER ========== */
    #active-offers-banner {
        padding: 12px 15px;
        border-radius: 8px;
        margin-bottom: 15px;
    }
    
    #active-offers-banner::before {
        font-size: 24px;
    }
    
    #offers-text {
        font-size: 13px;
    }
    
    #rooms-count {
        font-size: 15px;
        margin-bottom: 12px;
    }
    
    /* ========== MODAL ========== */
    .modal {
        padding: 5px;
    }
    
    .modal-content {
        padding: 25px 15px;
        border-radius: 12px;
        max-width: 100%;
    }
    
    .success-icon {
        width: 50px;
        height: 50px;
        font-size: 30px;
        margin-bottom: 15px;
    }
    
    .success-modal h2 {
        font-size: 20px;
        margin-bottom: 10px;
    }
    
    .success-modal p {
        font-size: 14px;
    }
    
    .booking-code {
        padding: 12px;
        margin: 15px 0;
        border-radius: 8px;
    }
    
    .booking-code span {
        font-size: 12px;
    }
    
    .booking-code strong {
        font-size: 24px;
        letter-spacing: 1px;
    }
    
    .success-message {
        font-size: 13px;
    }
    
    /* ========== LOADING ========== */
    .loader {
        width: 40px;
        height: 40px;
        border-width: 4px;
    }
    
    .loading-overlay p {
        font-size: 13px;
        margin-top: 15px;
    }
    
    /* ========== NO RESULTS ========== */
    .no-results {
        padding: 40px 15px;
        border-radius: 10px;
    }
    
    .no-results p {
        font-size: 15px;
        margin-bottom: 20px;
    }
}

/* ========================================
   EXTRA SMALL MOBILE - 375px e sotto
   ======================================== */
@media screen and (max-width: 375px) {
    .container {
        padding: 0 10px;
    }
    
    .search-card {
        padding: 15px;
    }
    
    .search-card h2 {
        font-size: 18px;
    }
    
    .booking-search-form .form-row {
        gap: 10px;
    }
    
    .form-group input,
    .form-group select {
        padding: 10px;
    }
    
    .btn {
        padding: 12px;
        font-size: 14px;
    }
    
    #rooms-container {
        gap: 12px;
    }
    
    .room-image {
        height: 160px;
    }
    
    .room-content {
        padding: 10px;
    }
    
    .room-content h3 {
        font-size: 15px;
    }
    
    .room-features span {
        font-size: 9px;
        padding: 3px 5px;
    }
    
    .room-price-section {
        padding: 10px;
    }
    
    .price-current {
        font-size: 16px;
    }
    
    .price-option .btn {
        padding: 6px;
        font-size: 11px;
        min-width: 70px;
    }
}

/* ========================================
   TOUCH OPTIMIZATIONS
   ======================================== */
@media (hover: none) and (pointer: coarse) {
    /* Aumenta area touch per link e bottoni */
    a, button, .btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Rimuovi hover effects su touch devices */
    .room-card:hover,
    .btn:hover,
    a:hover {
        transform: none;
    }
    
    /* Feedback tattile con active */
    .btn:active {
        transform: scale(0.98);
        opacity: 0.9;
        transition: all 0.1s;
    }
    
    .room-card:active {
        opacity: 0.95;
    }
    
    /* Scrollbar nascosta su mobile */
    ::-webkit-scrollbar {
        width: 0px;
        background: transparent;
    }
}

/* ========================================
   PRINT OPTIMIZATIONS
   ======================================== */
@media print {
    .booking-header,
    .btn,
    .hide-print {
        display: none !important;
    }
    
    .booking-summary-sidebar {
        position: static;
        width: 100%;
    }
    
    body {
        background: white;
    }
    
    .room-card,
    .summary-card {
        border: 1px solid #ccc;
        box-shadow: none;
        page-break-inside: avoid;
    }
}

/* ========================================
   ACCESSIBILITY (Rispetta preferenze utente)
   ======================================== */

/* Focus visibile su tutti i dispositivi */
*:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

/* Riduci animazioni se richiesto */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Contrasto elevato */
@media (prefers-contrast: high) {
    .room-card {
        border: 2px solid var(--text-dark);
    }
    
    .btn {
        border: 2px solid currentColor;
    }
}

/* ========================================
   UTILITY CLASSES RESPONSIVE
   ======================================== */
@media screen and (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }
    
    .show-mobile {
        display: block !important;
    }
    
    .text-center-mobile {
        text-align: center !important;
    }
    
    .flex-column-mobile {
        flex-direction: column !important;
    }
    
    /* Spacing ridotto su mobile */
    .mt-4, .my-4 { margin-top: 1.5rem !important; }
    .mb-4, .my-4 { margin-bottom: 1.5rem !important; }
    .pt-4, .py-4 { padding-top: 1.5rem !important; }
    .pb-4, .py-4 { padding-bottom: 1.5rem !important; }
}