﻿/* ==========================================================================
   NIVEL 3: ELEMENTO DE LA LISTA (Hijo directo de main-navhelp)
   ========================================================================== */

/* Clase: nav-item-searchhelp */
.nav-item-searchhelp {
    list-style: none;
    margin: 0;
    padding: 5px 5px;
    height: 85px;
    background-color: #fff;
    border-radius: 12px 12px 0 0;
}


/* ==========================================================================
   NIVEL 4: CONTENEDOR DE LA BÚSQUEDA (Hijo directo de nav-item-searchhelp)
   ========================================================================== */

/* Clase: bdr-searchhelp */
.bdr-searchhelp {
    display: flex;
    align-items: center;
    width: 100%;
    margin-top: 10px;
    height: 50px;
    padding: 0 16px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 50rem;
    color: #6c757d;
    box-sizing: border-box;
    user-select: none;
    overflow: hidden;
}


/* ==========================================================================
   NIVEL 5: ELEMENTOS INTERNOS DE BDR-SEARCHHELP (Hijos directos)
   ========================================================================== */

/* Clase: back-arrowhelp */
/* Flecha regresar */
.back-arrowhelp {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 100%;
    margin-right: 6px;
    font-size: 28px;
    line-height: 1;
    color: #444;
    flex: 0 0 28px;
    cursor: pointer;
    user-select: none;
    pointer-events:auto;
}

/* Clase: bdr-cobertura */
.bdr-cobertura {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    min-width: 0;
    padding: 4px 12px;
    border-radius: 3rem;
    background-color: #0d6efd;
    box-sizing: border-box;
    user-select: none;
}

/* Clase: searchbarhelp | ID: search-containerhelp | Name: search-barhelp */
#search-containerhelp {
    display: block;
    flex: 1 1 0;
    min-width: 0;
    width: 0;
    height: 100%;
    margin: 0;
    padding: 0 10px;
    border: none;
    border-radius: 0;
    background-color: transparent;
    outline: none;
    font-size: 16px;
    line-height: normal;
    color: #374151;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
}


/* Botón drop */
.btn-drop {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 25px;
    width: 25px;
    min-width: 25px;
    height: 25px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #6b7280;
    outline: none;
    box-sizing: border-box;
    cursor: pointer;
    user-select: none;
    animation: breatheDrop 3s ease-in-out infinite;
    transition: transform 0.2s ease-in-out;
    -webkit-appearance: none;
    appearance: none;
}
/* Ocultación por JS */
.btn-drop-hidden {
    opacity: 0;
    display: none;
    pointer-events: none;
}

/* Contenedor de los SVG */
.btn-drop .drop-icon-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    transform: rotate(0deg);
    transform-origin: center;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}


/* SVG superpuestos correctamente */
.btn-drop .drop-close,
.btn-drop .drop-left,
.btn-drop .drop-open {
    position: absolute;
    inset: 0;
    display: block;
    width: 18px;
    height: 18px;
    margin: auto;
    fill: none;
    stroke: currentColor;
    box-sizing: border-box;
    transition: opacity 0.2s ease-in-out;
}

/* --- CONTROL DE VISIBILIDAD INICIAL (Estado Cerrado) --- */
.btn-drop .drop-close {
    opacity: 1;
}
/* Se ve la flecha abajo ∨ */
.btn-drop .drop-left {
    opacity: 0;
}
/* Oculto */
.btn-drop .drop-open {
    opacity: 0;
}
/* Oculto */

/* ==================================================
   ABRIR: ABAJO → IZQUIERDA → ARRIBA
   ================================================== */

.btn-drop.open {
    animation-play-state: paused;
}

    .btn-drop.open .drop-icon-wrapper {
        transform: rotate(0deg);
    }


    /* Flecha hacia abajo */
    .btn-drop.open .drop-close {
        animation: arrowDownOpen 0.6s forwards;
    }

    /* Flecha hacia la izquierda */
    .btn-drop.open .drop-left {
        animation: arrowLeftOpen 0.6s forwards;
    }

    /* Flecha hacia arriba */
    .btn-drop.open .drop-open {
        animation: arrowUpOpen 0.6s forwards;
    }


@keyframes arrowDownOpen {
    0% {
        opacity: 1;
    }

    30%, 100% {
        opacity: 0;
    }
}

@keyframes arrowLeftOpen {
    0%, 25% {
        opacity: 0;
    }

    40%, 60% {
        opacity: 1;
    }

    75%, 100% {
        opacity: 0;
    }
}

@keyframes arrowUpOpen {
    0%, 65% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}


/* ==================================================
   CERRAR: ARRIBA → IZQUIERDA → ABAJO
   ================================================== */

.btn-drop.closing {
    animation-play-state: paused;
}

    .btn-drop.closing .drop-icon-wrapper {
        transform: rotate(0deg);
    }


    /* Flecha hacia arriba */
    .btn-drop.closing .drop-open {
        animation: arrowUpClose 0.6s forwards;
    }

    /* Flecha hacia la izquierda */
    .btn-drop.closing .drop-left {
        animation: arrowLeftClose 0.6s forwards;
    }

    /* Flecha hacia abajo */
    .btn-drop.closing .drop-close {
        animation: arrowDownClose 0.6s forwards;
    }


