/* ===== navbar (extraído de navbar.php, DEV-438) ===== */
:root {
        --app-navbar-item-size: 38px;
        --app-navbar-item-icon-size: 1.3333em;
        --app-navbar-img-max-size: 150px;
        --app-navbar-item-font-size: 1rem;
        --app-navbar-height: 54px;
    }

    @media only screen and (max-width: 500px) {
        :root {
            --app-navbar-item-size: 22px !important;
            --app-navbar-item-icon-size: 1em !important;
            --app-navbar-img-max-size: 100px !important;
            --app-navbar-item-font-size: 0.7rem !important;
            --app-navbar-height: 40px;
        }
    }

    #fby-navbar-wrapper {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        background-color: rgba(var(--bs-body-bg-rgb), 1);
        box-shadow: none;
        border-bottom: 1px solid rgba(0, 0, 0, .1);
        transition: background-color .2s ease-in-out, box-shadow .2s ease-in-out;
        z-index: 1030;
    }


    /* Compact navbar on scroll */

    #fby-navbar-wrapper.compact > .container {
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
    }

    #fby-navbar-wrapper.compact .navbar-main-row {
        display: contents !important;
    }

    /* Hide nav links in compact — !important needed to override Bootstrap d-md-block */
    #fby-navbar-wrapper.compact .navbar-main-row > div:nth-child(2) {
        display: none !important;
    }

    /* Logo stays left */
    #fby-navbar-wrapper.compact .navbar-main-row > div:first-child {
        order: 1;
        flex: 1 !important;
    }

    /* Actions stay right */
    #fby-navbar-wrapper.compact .navbar-main-row > div:last-child {
        order: 3;
        flex: 1 !important;
        justify-content: flex-end;
    }

    /* Search centered, limited width */
    #fby-navbar-wrapper.compact .navbar-search-wrapper {
        order: 2;
        flex: 0 1 480px;
        padding: 0 !important;
        max-width: 480px !important;
        width: auto !important;
        margin: 0 !important;
    }

    /* Smaller input in compact */
    #fby-navbar-wrapper.compact #navbar-search-input {
        box-shadow: rgba(0, 0, 0, 0.08) 0px 1px 2px, rgba(0, 0, 0, 0.05) 0px 4px 12px;
        padding-top: .4rem !important;
        padding-bottom: .4rem !important;
        font-size: .9rem !important;
    }

    .app-navbar-img {
        max-width: var(--app-navbar-img-max-size);
    }

    .app-navbar-item {
        height: var(--app-navbar-item-size);
        min-width: var(--app-navbar-item-size);
        font-size: var(--app-navbar-item-font-size);
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .app-navbar-item i {
        font-size: var(--app-navbar-item-icon-size);
    }

    #fby-navbar-wrapper .nav-link {
        color: rgba(0, 0, 0, 0.45);
        transition: color .15s ease-in-out;
    }

    #fby-navbar-wrapper .nav-link:hover {
        color: rgba(0, 0, 0, 1);
    }

    #fby-navbar-wrapper .nav-link.active {
        color: rgba(0, 0, 0, 1);
        border-bottom: 2px solid rgba(0, 0, 0, 1);
        padding-bottom: 2px;
    }

    .navbar-search-wrapper {
        position: relative;
        transition: padding .25s ease;
    }

    #navbar-search-input {
        box-shadow: rgba(0, 0, 0, 0.1) 0 8px 24px 0, rgba(0, 0, 0, 0.02) 0 0 0 1px;
    }

    .navbar-search-dropdown {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        width: 100%;
        max-height: 70vh;
        overflow: hidden;
        background: #fff;
        border: 1px solid rgba(0,0,0,.1);
        border-radius: 1.5rem;
        box-shadow: 0 .5rem 2rem rgba(0,0,0,.12);
        z-index: 1050;
        margin-top: .5rem;
        /* Animation: zoom from input */
        transform-origin: top center;
        transform: scaleX(.92) scaleY(.6);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: transform .25s cubic-bezier(.2, 0, .13, 1.02), opacity .2s ease, visibility 0s .25s;
    }
    .nbs-scroll-wrapper {
        max-height: 70vh;
        overflow-y: auto;
        padding: .75rem 0;
        scrollbar-width: thin;
        scrollbar-color: rgba(0,0,0,.2) transparent;
    }
    .nbs-scroll-wrapper::-webkit-scrollbar {
        width: 6px;
    }
    .nbs-scroll-wrapper::-webkit-scrollbar-track {
        background: transparent;
    }
    .nbs-scroll-wrapper::-webkit-scrollbar-thumb {
        background: rgba(0,0,0,.18);
        border-radius: 3px;
    }
    .nbs-scroll-wrapper::-webkit-scrollbar-thumb:hover {
        background: rgba(0,0,0,.3);
    }

    .navbar-search-dropdown.show {
        transform: scaleX(1) scaleY(1);
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transition: transform .25s cubic-bezier(.2, 0, .13, 1.02), opacity .2s ease, visibility 0s 0s;
    }

    /* Filter sections */
    .nbs-section {
        padding: .4rem 1.25rem;
        margin-bottom: .6rem;
    }
    .nbs-section h6 {
        font-size: .75rem;
        font-weight: 600;
        color: rgba(0,0,0,.4);
        text-transform: uppercase;
        letter-spacing: .04em;
        margin-bottom: .5rem;
    }

    /* Coaches horizontal scroll */
    .nbs-coaches {
        display: flex;
        gap: .6rem;
        overflow-x: auto;
        padding-bottom: .25rem;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .nbs-coaches::-webkit-scrollbar { display: none; }
    .nbs-scroll-btn {
        width: 26px;
        height: 26px;
        border-radius: 50%;
        border: 1px solid var(--bs-border-color, #dee2e6);
        background: var(--bs-body-bg, #fff);
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        cursor: pointer;
        color: #222;
        transition: all .15s ease;
    }
    .nbs-scroll-btn:hover { background: var(--bs-tertiary-bg); }
    .nbs-scroll-btn.disabled { opacity: .3; cursor: default; pointer-events: none; }
    .nbs-scroll-btn i { font-size: 16px; line-height: 1; }
    .nbs-coach {
        flex-shrink: 0;
        text-align: center;
        width: 76px;
    }
    .nbs-coach input { display: none; }
    .nbs-coach img {
        width: 72px;
        height: 72px;
        border-radius: 50%;
        object-fit: cover;
        border: 2px solid transparent;
        transition: border-color .15s;
    }
    .nbs-coach input:checked ~ label img {
        border-color: var(--bs-primary);
    }
    .nbs-coach label {
        cursor: pointer;
        font-size: .75rem;
        color: rgba(0,0,0,.7);
        line-height: 1.2;
        display: block;
        margin-top: .4rem;
    }

    /* Filter chips */
    .nbs-chips {
        display: flex;
        flex-wrap: wrap;
        gap: .35rem;
    }
    .nbs-chip input { display: none; }
    .nbs-chip label {
        display: inline-block;
        padding: .25rem .7rem;
        border-radius: 2rem;
        border: 1px solid var(--bs-primary);
        font-size: .8rem;
        cursor: pointer;
        transition: all .15s;
        color: var(--bs-primary);
        background: transparent;
        user-select: none;
    }
    .nbs-chip label:hover {
        background: rgba(var(--bs-primary-rgb), .06);
    }
    .nbs-chip input:checked + label {
        background: var(--bs-primary);
        border-color: var(--bs-primary);
        color: #fff;
    }
    /* Cascade: filtro sin resultados con los demás filtros activos */
    .nbs-filtro-no-disponible label,
    .nbs-filtro-no-disponible img,
    .nbs-coach.nbs-filtro-no-disponible {
        opacity: .35;
        pointer-events: none;
        cursor: not-allowed;
    }

    /* Duration chips */
    .nbs-durations {
        display: flex;
        gap: .4rem;
        flex-wrap: wrap;
    }
    .nbs-dur input { display: none; }
    .nbs-dur label {
        width: 52px;
        height: 52px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        border: 1px solid var(--bs-primary);
        font-size: .72rem;
        cursor: pointer;
        transition: all .15s;
        color: var(--bs-primary);
        text-align: center;
        line-height: 1.15;
        user-select: none;
    }
    .nbs-dur label:hover {
        background: rgba(var(--bs-primary-rgb), .06);
    }
    .nbs-dur input:checked + label {
        background: var(--bs-primary);
        border-color: var(--bs-primary);
        color: #fff;
    }

    /* Footer with apply button */
    .nbs-footer {
        position: sticky;
        bottom: 0;
        background: #fff;
        padding: .6rem 1.25rem;
        border-top: 1px solid rgba(0,0,0,.06);
    }

    /* Results */
    .nbs-result {
        display: flex;
        align-items: center;
        padding: .5rem 1.25rem;
        text-decoration: none;
        color: inherit;
        transition: background .12s;
        cursor: pointer;
    }
    .nbs-result:hover {
        background: rgba(0,0,0,.04);
    }
    .nbs-result-thumb {
        width: 128px;
        aspect-ratio: 16/9;
        border-radius: .75rem;
        object-fit: cover;
        background: #f0f0f0;
        flex-shrink: 0;
    }
    .nbs-result-info {
        margin-left: .75rem;
        overflow: hidden;
        flex: 1;
    }
    .nbs-result-title {
        font-weight: 500;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .nbs-result-sub {
        font-size: .82rem;
        color: rgba(0,0,0,.5);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .nbs-result-tags {
        display: flex;
        flex-wrap: wrap;
        gap: .2rem;
        margin-top: .25rem;
        overflow: hidden;
        max-height: 1.6rem;
    }
    .nbs-result-tags .badge {
        font-size: .68rem;
        font-weight: 400;
    }

    .nbs-header {
        padding: .3rem 1.25rem .5rem;
        display: flex;
        align-items: center;
        gap: .5rem;
    }
    .nbs-header button {
        background: none;
        border: none;
        padding: .2rem;
        cursor: pointer;
        color: rgba(0,0,0,.5);
        display: flex;
    }
    .nbs-header button:hover { color: rgba(0,0,0,.8); }
    .nbs-header span {
        font-size: .8rem;
        font-weight: 600;
        color: rgba(0,0,0,.4);
        text-transform: uppercase;
        letter-spacing: .04em;
    }

    .nbs-empty {
        padding: 2rem 1.25rem;
        text-align: center;
        color: rgba(0,0,0,.4);
    }

    /* Active filter pills */
    .nbs-pills {
        display: flex;
        flex-wrap: wrap;
        gap: .3rem;
        padding: .25rem 1.25rem .5rem;
    }
    .nbs-pill {
        display: inline-flex;
        align-items: center;
        gap: .2rem;
        padding: .15rem .55rem;
        border-radius: 2rem;
        background: rgba(var(--bs-primary-rgb), .1);
        color: var(--bs-primary);
        font-size: .75rem;
        cursor: pointer;
        border: none;
    }
    .nbs-pill:hover {
        background: rgba(var(--bs-primary-rgb), .2);
    }

    /* Search shade overlay — behind navbar, covers page content */
    #navbar-search-shade {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, .35);
        z-index: 1029; /* just below navbar (1030) */
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity .25s ease, visibility 0s .25s;
    }
    #navbar-search-shade.show {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transition: opacity .25s ease, visibility 0s 0s;
    }

    /* Tabs Inicio / Fitness / Nutrición — arriba del buscador, estilo Airbnb.
       Specs medidas directamente del sitio de Airbnb:
       - icon 36x36, label 14px weight 400/500, gap 16px horizontal
       - tabs gap 35px, label-only underline al activar
       Visibles solo en desktop; en mobile la navegación va por el tabbar inferior. */
    .navbar-section-tabs {
        display: flex;
        justify-content: center;
        gap: 35px;
        align-items: center;
    }
    .navbar-section-tab {
        display: inline-flex;
        align-items: center;
        gap: 0;
        padding: 0 0 0 5px;
        font-size: 14px;
        font-weight: 400;
        line-height: 18px;
        color: rgb(34, 34, 34);
        text-decoration: none;
        position: relative;
        transition: opacity .15s ease;
        white-space: nowrap;
        opacity: .7;
    }
    .navbar-section-tab i,
    .navbar-section-tab .nav-lottie {
        font-size: 32px;
        line-height: 1;
        width: 36px;
        height: 36px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        color: var(--bs-primary);
        transition: color .15s ease;
        flex-shrink: 0;
    }
    .navbar-section-tab .nav-lottie svg {
        width: 100%;
        height: 100%;
    }
    .navbar-section-tab > span:not(.nav-lottie) {
        margin-left: 16px;
    }
    .navbar-section-tab:hover {
        opacity: 1;
        color: rgb(34, 34, 34);
    }
    .navbar-section-tab.active {
        opacity: 1;
        font-weight: 500;
    }
    .navbar-section-tab.active::after {
        content: "";
        position: absolute;
        bottom: -8px;
        left: 0;
        right: 0;
        height: 2px;
        background: rgb(34, 34, 34);
        border-radius: 1px;
    }
    /* En compact (scrolled) ocultar los tabs para ahorrar espacio — el usuario
       ya navego y la URL/contexto persiste. */
    #fby-navbar-wrapper.compact .navbar-section-tabs {
        display: none;
    }

    /* Tabs del buscador — solo visibles cuando el dropdown esta abierto.
       Comparten el mismo slot del menu superior (navbar-section-tabs) para
       no cambiar la altura del navbar. */
    .navbar-center-zone {
        position: relative;
    }
    .search-context-tabs {
        display: none;
        justify-content: center;
        gap: 35px;
        align-items: center;
    }
    .search-context-tab {
        background: none;
        border: 0;
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        gap: 0;
        padding: 0 0 0 5px;
        font-size: 14px;
        font-weight: 400;
        line-height: 18px;
        color: rgb(34, 34, 34);
        position: relative;
        transition: opacity .15s ease;
        white-space: nowrap;
        opacity: .7;
    }
    .search-context-tab i,
    .search-context-tab .nav-lottie {
        font-size: 32px;
        line-height: 1;
        width: 36px;
        height: 36px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        color: var(--bs-primary);
        transition: color .15s ease;
        flex-shrink: 0;
    }
    .search-context-tab .nav-lottie svg {
        width: 100%;
        height: 100%;
    }
    .search-context-tab > span:not(.nav-lottie) {
        margin-left: 16px;
    }
    .search-context-tab:hover {
        opacity: 1;
    }
    .search-context-tab.active {
        opacity: 1;
        font-weight: 500;
    }
    .search-context-tab.active::after {
        content: "";
        position: absolute;
        bottom: -8px;
        left: 0;
        right: 0;
        height: 2px;
        background: rgb(34, 34, 34);
        border-radius: 1px;
    }
    #fby-navbar-wrapper.searching .navbar-section-tabs {
        display: none !important;
    }
    #fby-navbar-wrapper.searching .search-context-tabs {
        display: flex;
    }

    .nbs-panel {
        display: block;
    }
    .nbs-panel.d-none { display: none !important; }

