/* ═══════════════════════════════════════════════════
   Vayanta Holidays — global mobile enhancements
   Linked from public + customer layouts
   ═══════════════════════════════════════════════════ */

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    overflow-x: hidden;
    max-width: 100%;
}

body {
    overflow-x: hidden;
    max-width: 100%;
    width: 100%;
}

/* Prevent horizontal page scroll on mobile — common overflow sources */
@media (max-width: 768px) {
    html,
    body {
        overflow-x: clip;
    }

    .container-nd,
    .ndl-header-inner,
    .nd-scroll-header-inner,
    .nd-nav-panel-inner,
    .ndl-footer-grid,
    .ndl-footer-bar,
    .nid-duration-wrap,
    .nic-duration-wrap,
    .ncp-nav-inner,
    .ncp-main-inner {
        max-width: 100%;
        min-width: 0;
    }

    section,
    .nd-hero,
    .nd-faq-app-section,
    .nd-dest-section,
    .nd-pkg-section,
    .nd-proof,
    .nd-cta-section,
    .nd-styles-section,
    .nd-blog-section,
    .ndl-footer,
    .nid-page,
    .nic-page,
    .nsr-page,
    .nbl-page,
    .nbs-page,
    .ab-page,
    .ct-page,
    .ntd-page,
    .nd-dest-page,
    .ncp-shell {
        max-width: 100%;
        overflow-x: clip;
    }

    .nd-dest-carousel-wrap,
    .nd-pkg-carousel-wrap {
        max-width: 100%;
        overflow: visible;
    }

    .nd-dest-carousel,
    .nd-pkg-carousel {
        width: 100%;
        max-width: 100%;
    }

    .nid-duration-bar,
    .nic-duration-bar {
        max-width: 100%;
        overflow: hidden;
    }

    .nid-duration-tabs,
    .nic-duration-tabs {
        max-width: 100%;
    }

    .nd-app-box {
        overflow: hidden;
    }

    .nd-app-box::before {
        left: 0;
        bottom: -30px;
        width: 140px;
        height: 140px;
    }
}

/* Prevent iOS zoom on form focus */
@media (max-width: 768px) {
    input,
    select,
    textarea,
    button {
        font-size: max(16px, 1em);
    }
}

/* Horizontal scroll for wide tables */
.mobile-table-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.mobile-table-scroll table {
    min-width: 520px;
}

/* Touch-friendly tap targets */
@media (max-width: 768px) {
    .ndl-icon-btn,
    .ndl-mobile-toggle,
    .ncp-hamburger,
    .ncp-nav-icon-btn,
    .ncp-hamburger,
    .nd-hero-mobile-toggle,
    .nd-hero-search-btn,
    .cat-sticky-enq-toggle,
    .cat-sticky-enq-btn,
    .ntd-cta-wa-btn,
    .ntd-cta-cb-btn,
    .lead-cap-submit {
        min-width: 44px;
        min-height: 44px;
    }

    .ncp-mob-item {
        min-height: 48px;
        padding: 6px 4px;
        justify-content: center;
    }
}

/* WhatsApp / FAB — safe area + customer bottom nav clearance */
.nd-wa-float,
.ntd-wa-float,
.nid-wa-float {
    bottom: calc(16px + env(safe-area-inset-bottom, 0px)) !important;
}

body.has-mobile-bottom-nav .nd-wa-float,
body.has-mobile-bottom-nav .ntd-wa-float,
body.has-mobile-bottom-nav .nid-wa-float {
    bottom: calc(76px + env(safe-area-inset-bottom, 0px)) !important;
}

/* Tour detail sticky CTA bar — stack above WA float */
body.has-ntd-cta-bar .nd-wa-float,
body.has-ntd-cta-bar .ntd-wa-float {
    bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important;
}

body.has-mobile-bottom-nav.has-ntd-cta-bar .nd-wa-float,
body.has-mobile-bottom-nav.has-ntd-cta-bar .ntd-wa-float {
    bottom: calc(148px + env(safe-area-inset-bottom, 0px)) !important;
}

/* Category sticky enquiry — WA float clearance */
body.has-cat-sticky-enq .nd-wa-float,
body.has-cat-sticky-enq .nid-wa-float {
    bottom: calc(60px + env(safe-area-inset-bottom, 0px)) !important;
}

body.has-cat-sticky-enq.cat-enq-open .nd-wa-float,
body.has-cat-sticky-enq.cat-enq-open .nid-wa-float {
    bottom: calc(148px + env(safe-area-inset-bottom, 0px)) !important;
}

@media (max-width: 640px) {
    body.has-ntd-cta-bar {
        padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    }

    body.has-cat-sticky-enq {
        padding-bottom: calc(52px + env(safe-area-inset-bottom, 0px));
    }

    body.has-cat-sticky-enq.cat-enq-open {
        padding-bottom: calc(140px + env(safe-area-inset-bottom, 0px));
    }
}

/* Filter / tab rows — swipe on small screens */
@media (max-width: 640px) {
    .mobile-scroll-tabs {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 8px;
        padding-bottom: 4px;
    }

    .mobile-scroll-tabs::-webkit-scrollbar {
        display: none;
    }

    .mobile-scroll-tabs > * {
        flex-shrink: 0;
    }
}
