/* ==========================================
   MOBILE RESPONSIVE OVERRIDES - Expitalia
   ========================================== */

/* ========================================
   TYPOGRAPHY
   ======================================== */
@media (max-width: 767px) {
    h1 { font-size: 30px !important; line-height: 1.2 !important; }
    h2 { font-size: 22px !important; }
    h3 { font-size: 18px !important; }

    .page-title {
        font-size: 26px !important;
        line-height: 1.25 !important;
    }
}

@media (max-width: 480px) {
    h1 { font-size: 24px !important; }
}

/* ========================================
   HEADER & LOGO
   ======================================== */

/* Dimensione base logo desktop */
.brand-logo-img {
    height: 95px;
    width: auto;
}

/* Riduce logo su tablet/mobile */
@media (max-width: 1199px) {
    .brand-logo-img,
    .site-branding .brand-logo img,
    .mobile-logo .brand-logo img {
        height: 60px !important;
        width: auto !important;
    }

    /* Azzera la dimensione forzata del font nel menu */
    .header-navigation .main-menu a {
        font-size: 1em !important;
    }
    .nav-right-item {
        font-size: 1em !important;
    }
}

@media (max-width: 767px) {
    .brand-logo-img,
    .site-branding .brand-logo img {
        height: 48px !important;
        width: auto !important;
    }

    /* Search button: solo icona, niente testo */
    .search-icon .search-btn {
        width: auto !important;
        min-width: 36px;
        padding: 4px 8px !important;
        justify-content: center !important;
    }
    .search-icon .search-btn span,
    .search-icon .search-btn .search-text {
        display: none !important;
    }
    .search-icon {
        margin-right: 6px !important;
    }

    /* Nascondi il testo "Preferiti" su mobile, lascia solo icona */
    .favorites-icon .favorites-btn .fav-text {
        display: none !important;
    }
    .favorites-icon .favorites-btn {
        margin-right: 6px !important;
        padding: 4px 6px !important;
    }

    /* Username nel bottone utente: accorcia su mobile piccolo */
    .login-icon-user {
        display: none;
    }
}

@media (max-width: 480px) {
    .brand-logo-img,
    .site-branding .brand-logo img {
        height: 42px !important;
    }

    /* Nav right compatto */
    .header-navigation .nav-right-item {
        gap: 4px !important;
    }
}

/* ========================================
   HERO / SLIDER
   ======================================== */
@media (max-width: 991px) {
    .single-slider {
        padding-top: 120px !important;
        padding-bottom: 80px !important;
    }
}

@media (max-width: 767px) {
    .single-slider {
        padding-top: 90px !important;
        padding-bottom: 50px !important;
    }

    .hero-wrapper .hero-content h1 {
        font-size: 28px !important;
        line-height: 1.25 !important;
    }

    .hero-wrapper-two .single-slider,
    .hero-wrapper-two .hero-content {
        text-align: center;
    }
}

@media (max-width: 480px) {
    .single-slider {
        padding-top: 75px !important;
        padding-bottom: 40px !important;
    }
}

/* ========================================
   PAGE BANNER (pt-170)
   ======================================== */
@media (max-width: 991px) {
    .page-banner.pt-170,
    section.page-banner.pt-170 {
        padding-top: 110px !important;
    }
}

@media (max-width: 767px) {
    .page-banner.pt-170,
    section.page-banner.pt-170 {
        padding-top: 85px !important;
    }
    .page-banner.pb-80,
    section.page-banner.pb-80 {
        padding-bottom: 30px !important;
    }
    .page-banner.pb-50,
    section.page-banner.pb-50 {
        padding-bottom: 20px !important;
    }
    .page-banner-content {
        padding: 0 10px;
    }
}

/* ========================================
   SEARCH OVERLAY
   ======================================== */
@media (max-width: 575px) {
    .search-overlay {
        padding-top: 80px !important;
        padding-left: 15px;
        padding-right: 15px;
    }
    .search-overlay-form input {
        font-size: 15px !important;
        padding: 12px 50px 12px 16px !important;
    }
    .search-overlay-close {
        top: 20px;
        right: 20px;
    }
}

/* ========================================
   SECTIONS SPACING (pt-* / pb-* utilities)
   ======================================== */
