/* ═══════════════════════════════════════════════════
   Homepage responsive refactor
   Mobile: ≤640px | Tablet: 641–1100px
   Loaded on new-dashboard homepage only
   ═══════════════════════════════════════════════════ */

/* Carousel arrows — full circle visible at original edge position (no clip) */
.nd-dest-carousel-wrap,
.nd-pkg-carousel-wrap {
    overflow: visible !important;
    isolation: isolate;
}

.nd-dest-arr,
.nd-pkg-arr {
    z-index: 30 !important;
}

@media (min-width: 769px) {
    .nd-dest-section,
    .nd-pkg-section,
    .nd-dest-section .container-nd,
    .nd-pkg-section .container-nd {
        overflow: visible !important;
    }
}

/* ── Unified side gutters ── */
@media (max-width: 1100px) {
    :root {
        --nd-gutter-x: 16px;
    }

    .container-nd,
    .nd-hero-nav-inner,
    .nd-scroll-header-inner,
    .nd-nav-panel-inner,
    .nd-hero-topbar-inner,
    .ndl-footer-grid,
    .ndl-footer-bar {
        padding-left: var(--nd-gutter-x) !important;
        padding-right: var(--nd-gutter-x) !important;
    }
}

@media (max-width: 900px) {
    :root {
        --nd-gutter-x: 14px;
    }
}

@media (max-width: 640px) {
    :root {
        --nd-gutter-x: 12px;
    }

    .nd-hero-panel {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .nd-hero-copy {
        padding-left: calc(var(--nd-gutter-x) + 4px) !important;
        padding-right: calc(var(--nd-gutter-x) + 4px) !important;
    }
}

/* ════════════════════════════════════════════════════
   TABLET — 901px to 1100px (landscape / small laptop)
   ════════════════════════════════════════════════════ */
@media (min-width: 901px) and (max-width: 1100px) {
    .nd-dest-section-title,
    .nd-styles-title,
    .nd-pkg-title,
    .nd-why-title,
    .nd-blog-head .nd-blog-title {
        font-size: 1.38rem !important;
    }

    .nd-dest-section-head,
    .nd-pkg-head,
    .nd-blog-head,
    .nd-styles-head,
    .nd-why-head {
        margin-bottom: 16px !important;
    }

    /* Why: 5 cards → 3-column wrap */
    .nd-why-features {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 12px;
    }

    .nd-why-card {
        padding: 18px 12px 16px;
    }

    .nd-planner {
        max-width: 100%;
    }

    .nd-pkg-trust {
        grid-template-columns: repeat(2, 1fr);
        gap: 18px;
    }

    .nd-blog-feat-card {
        height: 268px;
    }

    .ndl-footer-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 28px 24px;
        padding-bottom: 36px;
    }

    .ndl-footer-grid > div:first-child,
    .ndl-footer-grid > div:last-child {
        grid-column: 1 / -1;
    }
}

/* ════════════════════════════════════════════════════
   TABLET — 641px to 900px (portrait)
   ════════════════════════════════════════════════════ */