@keyframes arrowUpClose {
    0% {
        opacity: 1;
    }

    30%, 100% {
        opacity: 0;
    }
}

@keyframes arrowLeftClose {
    0%, 25% {
        opacity: 0;
    }

    40%, 60% {
        opacity: 1;
    }

    75%, 100% {
        opacity: 0;
    }
}

@keyframes arrowDownClose {
    0%, 65% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}


/* ==================================================
   ESTADOS FINALES
   ================================================== */

/* Abierto: se queda apuntando arriba */
.btn-drop.open .drop-close,
.btn-drop.open .drop-left {
    animation-fill-mode: forwards;
}

.btn-drop.open .drop-open {
    animation-fill-mode: forwards;
}


/* Cerrado normal: se queda apuntando abajo */
.btn-drop:not(.open):not(.closing) .drop-close {
    opacity: 1;
}

.btn-drop:not(.open):not(.closing) .drop-left,
.btn-drop:not(.open):not(.closing) .drop-open {
    opacity: 0;
}

/* ==========================================
   TEXTO "BUSCAR EN WACHATWEB..."
   ========================================== */

.searchtxthelp {
    display: none;
    color: #9aa3af; /* Gris claro */
    font-size: 16px;
    user-select: none;
    flex: 1;
    height: 52px;
    margin-right: 0;
    padding: 0 12px;
    border: none;
    background-color: transparent;
    outline: none;
    box-sizing: border-box;
    cursor: text;
    align-content: center;
    text-wrap: nowrap;
}

/* ==========================================
   VISIBILIDAD INPUT / TEXTO
   ========================================== */

.help-visible {
    display: block !important;
}

.help-hidden {
    display: none !important;
}
/* --- DEFINICIÓN DE ANIMACIONES (Keyframes) --- */

/* 1. La respiración: Sube y baja 1.5px sutilmente todo el tiempo */
@keyframes breatheDrop {
    0%, 100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-1.5px);
    }
}

/* 2. El descenso al abrir: Hace que el icono que apunta arriba se asiente bajando un poco */
@keyframes dipOpenIcon {
    0% {
        transform: translateY(-4px);
        opacity: 0;
    }

    50% {
        transform: translateY(2px); /* Baja un poco de más */
        opacity: 1;
    }

    100% {
        transform: translateY(0); /* Se estabiliza en su posición */
    }
}
/* Clase: btn-clear | ID: btn-clear-search | Name: btn-clearsearch */
/* Botón limpiar */
.btn-clear {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 25px;
    width: 25px;
    min-width: 25px;
    height: 25px;
    margin: 0 0 0 4px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #e5e7eb;
    color: #6b7280;
    outline: none;
    box-sizing: border-box;
    cursor: pointer;
    transition: background-color 0.2s ease, opacity 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
}



    .btn-clear:hover {
        background: rgba(107, 114, 128, 0.25);
        border: none;
    }

/* Ocultación por JS */
.btn-clear-hidden {
    opacity: 0;
    display: none;
    pointer-events: none;
}


/* ==========================================================================
   NIVEL 6: SUB-ELEMENTOS (Hijos de bdr-cobertura, btn-drop y btn-clear)
   ========================================================================== */

/* --- Hijos de bdr-cobertura --- */

/* Clase: label-cobertura */
.label-cobertura {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #ffffff;
    margin-right: 8px;
    flex-shrink: 0;
    user-select: none;
}

/* Clase: txt-largo (No declarado en tu CSS original, disponible si lo requieres) */

/* Clase: txt-corto */
.txt-corto {
    display: none;
}

/* Clase: close-cobertura */
.close-cobertura {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #ffffff;
    opacity: 0.7;
    flex-shrink: 0;
    user-select: none;
    cursor: not-allowed;
}



/* --- Hijo de btn-clear --- */

/* Clase: text-clear (No declarado en tu CSS original, disponible si lo requieres) */

/* X del botón limpiar */
.text-clear {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    font-style: normal;
    font-size: 20px;
    font-weight: 400;
    line-height: 1;
    transform: translateY(-1px);
}
@media (min-width: 600px) {
    .nav-item-searchhelp {
        background-color: transparent;
        padding: 0;
        height: 65px;
    }
    .bdr-searchhelp {
        width: 500px;
        margin-top: 14px;
        border: none;
        box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.3), 0 2px 4px -1px rgba(37, 99, 235, 0.3);
    }
    .help-tab-body {
        box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.3), 0 2px 4px -1px rgba(37, 99, 235, 0.3);
    }
    .help-tabs-nav {
        border-bottom: none; /* Línea base gris claro */
        box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.3), 0 2px 4px -1px rgba(37, 99, 235, 0.3);
        border-radius: 8px;
    }
    .help-tab-list.visible {
        display: flex;
        flex-direction: column; /* Alineación vertical para que todo se apile al 100% */
        border-bottom: none; /* Línea base gris claro */
        box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.3), 0 2px 4px -1px rgba(37, 99, 235, 0.3);
        border-radius: 8px;
    }
    /* Lista de Resultados */
    .directory-list {
        box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.3), 0 2px 4px -1px rgba(37, 99, 235, 0.3);
    }
}