/* ===== footer (extraído de footer.php, DEV-438) ===== */
.btn-fav-col {
    background: none;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    color: #999;
    font-size: 1.25rem;
    line-height: 1;
    transition: color 0.15s;
    border-radius: 50%;
}
.btn-fav-col:hover { color: #666; }
.btn-fav-col.fav-active { color: var(--bs-danger); }
.btn-fav-col.fav-active i { color: var(--bs-danger); }
.fav-col-popover {
    width: 240px;
    animation: favPopIn 0.15s ease;
}
@keyframes favPopIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}
.fav-col-popover-inner {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.18);
    overflow: hidden;
}
.fav-col-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0.85rem 0.5rem;
    border-bottom: 1px solid var(--bs-border-color-translucent);
}
.fav-col-header-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--bs-body-color);
}
.fav-col-add-btn {
    border: none;
    background: none;
    cursor: pointer;
    color: var(--bs-body-color);
    font-size: 1.2rem;
    line-height: 1;
    padding: 0;
    display: flex;
    align-items: center;
}
.fav-col-add-btn:hover { color: var(--bs-primary); }
.fav-col-list {
    max-height: 240px;
    overflow-y: auto;
    padding: 0.25rem 0;
}
.fav-col-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    padding: 0.45rem 0.85rem;
    border: none;
    background: none;
    font-size: 0.9rem;
    cursor: pointer;
    text-align: left;
    color: var(--bs-body-color);
    transition: background 0.1s;
}
.fav-col-item:hover { background: var(--bs-tertiary-bg); }
.fav-col-item-active { background: var(--bs-primary-bg-subtle); }
.fav-col-item-active:hover { background: var(--bs-primary-bg-subtle); }
.fav-col-thumb {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--bs-secondary-bg);
}
.fav-col-thumb-placeholder {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    flex-shrink: 0;
    background: var(--bs-secondary-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #aaa;
    font-size: 1rem;
}
.fav-col-name {
    flex-grow: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.fav-col-empty {
    padding: 1.5rem 0.85rem;
    text-align: center;
    color: #999;
    font-size: 0.85rem;
}
.fav-col-input-wrap {
    display: flex;
    gap: 0.25rem;
    padding: 0;
    width: 100%;
}
.fav-col-input {
    flex-grow: 1;
    border: 1px solid var(--bs-border-color);
    border-radius: 6px;
    padding: 0.25rem 0.5rem;
    font-size: 0.85rem;
    outline: none;
}
.fav-col-input:focus { border-color: var(--bs-primary); }
.fav-col-input-btn {
    border: none;
    background: var(--bs-primary);
    color: #fff;
    border-radius: 6px;
    width: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}
.fav-col-header .fav-col-input-wrap {
    padding: 0;
}

/* Toast global: anclado abajo, arriba del tabbar; ancho contenido */
#fby-toast-container {
    bottom: 110px;
}
@media (max-width: 575.98px) {
    #fby-toast-container {
        bottom: calc(80px + env(safe-area-inset-bottom, 0px));
    }
}
#fby-toast-container .toast {
    min-width: 0;
    max-width: min(320px, 90vw);
    background-color: #fff;
}