@media (min-width: 641px) and (max-width: 900px) {
    /* ── Header: clean white bar (like mobile, wider viewport) ── */
    .nd-hero-nav {
        position: sticky;
        top: 0;
        z-index: 120;
        background: rgba(255, 255, 255, 0.97);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border-bottom: 1px solid #e8edf2;
        padding: 8px 0;
    }

    .nd-hero-nav-inner {
        min-height: 56px;
    }

    .nd-hero-logo,
    .nd-scroll-logo,
    .ndl-logo {
        flex-shrink: 0 !important;
    }

    .nd-brand-logo-icon {
        width: 38px !important;
        height: 38px !important;
        border-radius: 10px !important;
    }

    .nd-brand-logo-icon i { font-size: 18px !important; }

    .nd-brand-logo-name { font-size: 14px !important; }

    .nd-brand-logo-tag { font-size: 10px !important; }

    .nd-hero-search-btn,
    .nd-hero-plan-btn,
    .nd-hero-mobile-toggle {
        border: 1.5px solid #e5e7eb !important;
        background: #fff !important;
        color: #374151 !important;
    }

    .nd-hero-plan-btn {
        width: 42px;
        height: 42px;
        padding: 0 !important;
        border-radius: 50% !important;
        justify-content: center;
    }

    .nd-hero-plan-btn .nd-hero-plan-txt {
        display: none;
    }

    .nd-scroll-header-inner {
        height: 56px;
    }

    .nd-scroll-header {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        z-index: 200 !important;
        background: rgba(255, 255, 255, 0.97) !important;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border-bottom: 1px solid #e8edf2 !important;
    }

    .nd-scroll-search-btn {
        display: flex !important;
    }

    .nd-scroll-logo .nd-brand-logo-icon {
        width: 36px !important;
        height: 36px !important;
    }

    /* ── Hero band (keep compact band from _hero; white sticky nav only) ── */
    .nd-hero-inner {
        gap: 16px;
    }

    .nd-hero-copy {
        padding-bottom: 12px;
    }

    .nd-hero-heading {
        font-size: clamp(1.2rem, 2.8vw, 1.45rem);
    }

    .nd-hero-subtext {
        font-size: 0.82rem;
        max-width: 520px;
    }

    .nd-hero-stats {
        max-width: 420px;
    }

    .nd-hero-mobile-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
    }

    .nd-planner {
        max-width: 100%;
        margin-bottom: -20px;
    }

    .nd-planner-top {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .nd-planner .nd-plan-tabs {
        width: 100%;
    }

    /* ── Nav tabs ── */
    .nd-nav-panel {
        margin-top: 0;
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.04);
    }

    .nd-nav-panel-inner {
        padding-top: 10px;
        padding-bottom: 8px;
    }

    .nd-nav-type-tab {
        padding: 10px 20px 11px;
    }

    /* ── Sections ── */
    .nd-dest-section-title,
    .nd-styles-title,
    .nd-pkg-title,
    .nd-why-title,
    .nd-blog-head .nd-blog-title,
    .nd-cta-title {
        font-size: 1.32rem !important;
    }

    .nd-dest-section-head,
    .nd-pkg-head,
    .nd-blog-head {
        margin-bottom: 16px !important;
    }

    /* Social proof — stats polish (reviews stay swipe carousel from partial) */
    .nd-proof-stats {
        border-radius: 18px;
    }

    .nd-proof-card {
        flex: 0 0 62%;
        min-width: 62%;
    }

    .nd-proof-platforms {
        margin-top: 14px;
    }

    /* Travel styles */
    .nd-styles-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }

    .nd-style-ico {
        width: 68px;
        height: 68px;
    }

    /* Packages */
    .nd-pkg-section {
        background: #f8fafc;
    }

    .nd-pkg-carousel .nd-pkg-card {
        flex: 0 0 calc((100% - 32px) / 3) !important;
        min-width: 200px;
        max-width: 240px;
    }

    .nd-pkg-banner {
        margin-top: 0 !important;
        padding: 22px 24px;
        border-radius: 18px;
    }

    .nd-pkg-trust {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
        margin-top: 22px !important;
    }

    /* Blog — two-column on tablet portrait */
    .nd-blog-grid {
        grid-template-columns: 1.08fr 1fr !important;
        gap: 14px;
    }

    .nd-blog-feat-card {
        height: 260px;
    }

    /* Why */
    .nd-why-features {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px;
    }

    /* CTA */
    .nd-cta-inner {
        flex-direction: column;
        text-align: center;
        gap: 20px;
        padding: 32px 28px !important;
    }

    .nd-cta-btns {
        justify-content: center;
        width: 100%;
    }

    /* FAQ + app */
    .nd-faq-app-grid {
        grid-template-columns: 1fr !important;
        gap: 28px;
    }

    .nd-app-box {
        display: flex;
        flex-direction: column;
    }

    .nd-phone-mockup {
        margin: 16px auto 0;
    }

    /* Footer — tablet uses 2 link columns under brand */
    .ndl-footer {
        padding-top: 40px;
    }

    .ndl-footer-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 24px 20px;
        padding-bottom: 32px;
    }

    .ndl-footer-grid > div:first-child {
        grid-column: 1 / -1;
    }

    .ndl-footer-grid > div:last-child {
        grid-column: 1 / -1;
    }

    .ndl-footer-tagline {
        max-width: none;
    }

    /* Softer motion on tablet */
    .nd-pkg-banner::before,
    .nd-proof-stats::before {
        animation: none !important;
    }
}

