/* ============================================
   MOBILE RESPONSIVE OVERRIDES
   Fixes inline-style grids and layouts
   ============================================ */

.enquiry-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    .enquiry-form-row {
        grid-template-columns: 1fr !important;
    }
}

/* ---- Tablet (max 1024px) ---- */
@media (max-width: 1024px) {

    /* Services page - 4-col to 2-col */
    .services-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* Contact page - 2-col form+info */
    .contact-content,
    .contact-layout {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }

    /* Car rental intro */
    .car-rental-intro {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }

    /* Form rows - 3-col to 2-col */
    .form-row[style*="grid-template-columns: 1fr 1fr 1fr"] {
        grid-template-columns: 1fr 1fr !important;
    }

    /* CTA section headings */
    .section[style*="background: linear-gradient"] h2 {
        font-size: 2rem !important;
    }
}

/* ---- Mobile (max 768px) ---- */
@media (max-width: 768px) {

    /* ---- Hero sections ---- */
    .hero[style*="height: 60vh"] {
        height: 45vh !important;
        min-height: 280px !important;
    }

    .hero-content h1 {
        font-size: 1.8rem !important;
    }

    .hero-content p {
        font-size: 0.95rem !important;
    }

    /* ---- Services page grid ---- */
    .services-grid {
        grid-template-columns: 1fr !important;
    }

    /* ---- Contact page ---- */
    .contact-content,
    .contact-layout {
        grid-template-columns: 1fr !important;
        gap: 1.75rem !important;
    }

    .cf-row {
        grid-template-columns: 1fr !important;
    }

    .contact-form-card {
        padding: 1.25rem 1.1rem !important;
    }

    /* All form rows collapse to 1 col */
    .form-row {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    /* ---- Car rental page ---- */
    .car-rental-intro {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }

    /* Vehicle fleet carousel - make cards full width on mobile */
    .vehicle-fleet-carousel {
        padding: 1rem 0 !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    .vehicle-fleet-track {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 1rem;
        scroll-snap-type: x mandatory;
    }

    .vehicle-fleet-track .vehicle-card {
        min-width: 260px !important;
        width: 260px !important;
        scroll-snap-align: start;
    }

    /* Hide carousel arrows on mobile - swipe instead */
    .carousel-arrow {
        display: none !important;
    }

    /* ---- About page ---- */
    .team-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* ---- Gallery tabs - wrap nicely ---- */
    .gallery-tabs {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 0.5rem !important;
    }

    .tab-btn {
        padding: 0.5rem 1rem !important;
        font-size: 0.85rem !important;
        margin: 0 !important;
    }

    /* ---- CTA sections ---- */
    .section[style*="background: linear-gradient"] h2 {
        font-size: 1.6rem !important;
    }

    .section[style*="background: linear-gradient"] p {
        font-size: 1rem !important;
    }

    .cta-buttons {
        flex-direction: column !important;
        align-items: center !important;
        gap: 0.75rem !important;
    }

    .cta-buttons .btn,
    .cta-buttons a {
        width: 100% !important;
        max-width: 280px !important;
        text-align: center !important;
        margin-right: 0 !important;
    }

    /* ---- Contact info cards ---- */
    .contact-info-cards {
        gap: 1rem !important;
    }

    .info-card {
        padding: 1.2rem !important;
    }

    /* ---- Social links ---- */
    .social-links {
        flex-wrap: wrap !important;
        gap: 0.75rem !important;
    }

    /* ---- Process steps ---- */
    .process-steps {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* ---- Additional services ---- */
    .additional-services {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* ---- Features grid ---- */
    .features-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* ---- Section padding ---- */
    .section {
        padding: 2.5rem 0 !important;
    }

    /* ---- Section title ---- */
    .section-title h2 {
        font-size: 1.7rem !important;
        letter-spacing: 0.5px !important;
    }

    /* ---- Booking form submit button ---- */
    #carBookingForm button[type="submit"],
    #contactForm button[type="submit"] {
        width: 100% !important;
        padding: 1rem !important;
    }

    /* ---- Story image - remove 3D tilt ---- */
    .story-image {
        transform: none !important;
    }

    /* ---- Carousel item padding ---- */
    .carousel-item {
        padding: 1.5rem !important;
    }
}

/* ---- Small mobile (max 480px) ---- */
@media (max-width: 480px) {

    /* ---- Hero ---- */
    .hero[style*="height: 60vh"] {
        height: 40vh !important;
        min-height: 240px !important;
    }

    .hero-content h1 {
        font-size: 1.5rem !important;
    }

    /* ---- Team grid ---- */
    .team-grid {
        grid-template-columns: 1fr !important;
    }

    /* ---- Process steps ---- */
    .process-steps {
        grid-template-columns: 1fr !important;
    }

    /* ---- Additional services ---- */
    .additional-services {
        grid-template-columns: 1fr !important;
    }

    /* ---- Features grid ---- */
    .features-grid {
        grid-template-columns: 1fr !important;
    }

    /* ---- Section title ---- */
    .section-title h2 {
        font-size: 1.4rem !important;
    }

    /* ---- CTA headings ---- */
    .section[style*="background: linear-gradient"] h2 {
        font-size: 1.4rem !important;
    }

    /* ---- Gallery tabs ---- */
    .tab-btn {
        padding: 0.4rem 0.8rem !important;
        font-size: 0.8rem !important;
    }

    /* ---- Contact form ---- */
    .form-3d {
        padding: 1.2rem !important;
    }

    /* ---- Vehicle cards ---- */
    .vehicle-fleet-track .vehicle-card {
        min-width: 240px !important;
        width: 240px !important;
    }

    /* ---- FAQ questions ---- */
    .faq-question {
        font-size: 0.95rem !important;
        padding: 1rem !important;
    }

    /* ---- Container padding (honors display-scale gutter) ---- */
    .container {
        padding-left: var(--page-gutter, 1rem) !important;
        padding-right: var(--page-gutter, 1rem) !important;
        max-width: 100% !important;
        width: 100% !important;
    }
}

/* ============================================
   SERVICE SUB-PAGE SPECIFIC OVERRIDES
   ============================================ */

@media (max-width: 768px) {

    .rail-booking-intro,
    .hotel-booking-intro,
    .custom-tour-intro {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }

    .rail-overview-media {
        aspect-ratio: 3 / 2 !important;
        border-radius: 14px !important;
    }

    .rail-routes-carousel {
        padding: 0.5rem 42px !important;
    }

    .rail-routes-carousel .route-card {
        min-width: 260px !important;
        width: 260px !important;
    }

    /* Guidelines content */
    .guidelines-content {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }

    /* Package cards - minmax too wide for mobile */
    .packages-grid {
        grid-template-columns: 1fr !important;
    }

    /* Featured hotels */
    .featured-hotels {
        grid-template-columns: 1fr !important;
    }

    /* Tour themes */
    .tour-themes {
        grid-template-columns: 1fr !important;
    }

    /* Train search result cards */
    .train-result-card,
    [class*="train-card"] {
        overflow-x: auto !important;
    }

    /* Train result inner grids */
    [style*="grid-template-columns: repeat(2, 1fr)"] {
        grid-template-columns: 1fr 1fr !important;
    }

    /* Amenities / interests checkbox grids */
    [style*="grid-template-columns: repeat(auto-fit, minmax(150px, 1fr))"] {
        grid-template-columns: 1fr 1fr !important;
    }

    /* Package card images */
    .package-card img,
    .hotel-card img {
        height: 180px !important;
        object-fit: cover !important;
    }

    /* Booking modal */
    .booking-modal .modal-content,
    #bookingModal .modal-content {
        margin: 2% 1rem !important;
        max-height: 90vh !important;
        overflow-y: auto !important;
    }
}

@media (max-width: 480px) {

    /* Amenities / interests - single col */
    [style*="grid-template-columns: repeat(auto-fit, minmax(150px, 1fr))"] {
        grid-template-columns: 1fr !important;
    }

    /* Train result inner grids */
    [style*="grid-template-columns: repeat(2, 1fr)"] {
        grid-template-columns: 1fr !important;
    }

    /* Package cards */
    .packages-grid {
        grid-template-columns: 1fr !important;
    }

    /* Hotel categories */
    .hotel-categories {
        grid-template-columns: 1fr 1fr !important;
    }

    /* Benefits grid */
    .benefits-grid {
        grid-template-columns: 1fr !important;
    }

    /* Included grid */
    .included-grid {
        grid-template-columns: 1fr 1fr !important;
    }
}

/* ============================================
   TOUR DETAIL PAGE (tour.php)
   ============================================ */

@media (max-width: 768px) {

    .tour-detail-layout {
        display: flex !important;
        flex-direction: column !important;
        gap: 1.5rem !important;
        width: 100% !important;
    }

    .package-main-content,
    .package-sidebar {
        width: 100% !important;
        max-width: 100% !important;
        flex: 1 1 100% !important;
    }

    .package-sidebar {
        order: -1 !important;
    }

    .tour-meta-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
        width: 100% !important;
    }

    .tour-booking-card {
        position: static !important;
        padding: 1.5rem !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .enquiry-form-row {
        grid-template-columns: 1fr !important;
    }

    /* Inner page sections — solid background on mobile (no pattern gaps) */
    .inner-page .section {
        background: linear-gradient(145deg, #ffffff 0%, #faf8f3 100%) !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        border-radius: 0 !important;
    }

    #enquiryModalInner,
    #packageModalInner {
        margin: 0.75rem !important;
        max-width: none !important;
        width: calc(100% - 1.5rem) !important;
        box-sizing: border-box !important;
    }

    /* Package tour swiper — keep nav buttons on screen */
    .upcomingSwiper,
    .featuredSwiper,
    .popularSwiper {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
        overflow: hidden;
    }

    .upcomingSwiper .swiper-button-next,
    .featuredSwiper .swiper-button-next,
    .popularSwiper .swiper-button-next {
        right: 4px !important;
    }

    .upcomingSwiper .swiper-button-prev,
    .featuredSwiper .swiper-button-prev,
    .popularSwiper .swiper-button-prev {
        left: 4px !important;
    }

    .upcomingSwiper .swiper-button-next,
    .upcomingSwiper .swiper-button-prev,
    .featuredSwiper .swiper-button-next,
    .featuredSwiper .swiper-button-prev,
    .popularSwiper .swiper-button-next,
    .popularSwiper .swiper-button-prev {
        width: 36px !important;
        height: 36px !important;
    }

    .package-card .package-content {
        padding: 1.25rem !important;
    }

    .custom-tour-modal .modal-content {
        margin: 0.5rem !important;
        max-height: none !important;
    }

    .custom-tour-modal .modal-header,
    .custom-tour-modal .modal-body {
        padding: 1.25rem !important;
    }

    .custom-tour-modal [style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    #openCustomTourBtn {
        width: 100% !important;
        max-width: 280px !important;
        margin-right: 0 !important;
    }
}

/* ---- Compact mobile footer (keep all content, less height) ---- */
@media (max-width: 768px) {
    .footer {
        padding: 0.75rem 0 0.35rem;
    }

    .footer-content {
        gap: 0.85rem;
        margin-bottom: 0.45rem;
        padding: 0 0.85rem;
    }

    .footer-logo {
        min-width: 0;
        width: 100%;
    }

    .footer-logo .logo {
        margin-bottom: 0.25rem;
    }

    .footer-logo .logo-img {
        width: 40px;
        height: 40px;
        margin-right: 8px;
    }

    .footer-logo .logo-text h1 {
        font-size: 1.15rem;
        line-height: 1.15;
    }

    .footer-logo .logo-text span {
        font-size: 0.65rem;
        line-height: 1.25;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        white-space: normal;
    }

    .footer-description {
        font-size: 0.75rem;
        line-height: 1.35;
        margin-bottom: 0;
    }

    .footer-links,
    .footer-social,
    .footer-newsletter {
        min-width: 0;
        width: 100%;
    }

    .footer-links h3,
    .footer-social h3,
    .footer-newsletter h3 {
        font-size: 0.88rem;
        margin-bottom: 0.35rem;
    }

    .footer-links ul {
        grid-template-columns: 1fr 1fr;
        gap: 0.15rem 0.75rem;
        margin: 0;
    }

    .footer-links a {
        font-size: 0.78rem;
        line-height: 1.35;
    }

    .footer-social .social-icons {
        gap: 0.45rem;
        margin-bottom: 0.4rem;
    }

    .footer-social .social-icons a {
        width: 32px;
        height: 32px;
        font-size: 0.85rem;
    }

    .footer-social .contact-info p {
        font-size: 0.75rem;
        margin: 0.15rem 0;
        line-height: 1.35;
    }

    .footer-newsletter p {
        font-size: 0.75rem;
        line-height: 1.35;
        margin: 0 0 0.4rem;
    }

    .footer-subscribe-form {
        gap: 0.3rem;
    }

    .footer-subscribe-form input[type="email"] {
        min-width: 0;
        padding: 0.45rem 0.65rem;
        font-size: 0.8rem;
    }

    .footer-subscribe-form button {
        padding: 0.45rem 0.85rem;
        font-size: 0.8rem;
    }

    .footer-subscribe-msg {
        margin-top: 0.3rem;
        font-size: 0.72rem;
    }

    .footer-designed {
        margin: 0.55rem 0 0;
        padding-top: 0.45rem;
        font-size: 0.72rem;
    }

    .footer-bottom {
        padding: 0.4rem 0;
        font-size: 0.7rem;
    }

    .footer-bottom-inner {
        gap: 0.3rem;
        padding: 0 0.85rem;
    }

    .footer-bottom-links {
        gap: 0.55rem;
    }

    .footer-bottom-links a {
        font-size: 0.7rem;
    }

    .footer-bottom .copyright p {
        margin: 0;
        line-height: 1.35;
    }
}

@media (max-width: 480px) {
    .footer-content {
        gap: 0.7rem;
        padding: 0 0.75rem;
    }

    .footer-links ul {
        gap: 0.1rem 0.5rem;
    }

    .footer-links a {
        font-size: 0.74rem;
    }
}
