html.floating-search-open,
body.floating-search-open {
    /* Bloquear todo tipo de scroll */
    overflow: hidden;
}

body.floating-search-open {
    position: fixed;
    left: 0;
    right: 0;
    width: 100%;
    height: 100%;
}

/* Global floating search UI */
.floating-search-wrapper {
    position: fixed;
    right: 1rem;
    bottom: calc(1rem + env(safe-area-inset-bottom));
    z-index: 1100;
    pointer-events: none;
}

.floating-search-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1090;
}

.floating-search-backdrop.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.floating-search-btn {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    border: 0;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
    opacity: 0.62;
    transform: scale(0.82) rotate(0deg);
    transition: transform 0.24s ease, opacity 0.2s ease, box-shadow 0.2s ease;
    pointer-events: auto;
}

.floating-search-btn i {
    font-size: 1.1rem;
    transition: transform 0.24s ease;
}

.floating-search-panel {
    position: absolute;
    right: 0;
    bottom: 3rem;
    width: min(92vw, 24rem);
    max-height: min(60vh, 28rem);
    border-radius: 1rem;
    opacity: 0;
    transform: translateY(0.4rem) scale(0.94);
    transform-origin: bottom right;
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.floating-search-panel .card-body {
    height: 100%;
    min-height: 10rem;
}

.floating-search-results {
    min-height: 2rem;
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    border-radius: 0.75rem;
    background: rgba(25, 135, 84, 0.08);
    border: 1px dashed rgba(25, 135, 84, 0.35);
}

.floating-search-result-item {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.floating-search-result-link {
    color: inherit;
}

.floating-search-result-actions .btn {
    min-width: 2rem;
}

.floating-search-result-item + .floating-search-result-item {
    margin-top: 0.5rem;
}

.floating-search-result-item:hover,
.floating-search-result-item:focus-visible {
    border-color: rgba(25, 135, 84, 0.45);
    box-shadow: 0 0.2rem 0.6rem rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.floating-search-result-badge {
    font-weight: 600;
}

.floating-search-result-badge-locked {
    background-color: rgba(255, 193, 7, 0.16);
    border: 1px solid rgba(255, 193, 7, 0.42);
    color: #8a6d00;
}

.floating-search-input-zone {
    flex: 0 0 auto;
}

.floating-search-wrapper.is-open .floating-search-panel {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.floating-search-wrapper.is-open .floating-search-btn {
    opacity: 1;
    transform: scale(1) rotate(180deg);
}

.floating-search-wrapper.is-open .floating-search-btn i {
    transform: rotate(-180deg);
}

@media (hover: hover) and (pointer: fine) {
    .floating-search-btn:hover,
    .floating-search-btn:focus-visible {
        opacity: 1;
        transform: scale(1);
        box-shadow: 0 12px 28px rgba(0, 0, 0, 0.26);
    }
}

@media (max-width: 576px) {
    .floating-search-wrapper {
        left: auto;
        right: 1.35rem;
        bottom: calc(1.35rem + env(safe-area-inset-bottom));
    }

    .floating-search-panel {
        right: 0;
        bottom: 2.85rem;
        max-height: min(58vh, 24rem);
    }

    .floating-search-btn {
        opacity: 0.78;
        transform: scale(1) rotate(0deg);
    }

    .floating-search-wrapper.is-open .floating-search-btn {
        opacity: 0.9;
    }
}


/* Ocultar el botón cuando un modal esté abierto */
.modal-open .floating-search-wrapper {
    display: none;
}