/* ── 1. Header (hero + scroll sticky) — tablet & phone ── */
@media (max-width: 900px) {
    .nd-scroll-mobile-toggle {
        display: flex !important;
    }

    .nd-scroll-search-btn {
        display: flex !important;
    }

    .nd-scroll-header .nd-auth-wrap,
    .nd-hero-nav .nd-auth-wrap {
        display: none !important;
    }
}

@media (max-width: 640px) {
    .nd-hero-nav {
        position: sticky;
        top: 0;
        z-index: 120;
        background: #fff;
        border-bottom: 1px solid #e8edf2;
        padding-top: max(8px, env(safe-area-inset-top, 0px));
    }

    .nd-hero-nav-inner {
        min-height: 60px;
    }

    .nd-brand-logo-icon {
        width: 36px !important;
        height: 36px !important;
    }

    .nd-brand-logo-name { font-size: 13.5px !important; }

    /* Login/user in drawer on mobile — keep header clean */
    .nd-hero-nav .nd-auth-wrap {
        display: none !important;
    }

    /* Secondary scroll header — match hero nav / ndl-header fixed bar */
    .nd-scroll-header {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        z-index: 200 !important;
        background: #fff !important;
        border-bottom: 1px solid #e8edf2 !important;
        box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04) !important;
        padding-top: max(8px, env(safe-area-inset-top, 0px));
    }

    .nd-scroll-header.visible {
        transform: translateY(0) !important;
    }

    .nd-scroll-header-inner {
        height: 60px;
        min-height: 60px;
        padding-top: 0;
        padding-left: var(--nd-gutter-x, 16px);
        padding-right: var(--nd-gutter-x, 16px);
        gap: 8px;
    }

    .nd-scroll-logo {
        min-width: 0;
        flex-shrink: 0;
    }

    .nd-scroll-header .nd-auth-wrap {
        display: none !important;
    }

    .nd-scroll-search-btn {
        display: flex !important;
    }

    .nd-scroll-right {
        gap: 6px;
        margin-left: auto;
        flex-shrink: 0;
    }

    .nd-scroll-mobile-toggle {
        display: flex !important;
        width: 40px;
        height: 40px;
        font-size: 20px;
        border: 1.5px solid #e5e7eb;
        background: #fff;
        color: #374151;
        border-radius: 50%;
    }

    .nd-scroll-btn {
        display: inline-flex !important;
        width: 40px;
        height: 40px;
        padding: 0 !important;
        border-radius: 50% !important;
        justify-content: center;
        flex-shrink: 0;
    }

    .nd-scroll-btn i {
        font-size: 15px;
        line-height: 1;
    }

    .nd-scroll-logo .nd-brand-logo-name {
        font-size: 13.5px !important;
    }
}

