/* ── Flamamed Search ─────────────────────────────────────────────────────── */

.ffs-wrapper {
    position: relative !important;
    width: 100% !important;
    max-width: 440px !important;
    min-width: 260px !important;
}

/* Form */
.ffs-form {
    position: relative;
}

.ffs-input-wrap {
    display: flex !important;
    align-items: center !important;
    background: #fff !important;
    border: 1.5px solid #dde3ec !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    transition: border-color 0.18s, box-shadow 0.18s !important;
    width: 100% !important;
}

.ffs-input-wrap:focus-within {
    border-color: #3A6EA5;
    box-shadow: 0 0 0 3px rgba(58, 110, 165, 0.15);
}

.ffs-input {
    flex: 1;
    border: none !important;
    outline: none !important;
    background: transparent !important;
    padding: 8px 12px !important;
    font-size: 14px !important;
    color: #1a2332 !important;
    line-height: 1.4 !important;
    box-shadow: none !important;
    margin: 0 !important;
    height: 40px !important;
}

.ffs-input::placeholder {
    color: #9aa3b0;
}

.ffs-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    width: 40px !important;
    height: 40px !important;
    min-height: 40px !important;
    border: none !important;
    border-radius: 0 !important;
    background: #3A6EA5 !important;
    color: #fff !important;
    cursor: pointer !important;
    padding: 0 !important;
    transition: background 0.15s !important;
    box-shadow: none !important;
}

.ffs-btn:hover,
.ffs-btn:focus {
    background: #2d5a8a !important;
    color: #fff !important;
}

/* Results dropdown — posicionado por JS con fixed para escapar de cualquier padre */
.ffs-results {
    position: fixed !important;
    background: #ffffff !important;
    background-color: #ffffff !important;
    border: 1.5px solid #dde3ec !important;
    border-radius: 10px !important;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18) !important;
    z-index: 999999 !important;
    max-height: 400px !important;
    overflow-y: auto !important;
    scrollbar-width: thin !important;
    scrollbar-color: #dde3ec transparent !important;
}

.ffs-results::-webkit-scrollbar {
    width: 4px;
}

.ffs-results::-webkit-scrollbar-thumb {
    background: #dde3ec;
    border-radius: 4px;
}

/* Group label */
.ffs-group-label {
    padding: 8px 14px 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #9aa3b0;
}

/* List */
.ffs-list {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Item */
.ffs-item {
    margin: 0 !important;
    padding: 0 !important;
}

.ffs-link {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 8px 14px !important;
    text-decoration: none !important;
    color: #1a2332 !important;
    transition: background 0.12s !important;
}

.ffs-link:hover,
.ffs-link--active {
    background: #edf3fb !important;
    color: #3A6EA5 !important;
}

/* Thumbnail */
.ffs-thumb {
    width: 38px;
    height: 38px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid #f0f0f0;
}

.ffs-thumb--placeholder {
    background: #f0f3f8;
    display: inline-block;
}

/* Item text */
.ffs-item-name {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ffs-item-meta {
    font-size: 12px;
    color: #9aa3b0;
    white-space: nowrap;
    flex-shrink: 0;
}

.ffs-price {
    color: #3A6EA5 !important;
    font-weight: 600;
}

.ffs-price ins {
    text-decoration: none;
}

/* Footer */
.ffs-footer {
    border-top: 1px solid #f0f3f8;
    padding: 10px 14px;
}

.ffs-view-all {
    display: block;
    text-align: center;
    font-size: 13px;
    color: #3A6EA5 !important;
    text-decoration: none !important;
    font-weight: 500;
    transition: color 0.12s;
}

.ffs-view-all:hover {
    color: #2d5a8a !important;
}

.ffs-view-all strong {
    font-weight: 700;
}

/* Empty / error */
.ffs-empty {
    padding: 18px 14px;
    text-align: center;
    font-size: 13px;
    color: #9aa3b0;
}

/* Loading dots */
.ffs-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 18px;
}

.ffs-loading span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #3A6EA5;
    animation: ffs-bounce 0.9s infinite ease-in-out;
}

.ffs-loading span:nth-child(2) { animation-delay: 0.15s; }
.ffs-loading span:nth-child(3) { animation-delay: 0.30s; }

@keyframes ffs-bounce {
    0%, 80%, 100% { transform: scale(0.7); opacity: 0.4; }
    40%            { transform: scale(1);   opacity: 1;   }
}

/* ── Ítem de menú ───────────────────────────────────────────────────────── */

li.ffs-menu-item {
    display: flex !important;
    align-items: center !important;
    padding: 0 !important;
    margin: 0 0 0 12px !important;
    list-style: none !important;
    background: none !important;
}

li.ffs-menu-item > .ffs-wrapper {
    margin: 0 !important;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media ( max-width: 768px ) {
    .ffs-wrapper {
        max-width: 100% !important;
        min-width: 0 !important;
    }

    .ffs-input {
        font-size: 16px !important; /* evita zoom en iOS */
    }

    /* En móvil el dropdown ocupa ancho completo desde abajo */
    .ffs-results {
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        top: auto !important;
        bottom: 0 !important;
        border-radius: 16px 16px 0 0 !important;
        max-height: 70vh !important;
        border-top: 2px solid #dde3ec !important;
        box-shadow: 0 -4px 24px rgba(0,0,0,0.12) !important;
    }

    .ffs-results::before {
        content: '';
        display: block;
        width: 36px;
        height: 4px;
        background: #dde3ec;
        border-radius: 2px;
        margin: 10px auto 6px;
    }
}