/* ===== tabbar (extraído de tabbar.php, DEV-438) ===== */
.fby-tabbar {
        position: fixed;
        bottom: 32px;
        height: 56px;
        left: 50%;
        transform: translateX(-50%);
        z-index: 1025;
        background: #fff;
        border-radius: 999px;
        border: 1px solid rgba(0, 0, 0, .1);
        box-shadow: 0 4px 12px 0 rgba(0, 0, 0, .2);
        display: flex;
        align-items: center;
        gap: 4px;
        padding: 6px;
        padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
    }

    .fby-tabbar-item {
        display: flex;
        align-items: center;
        gap: 6px;
        padding: 8px 16px;
        border-radius: 999px;
        text-decoration: none;
        color: rgba(0, 0, 0, .4);
        font-size: 16px;
        font-weight: 500;
        white-space: nowrap;
        transition: all .2s ease;
    }

    .fby-tabbar-item:hover {
        color: rgba(0, 0, 0, .7);
        background: rgba(0, 0, 0, .04);
    }

    .fby-tabbar-item.active {
        color: var(--bs-primary);
        background: rgba(var(--bs-primary-rgb), .1);
    }

    .fby-tabbar-item i {
        font-size: 24px;
        line-height: 1;
    }

    /* Mobile: app-style tabbar pegado al fondo */
    @media (max-width: 575.98px) {
        .fby-tabbar {
            bottom: 0;
            left: 0;
            right: 0;
            width: 100%;
            transform: none;
            border-radius: 0;
            border: none;
            border-top: 1px solid rgba(0,0,0,.06);
            box-shadow: 0 -1px 3px rgba(0,0,0,.04);
            height: auto;
            justify-content: space-around;
            padding: 6px 0;
            padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
        }
        .fby-tabbar-item {
            flex-direction: column;
            gap: 2px;
            padding: 4px 0;
            font-size: 10px;
            border-radius: 0;
            flex: 1;
            text-align: center;
            justify-content: center;
        }
        .fby-tabbar-item.active {
            background: transparent;
        }
        .fby-tabbar-item span {
            display: block;
        }
    }