/* ── 2. Hero band + compact planner (mobile) ── */
@media (max-width: 640px) {
    .nd-hero {
        padding-bottom: 0;
        background: #fff;
    }

    .nd-hero-panel {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .nd-hero-copy {
        padding-left: 14px !important;
        padding-right: 14px !important;
    }

    .nd-hero-heading {
        font-size: 1.38rem;
        margin-bottom: 8px;
    }

    .nd-hero-subtext {
        font-size: 0.74rem;
        margin-bottom: 12px;
        max-width: 280px;
    }

    .nd-hero-stats {
        width: 100%;
        max-width: none !important;
        padding: 14px 12px;
        gap: 12px 10px;
        border-radius: 14px;
    }

    .nd-hs-icon {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .nd-hs-val {
        font-size: 0.78rem;
    }

    .nd-hs-lbl {
        font-size: 9px;
        line-height: 1.25;
    }

    .nd-planner {
        margin-top: 8px;
        padding: 10px 12px;
        border-radius: 12px;
        box-shadow: 0 2px 14px rgba(15, 23, 42, 0.08);
        background: #fff;
    }
    .nd-pkg-banner,
    .nd-pkg-banner::before,
    .nd-pkg-banner-ico,
    .nd-pkg-plane,
    .nd-cta-box,
    .nd-cta-box::after,
    .nd-proof-stats::before {
        animation: none !important;
    }

    .nd-pkg-banner:hover,
    .nd-proof-stats:hover,
    .nd-cta-box:hover {
        transform: none;
    }
}

@media (max-width: 400px) {
    .nd-hero-panel > .nd-hero-bg-slide,
    .nd-hero-panel > .nd-hero-overlay,
    .nd-hero-copy {
        min-height: 276px;
        height: 276px;
    }

    .nd-hero-copy {
        padding: 14px 12px 16px !important;
    }

    .nd-hero-heading {
        font-size: 1.28rem;
    }

    .nd-planner {
        margin-top: 6px;
        padding: 9px 10px;
    }
}

/* ── 3. Dom / Intl nav tabs ── */
@media (max-width: 640px) {
    .nd-nav-panel {
        margin-top: 0;
        border-radius: 0;
        box-shadow: none;
        border-bottom: 1px solid #e8edf2;
    }

    .nd-nav-panel-inner {
        padding-top: 0;
        padding-bottom: 0;
    }

    .nd-nav-tabs-row {
        gap: 0;
    }

    .nd-nav-type-tab {
        flex: 1;
        justify-content: center;
        padding: 12px 10px;
        font-size: 12px;
    }
}

/* ── 4. Section typography & heads ── */
@media (max-width: 640px) {
    .nd-dest-section-title,
    .nd-styles-title,
    .nd-pkg-title,
    .nd-blog-head .nd-blog-title,
    .nd-why-title,
    .nd-cta-title {
        font-size: 1.22rem !important;
        line-height: 1.28;
    }

    .nd-dest-section-head {
        align-items: flex-end;
        justify-content: space-between;
        flex-direction: row;
        flex-wrap: nowrap;
        margin-bottom: 14px !important;
        gap: 10px;
    }

    .nd-dest-section-head > div:first-child,
    .nd-pkg-head > div:first-child,
    .nd-blog-head > div:first-child {
        flex: 1;
        min-width: 0;
    }

    .nd-dest-section-title,
    .nd-pkg-title,
    .nd-blog-head .nd-blog-title {
        max-width: none !important;
    }

    .nd-pkg-head,
    .nd-blog-head {
        flex-direction: row;
        align-items: flex-end;
        justify-content: space-between;
        flex-wrap: nowrap;
        gap: 10px;
        margin-bottom: 14px !important;
    }

    .nd-view-all {
        font-size: 12px;
        flex-shrink: 0;
        align-self: flex-end;
        margin-bottom: 2px;
    }

    .nd-dest-arr {
        display: none;
    }
}

/* ── 5. Social proof ── */
@media (max-width: 640px) {
    .nd-proof-stats {
        padding: 18px 16px;
        border-radius: 16px;
        gap: 16px;
        margin-bottom: 16px;
    }

    .nd-proof-lead {
        padding-right: 0;
        text-align: center;
    }

    .nd-proof-rating {
        justify-content: center;
    }

    .nd-proof-headline {
        font-size: 1.05rem;
        line-height: 1.4;
    }

    .nd-proof-stat-num {
        font-size: 1.25rem;
    }

    .nd-proof-platforms {
        margin-top: 12px;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        justify-items: stretch;
    }

    .nd-proof-platform-lbl {
        grid-column: 1 / -1;
        text-align: center;
        width: 100%;
    }

    .nd-proof-platform-badge {
        font-size: 0.68rem;
        padding: 6px 10px;
        justify-content: center;
        width: 100%;
        white-space: normal;
        text-align: center;
    }

    .nd-proof-stat {
        background: rgba(255, 255, 255, 0.05);
        border-radius: 10px;
        padding: 10px 6px !important;
    }

    .nd-proof-grid-wrap {
        overflow-x: clip;
        max-width: 100%;
    }

    .nd-proof-grid {
        margin-left: calc(-1 * var(--nd-gutter-x, 12px));
        margin-right: calc(-1 * var(--nd-gutter-x, 12px));
        padding-left: var(--nd-gutter-x, 12px);
        padding-right: var(--nd-gutter-x, 12px);
        scroll-padding-left: var(--nd-gutter-x, 12px);
    }
}

/* ── 6. Travel styles ── */
@media (max-width: 640px) {
    .nd-styles-head {
        margin-bottom: 14px !important;
    }

    .nd-styles-sub {
        font-size: 12px;
        margin-top: 6px;
        line-height: 1.5;
    }

    .nd-styles-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 6px 4px !important;
    }

    .nd-style-item {
        padding: 6px 4px;
    }

    .nd-style-ico {
        width: 52px !important;
        height: 52px !important;
        margin-bottom: 8px !important;
    }

    .nd-style-ico i {
        font-size: 19px !important;
    }

    .nd-style-name {
        font-size: 10.5px;
        line-height: 1.25;
    }

    .nd-style-sub {
        max-width: none;
        font-size: 9px;
        line-height: 1.3;
    }
}

/* ── 7. Packages + price band ── */
@media (max-width: 640px) {
    .nd-pkg-section {
        background: #fff;
    }

    .nd-pkg-carousel-wrap {
        overflow-x: clip !important;
        max-width: 100%;
        margin-left: calc(-1 * var(--nd-gutter-x, 12px));
        margin-right: calc(-1 * var(--nd-gutter-x, 12px));
        padding-left: var(--nd-gutter-x, 12px);
        padding-right: var(--nd-gutter-x, 12px);
    }

    .nd-pkg-carousel {
        scroll-padding-left: var(--nd-gutter-x, 12px);
        padding-right: var(--nd-gutter-x, 12px);
    }

    .nd-pkg-card {
        min-width: 72%;
        max-width: 72%;
    }

    .nd-pkg-banner {
        margin-top: 0 !important;
        padding: 18px 16px;
        border-radius: 16px;
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .nd-pkg-banner-left {
        flex-direction: row;
        align-items: center;
        text-align: left;
        gap: 12px;
        padding-right: 0;
    }

    .nd-pkg-banner-ico {
        width: 52px;
        height: 52px;
    }

    .nd-pkg-banner-title {
        font-size: 1rem;
    }

    .nd-pkg-banner-btn {
        width: 100%;
    }

    .nd-pkg-trust {
        margin-top: 16px !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 14px 12px !important;
    }

    .nd-pkg-trust-item {
        align-items: center;
    }

    .nd-pkg-trust-title {
        font-size: 12px;
        line-height: 1.35;
    }
}

/* ── 8. Blog ── */
@media (max-width: 640px) {
    .nd-blog-grid {
        grid-template-columns: 1fr !important;
        gap: 12px;
    }

    .nd-blog-feat {
        min-height: 200px;
    }
}

/* ── 9. Why choose us ── */
@media (max-width: 640px) {
    .nd-why-section {
        background: #fff;
    }

    .nd-why-head {
        margin-bottom: 14px !important;
    }

    .nd-why-sub {
        font-size: 12px;
        line-height: 1.55;
    }

    .nd-why-features {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px;
    }

    .nd-why-card {
        padding: 14px 10px 12px;
    }

    .nd-why-ico {
        width: 36px;
        height: 36px;
        font-size: 15px;
        margin-bottom: 8px;
    }

    .nd-why-feat-title {
        font-size: 12px;
        line-height: 1.3;
    }

    .nd-why-desc {
        font-size: 11px;
        line-height: 1.45;
    }
}

/* ── 10. CTA banner ── */
@media (max-width: 640px) {
    .nd-cta-box {
        border-radius: 14px;
    }

    .nd-cta-inner {
        padding: 24px 18px !important;
    }

    .nd-cta-title {
        font-size: 1.15rem !important;
    }

    .nd-cta-sub {
        font-size: 0.8rem;
    }
}

/* ── 11. FAQ + app ── */
@media (max-width: 640px) {
    .nd-faq-app-grid {
        gap: 20px !important;
    }

    .nd-faq-head {
        margin-bottom: 14px !important;
    }
}

/* ── 12. Footer — use full width on mobile (2-col links, not single stack) ── */
@media (max-width: 768px) {
    .ndl-footer {
        padding-top: 36px;
    }

    .ndl-footer-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 24px 20px;
        padding-bottom: 28px;
        width: 100%;
    }

    .ndl-footer-grid > div:first-child {
        grid-column: 1 / -1;
    }

    .ndl-footer-grid > div:last-child {
        grid-column: 1 / -1;
    }

    .ndl-footer-tagline {
        max-width: none;
        font-size: 12px;
        margin-bottom: 14px;
    }

    .ndl-footer-col-title {
        margin-bottom: 12px;
        padding-bottom: 8px;
    }
}

@media (max-width: 640px) {
    .ndl-footer {
        padding-top: 28px;
    }

    .ndl-footer-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 20px 16px;
        padding-bottom: 24px;
    }

    .ndl-footer-grid > div:first-child {
        padding-bottom: 4px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        margin-bottom: 4px;
    }

    .ndl-footer-bar {
        padding-top: 14px;
        padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    }

    .ndl-footer-copyright,
    .ndl-footer-legal a {
        font-size: 10.5px;
    }

    .nd-wa-float {
        bottom: calc(14px + env(safe-area-inset-bottom, 0px)) !important;
        right: 14px !important;
        width: 50px;
        height: 50px;
        font-size: 22px;
    }
}

@media (max-width: 480px) {
    .ndl-footer-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 18px 12px;
    }
}

/* ── 13. Global mobile dashboard polish ── */
@media (max-width: 640px) {
    .nd-hero,
    .nd-dest-section,
    .nd-proof,
    .nd-styles-section,
    .nd-pkg-section,
    .nd-price-cta-section,
    .nd-blog-section,
    .nd-why-section,
    .nd-cta,
    .nd-faq-app-section {
        overflow-x: clip;
        max-width: 100%;
    }

    .nd-dest-carousel-wrap {
        overflow-x: clip !important;
    }

    .nd-faq-head {
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 8px;
    }

    .nd-faq-head-title {
        flex: 1;
        min-width: 0;
        font-size: 1.15rem !important;
    }

    .nd-cta-inner {
        padding: 24px 18px !important;
    }

    .nd-cta-btns {
        width: 100%;
    }

    .nd-cta-btn {
        min-height: 44px;
    }

    .nd-pkg-banner-cta-row {
        width: 100%;
    }

    .nd-pkg-banner-cta-row .nd-pkg-banner-btn,
    .nd-pkg-banner-cta-row .nd-pkg-cb-btn {
        flex: 1 1 100%;
        min-height: 44px;
    }
}
