/* Hoofdnavigatie variant B (body.nav-tabs): tabbalk onderin (telefoon) of zijbalk links (iPad/desktop) */
:root { --p2d-rail: 80px; --p2d-tabbar: 58px; --p2d-sat: env(safe-area-inset-bottom, 0px); }

#p2d-nav { display: none; }
body.nav-tabs #p2d-nav {
    display: flex;
    flex: 0 0 auto;
    z-index: 1100;
    background: #fff;
    color: #64748b;
    font-family: inherit;
}
body.nav-tabs .p2d-tab {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    position: relative; border: 0; background: none; cursor: pointer; color: inherit;
    font: inherit; font-size: 0.6rem; font-weight: 700; letter-spacing: 0; min-width: 0;
    -webkit-tap-highlight-color: transparent;
}
body.nav-tabs .p2d-tab svg { width: 22px; height: 22px; stroke-width: 2; }
body.nav-tabs .p2d-tab span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 1px; }
body.nav-tabs .p2d-tab .p2d-short { display: none; }
body.nav-tabs[data-nav-layout="wide"] .p2d-tab .p2d-short { display: inline; }
body.nav-tabs[data-nav-layout="wide"] .p2d-tab .p2d-short + span { display: none; }
body.nav-tabs .p2d-tab.on { color: #166534; }
body.nav-tabs .p2d-logo { display: none; font-weight: 800; color: #166534; font-size: 0.78rem; text-align: center; margin: 2px 0 8px; }
body.nav-tabs .p2d-logo b { color: #ea580c; }

/* Oude ingangen weg: de tabs regelen weer, plekken en activiteiten */
body.nav-tabs #search-controls,
body.nav-tabs #weather-toggle,
body.nav-tabs #p4n-controls,
body.nav-tabs #tourism-controls { display: none !important; }
body.nav-tabs .layer-switch[data-target="weather-toggle"] { display: none; }

/* Telefoon: tabbalk onderin, kaart erboven */
body.nav-tabs[data-nav-layout="phone"] #p2d-nav {
    height: calc(var(--p2d-tabbar) + var(--p2d-sat));
    padding-bottom: var(--p2d-sat);
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.06);
}
body.nav-tabs[data-nav-layout="phone"] .p2d-tab { flex: 1; }
body.nav-tabs[data-nav-layout="phone"] .p2d-tab.on::before {
    content: ''; position: absolute; top: 0; left: 22%; right: 22%; height: 3px;
    border-radius: 0 0 3px 3px; background: #166534;
}

/* iPad en desktop: zijbalk links, kaart ernaast */
body.nav-tabs[data-nav-layout="wide"] #app { flex-direction: row; }
body.nav-tabs[data-nav-layout="wide"] #header { display: none; }
body.nav-tabs[data-nav-layout="wide"] #p2d-nav {
    order: -1;
    flex-direction: column;
    width: var(--p2d-rail);
    padding-top: 10px;
    border-right: 1px solid #e2e8f0;
}
body.nav-tabs[data-nav-layout="wide"] .p2d-logo { display: block; }
body.nav-tabs[data-nav-layout="wide"] .p2d-tab { width: 72px; height: 56px; margin: 2px 4px; border-radius: 12px; font-size: 0.58rem; }
body.nav-tabs[data-nav-layout="wide"] .p2d-tab.on { background: #dcfce7; }
body.nav-tabs[data-nav-layout="wide"] .p2d-tab:hover { background: #f1f5f9; }

/* Balk bovenin: filters (paneel dicht), routetype-chips en 'Zoek in dit gebied' */
#p2d-bar {
    position: absolute; z-index: 1003; left: 50%; transform: translateX(-50%); top: 66px;
    display: flex; flex-direction: column; align-items: center; gap: 8px; max-width: calc(100% - 120px); pointer-events: none;
}
#p2d-bar > * { pointer-events: auto; }
body:not(.is-phone) #p2d-bar { top: 70px; }
body.is-phone #p2d-bar { top: 86px; }
body.ps-hero-open #p2d-bar { display: none; }
.p2d-filters { display: flex; gap: 8px; }
.p2d-filters[hidden], .p2d-filters button[hidden] { display: none; }
.p2d-filters button {
    display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border: 0; cursor: pointer;
    border-radius: 999px; background: #fff; color: #334155; font: inherit; font-size: 0.82rem; font-weight: 700;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.18);
}
.p2d-filters button svg { width: 15px; height: 15px; color: #166534; }
.p2d-bar-chips { max-width: 100%; }
.p2d-bar-chips:empty { display: none; }
.p2d-chips.in-bar { max-width: 100%; padding: 2px 0; }
.p2d-chips.in-bar .p2d-chip { height: 32px; background: #fff; box-shadow: 0 4px 14px rgba(15, 23, 42, 0.14); border-color: #fff; }
.p2d-chips.in-bar .p2d-chip.on { background: #166534; border-color: #166534; }
.ts-filter.p2d-hidden { display: none !important; }
#p2d-refresh {
    position: static;
    display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border: 0; cursor: pointer;
    border-radius: 999px; background: #fff; color: #166534; font: inherit; font-size: 0.82rem; font-weight: 700;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.18);
}
#p2d-refresh svg { width: 15px; height: 15px; }
#p2d-refresh[hidden] { display: none; }

/* Weer-tab: Zon zoeken en favorieten boven de tijdbalk (alleen telefoon; op groot scherm staan de knoppen rechts) */
#p2d-wx-tools { display: none; gap: 8px; padding: 8px 12px 0; }
body.nav-tabs.is-phone #p2d-wx-tools { display: flex; }
body.nav-tabs.is-phone #time-control.collapsed #p2d-wx-tools { display: none; }
#p2d-wx-tools button {
    flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px;
    border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 10px; background: rgba(255, 255, 255, 0.08);
    color: #fff; font: inherit; font-size: 0.78rem; font-weight: 700; cursor: pointer;
}
#p2d-wx-tools button svg { width: 16px; height: 16px; color: #fbbf24; }
#p2d-wx-tools button[data-target="fav-toggle"] svg { color: #f87171; }
#p2d-wx-tools button.on { background: #16a34a; border-color: #16a34a; }
#p2d-wx-tools button.on svg { color: #fff; }

/* Routes-tab: chips per routetype in de slider */
.p2d-chips { display: flex; gap: 6px; overflow-x: auto; padding: 6px 0 2px; scrollbar-width: none; }
.p2d-chips::-webkit-scrollbar { display: none; }
.p2d-chips[hidden] { display: none; }
.p2d-chip {
    flex: 0 0 auto; display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px;
    border: 1px solid #e2e8f0; border-radius: 999px; background: #f8fafc; color: #64748b;
    font: inherit; font-size: 0.74rem; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.p2d-chip svg { width: 13px; height: 13px; }
.p2d-chip.on { background: #166534; border-color: #166534; color: #fff; }

/* Telefoon (tabs): zoekbalk over de volle breedte, daaronder rechts de knoppen lagen en locatie */
@media (max-width: 600px) {
    body.nav-tabs.is-phone #place-search.mode-compact { left: 10px; right: 10px; width: auto; }
    body.nav-tabs.is-phone #layer-selector { top: 60px; right: 10px; }
    body.nav-tabs.is-phone #locate-btn { top: 108px; right: 10px; }
    body.nav-tabs.is-phone #sun-bar { right: 58px; }
}

/* Sleepbaar resultatenpaneel (tabs, telefoon en iPad staand): kopregel slepen, 3 standen */
body.nav-tabs #tourism-slider.mode-bottom .ts-header { touch-action: none; cursor: grab; }
body.nav-tabs #tourism-slider.mode-bottom.ts-sheet-drag .ts-header { cursor: grabbing; }
body.nav-tabs #tourism-slider.mode-bottom { transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease, height 0.25s ease; }
body.nav-tabs #tourism-slider.mode-bottom.dragging { transition: none; }
body.nav-tabs #tourism-slider.mode-bottom.ts-sheet-drag .ts-track { overflow: hidden; }
body.nav-tabs #tourism-slider.mode-bottom.ts-full .ts-track {
    flex: 1; min-height: 0; flex-direction: column; overflow-y: auto; overflow-x: hidden;
    padding: 4px 10px 10px; touch-action: pan-y;
}
body.nav-tabs #tourism-slider.mode-bottom.ts-full .ts-card { width: 100%; height: 96px; }

/* Audit-fixes: chips over meerdere regels; Franse korte tabnaam op telefoon; lagenmenu op liggende telefoon */
.p2d-chips { flex-wrap: wrap; overflow: visible; }
html[lang="fr"] body.nav-tabs[data-nav-layout="phone"] .p2d-tab .p2d-short { display: inline; }
html[lang="fr"] body.nav-tabs[data-nav-layout="phone"] .p2d-tab .p2d-short + span { display: none; }
@media (max-height: 500px) {
    #layer-dropdown { max-height: calc(100vh - 60px) !important; max-height: calc(100dvh - 60px) !important; overflow-y: auto; }
}
/* Telefoon: omschrijving in popups kort houden zodat de knoppen zichtbaar blijven ('Meer' toont de rest) */
body.is-phone .tourism-popup-description { max-height: 4.5em; overflow: hidden; }

/* Filterknoppen bovenin: actieve-filterteller */
.p2d-filters button.is-filtered { border-color: #ea580c; box-shadow: inset 0 0 0 1px #ea580c; }
.p2d-fcount { background: #ea580c; color: #fff; border-radius: 999px; font-size: 0.68rem; padding: 0 6px; line-height: 16px; }
.p2d-fcount[hidden] { display: none; }