@media (max-width: 767px) {
    .pt-170 { padding-top: 85px !important; }
    .pt-150 { padding-top: 60px !important; }
    .pt-130 { padding-top: 55px !important; }
    .pt-120 { padding-top: 50px !important; }
    .pt-110 { padding-top: 45px !important; }
    .pt-100 { padding-top: 45px !important; }
    .pt-90  { padding-top: 40px !important; }
    .pt-80  { padding-top: 35px !important; }
    .pt-70  { padding-top: 30px !important; }
    .pt-60  { padding-top: 28px !important; }
    .pt-50  { padding-top: 25px !important; }

    .pb-150 { padding-bottom: 60px !important; }
    .pb-130 { padding-bottom: 55px !important; }
    .pb-120 { padding-bottom: 50px !important; }
    .pb-110 { padding-bottom: 45px !important; }
    .pb-100 { padding-bottom: 45px !important; }
    .pb-90  { padding-bottom: 40px !important; }
    .pb-80  { padding-bottom: 35px !important; }
    .pb-70  { padding-bottom: 30px !important; }
    .pb-60  { padding-bottom: 28px !important; }
    .pb-50  { padding-bottom: 25px !important; }

    .mt-100 { margin-top: 40px !important; }
    .mt-80  { margin-top: 30px !important; }
    .mt-70  { margin-top: 25px !important; }
    .mt-60  { margin-top: 20px !important; }
    .mt-50  { margin-top: 20px !important; }

    .mb-100 { margin-bottom: 40px !important; }
    .mb-80  { margin-bottom: 30px !important; }
    .mb-70  { margin-bottom: 25px !important; }
    .mb-60  { margin-bottom: 20px !important; }
    .mb-50  { margin-bottom: 20px !important; }
}

/* ========================================
   TOUR CARD
   ======================================== */
@media (max-width: 575px) {
    .single-place-item {
        margin-bottom: 30px !important;
    }

    /* Permetti al titolo di occupare più righe invece di avere altezza fissa */
    .single-place-item .place-content .info h4.title {
        height: auto !important;
        -webkit-line-clamp: 3 !important;
        line-height: 1.3em !important;
    }

    /* Location: permetti il wrap */
    .single-place-item .place-content .info .location {
        height: auto !important;
        white-space: normal !important;
        flex-wrap: wrap;
    }

    /* Meta: bottone acquista full-width */
    .single-place-item .place-content .info .meta {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }
    .single-place-item .place-content .info .meta .btn-acquista-tour {
        display: block;
        text-align: center;
        width: 100%;
    }
}

/* ========================================
   FILTER FORM
   ======================================== */
@media (max-width: 575px) {
    .filter-form-wrapper {
        padding: 20px 15px !important;
        border-radius: 8px !important;
    }
}

/* ========================================
   TOUR DETAIL PAGE
   ======================================== */
@media (max-width: 991px) {
    /* Quick info: 2 colonne su tablet */
    .tour-quick-info {
        flex-wrap: wrap;
    }
    .tour-quick-info .info-item {
        flex: 0 0 50%;
        border-right: none;
        border-bottom: 1px solid #eee;
        min-width: 0;
    }
    .tour-quick-info .info-item:nth-child(odd) {
        border-right: 1px solid #eee;
    }
    .tour-quick-info .info-item:last-child,
    .tour-quick-info .info-item:nth-last-child(2):nth-child(odd) {
        border-bottom: none;
    }

    /* Booking sidebar: non sticky su mobile */
    .booking-sidebar {
        position: static !important;
        top: auto !important;
        margin-top: 30px;
    }
}

@media (max-width: 767px) {
    /* Header info bar: colonna su mobile */
    .tour-header-info-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 10px 0;
    }
    .tour-header-info-bar .action-links {
        gap: 12px;
    }

    /* Quick info: 1 colonna su mobile */
    .tour-quick-info .info-item {
        flex: 0 0 100%;
        border-right: none !important;
    }
    .tour-quick-info .info-item:not(:last-child) {
        border-bottom: 1px solid #eee !important;
    }

    /* Tab navigazione tour */
    .description-tabs .nav-link {
        padding: 8px 12px;
        font-size: 13px;
    }

    /* Carousel immagini */
    .tour-gallery-carousel .carousel-item img {
        max-height: 250px;
        object-fit: cover;
    }
}

/* ========================================
   BLOG PAGE
   ======================================== */
@media (max-width: 767px) {
    /* La sidebar va sotto il contenuto (Bootstrap la gestisce con col-xl-*) */
    .single-blog-post-four .post-thumbnail img {
        width: 100%;
        height: auto;
        border-radius: 8px;
    }

    .blog-list-section .row {
        gap: 0;
    }
}

/* ========================================
   FOOTER
   ======================================== */
@media (max-width: 767px) {
    .footer-widget {
        text-align: center;
    }

    .footer-widget .footer-contact-list,
    .footer-widget .footer-link-list {
        text-align: left;
        display: inline-block;
    }

    /* Social icons: layout orizzontale */
    .footer-widget .row > [class*="col-lg-2"] {
        display: inline-block !important;
        width: auto !important;
        flex: 0 0 auto !important;
        max-width: none !important;
        padding: 0 5px !important;
    }

    .footer-widget .row {
        justify-content: center;
    }

    /* Copyright bar */
    .footer-copyright .footer-text {
        text-align: center;
    }
    .footer-nav.float-lg-end {
        float: none !important;
        text-align: center;
        margin-top: 8px;
    }
    .footer-copyright .col-lg-6 {
        text-align: center;
    }
}

/* ========================================
   MODALI LOGIN / REGISTRAZIONE
   ======================================== */
@media (max-width: 480px) {
    .login-modal-content {
        width: 100% !important;
        margin: 0 !important;
        border-radius: 15px 15px 0 0 !important;
        position: fixed !important;
        bottom: 0 !important;
        transform: none !important;
        max-height: 92vh !important;
    }

    .login-modal {
        align-items: flex-end !important;
    }

    .login-modal.show .login-modal-content {
        transform: none !important;
    }

    .login-modal-header,
    .login-modal-body {
        padding: 20px 16px !important;
    }

    #register-modal .login-modal-content {
        max-width: 100% !important;
    }
}

/* ========================================
   MAPPA / EXPERIENCE PAGE
   ======================================== */
@media (max-width: 767px) {
    .map-modal-body {
        flex-direction: column !important;
        padding: 15px !important;
    }
    .italy-map-container {
        max-width: 100% !important;
    }
    .map-images-container {
        max-width: 100% !important;
        display: block !important;
    }
    .map-region-text {
        max-width: 100% !important;
    }
}

/* ========================================
   FORM DI RICERCA HOMEPAGE
   ======================================== */

/* Su tablet: riduci i margini laterali */
@media (max-width: 1199px) {
    .booking-form-wrapper {
        margin-left: 20px !important;
        margin-right: 20px !important;
    }
}

/* Su mobile: elimina i margini laterali, usa tutto lo schermo */
@media (max-width: 767px) {
    .booking-form-wrapper {
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding: 20px 15px !important;
        border-radius: 10px !important;
    }
}

/* ========================================
   PRENOTAZIONE / ACQUISTA
   ======================================== */
@media (max-width: 767px) {
    /* Form prenotazione a tutto schermo su mobile */
    .sidebar-widget-area .booking-form-widget {
        border-radius: 12px !important;
    }
}

/* ========================================
   CONTATTI / VARIE PAGINE
   ======================================== */
@media (max-width: 767px) {
    /* Cards partner */
    .partner-details-card .card-body {
        padding: 15px !important;
    }

    /* Tabelle prezzi */
    table {
        font-size: 13px;
    }
    table th,
    table td {
        padding: 6px 8px !important;
    }

    /* Immagini contenuto blog */
    .image-post {
        max-width: 100% !important;
        height: auto !important;
    }

    /* Bottoni full-width su mobile */
    .main-btn.primary-btn,
    .main-btn.filled-btn {
        display: block;
        width: 100%;
        text-align: center;
    }
    .btn-more-tours,
    .btn-blog-more {
        display: block;
        width: 100%;
        text-align: center;
        margin: 0 auto;
    }
}

/* ========================================
   BACK TO TOP
   ======================================== */
@media (max-width: 767px) {
    .back-to-top {
        bottom: 20px;
        right: 15px;
        width: 40px;
        height: 40px;
    }
}

/* ========================================
   UTILITY: overflow fix globale
   ======================================== */
@media (max-width: 767px) {
    body {
        overflow-x: hidden;
    }

    /* Assicura che container-fluid non abbia padding eccessivo su mobile
       (già gestito da style.css a 1199px, questo è un fallback) */
    .container-fluid {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
}
