/* ═══════════════════════════════════════════════════════════════════════════
   Company Search Hero — csh-styles.css
   Paleta: #026580 (azul corporativo) · #060f1e (fondo marino) · #ffffff (texto)
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
    --csh-primary:      #026580;
    --csh-primary-dim:  rgba(2, 101, 128, 0.40);
    --csh-primary-glow: rgba(2, 101, 128, 0.22);
    --csh-primary-10:   rgba(2, 101, 128, 0.10);
    --csh-bg:           #060f1e;
    --csh-white:        #ffffff;
    --csh-gray-400:     rgba(255, 255, 255, 0.55);
    --csh-radius-lg:    18px;
    --csh-radius-sm:    10px;
    --csh-transition:   0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Nota: los elementos del tema Newspaper se ocultan con un <style> inline
   emitido directamente por el shortcode en company_search_hero.php,
   para garantizar que se aplican incluso con page builders (tagDiv Composer).
   ─────────────────────────────────────────────────────────────────────────── */

/* ─── Hero section ───────────────────────────────────────────────────────── */

.csh-hero {
    position: relative;
    /* Altura natural — crece con el contenido (~460-500px) */
    min-height: 0;
    padding: 72px 24px 88px;
    background: radial-gradient(ellipse 110% 120% at 50% 60%, #0d1f3c 0%, #060f1e 65%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;

    /* Romper el contenedor del tema para ocupar ancho completo */
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    box-sizing: border-box;
}

/* ─── Fondo SVG bursátil ─────────────────────────────────────────────────── */

.csh-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.csh-chart-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    /* El SVG usa preserveAspectRatio="xMidYMid slice" para cubrir todo el área */
}

/* Línea principal — animación de "dibujado" que se repite sin corte */
.csh-chart-line1 {
    stroke-dasharray: 2600;
    stroke-dashoffset: 2600;
    animation: csh-draw-line 14s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

/* Línea secundaria — velocidad diferente para efecto de profundidad */
.csh-chart-line2 {
    stroke-dasharray: 2700;
    stroke-dashoffset: 2700;
    animation: csh-draw-line 20s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    animation-delay: 3s;
}

/* Área rellena — fade in suave */
.csh-chart-area {
    opacity: 0;
    animation: csh-area-fade 14s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

/* Punto pulsante al final de la línea */
.csh-chart-dot {
    animation: csh-dot-appear 14s ease infinite;
}

.csh-chart-pulse {
    animation: csh-pulse-ring 14s ease infinite;
}

@keyframes csh-draw-line {
    0%   { stroke-dashoffset: 2600; opacity: 0; }
    5%   { opacity: 1; }
    70%  { stroke-dashoffset: 0; opacity: 0.85; }
    85%  { stroke-dashoffset: 0; opacity: 0; }
    100% { stroke-dashoffset: 2600; opacity: 0; }
}

@keyframes csh-area-fade {
    0%   { opacity: 0; }
    25%  { opacity: 0; }
    60%  { opacity: 1; }
    80%  { opacity: 0; }
    100% { opacity: 0; }
}

@keyframes csh-dot-appear {
    0%, 68%  { opacity: 0; }
    72%      { opacity: 1; }
    80%      { opacity: 0.8; }
    88%      { opacity: 0; }
    100%     { opacity: 0; }
}

@keyframes csh-pulse-ring {
    0%, 68%  { opacity: 0; r: 4; }
    72%      { opacity: 0.8; r: 4; }
    84%      { opacity: 0; r: 14; }
    100%     { opacity: 0; r: 4; }
}

/* Orbes de luz de ambiente */
.csh-glow-orb {
    position: absolute;
    width: 480px;
    height: 480px;
    border-radius: 50%;
    filter: blur(110px);
    pointer-events: none;
    z-index: 0;
    animation: csh-orb-pulse 9s ease-in-out infinite alternate;
}

.csh-glow-orb--left  { background: rgba(2, 101, 128, 0.20); left: -160px; bottom: -80px; }
.csh-glow-orb--right { background: rgba(13, 31, 60, 0.50);  right: -160px; top: -60px; animation-delay: 4.5s; }

@keyframes csh-orb-pulse {
    from { transform: scale(1);    opacity: 0.7; }
    to   { transform: scale(1.12); opacity: 1;   }
}

/* ─── Contenido central ──────────────────────────────────────────────────── */

.csh-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    width: 100%;
    max-width: 700px;
    text-align: center;
}

/* ─── Logo ───────────────────────────────────────────────────────────────── */

.csh-logo-wrap {
    margin-bottom: 36px;
    animation: csh-fadein-up 0.7s ease both;
    animation-delay: 0.1s;
}

.csh-logo {
    max-width: 200px;
    max-height: 72px;
    width: auto;
    height: auto;
    filter: brightness(1.05) drop-shadow(0 2px 12px rgba(2,101,128,0.3));
}

/* ─── Headline ───────────────────────────────────────────────────────────── */

.csh-headline-wrap {
    margin-bottom: 36px;
    animation: csh-fadein-up 0.7s ease both;
    animation-delay: 0.3s;
}

.csh-headline {
    font-size: clamp(2rem, 5vw, 3.2rem) !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    color: var(--csh-white) !important;
    margin: 0 0 14px !important;
    letter-spacing: -0.02em !important;
    text-shadow: 0 2px 30px rgba(0,0,0,0.6) !important;

    background: linear-gradient(135deg, #ffffff 0%, rgba(255,255,255,0.82) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Subrayado animado */
.csh-headline-underline {
    height: 3px;
    border-radius: 2px;
    background: linear-gradient(90deg, transparent, var(--csh-primary), var(--csh-primary), transparent);
    width: 0;
    margin: 0 auto;
    animation: csh-underline-expand 1s cubic-bezier(0.4, 0, 0.2, 1) both;
    animation-delay: 0.9s;
}

@keyframes csh-underline-expand {
    from { width: 0; }
    to   { width: 55%; }
}

/* ─── Área de búsqueda ───────────────────────────────────────────────────── */

.csh-search-area {
    width: 100%;
    max-width: 560px;
    margin-bottom: 28px;
    animation: csh-fadein-up 0.7s ease both;
    animation-delay: 0.55s;
}

.csh-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.csh-input {
    width: 100%;
    padding: 18px 52px 18px 54px !important;
    background: rgba(255, 255, 255, 0.06) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1.5px solid rgba(255, 255, 255, 0.14) !important;
    border-radius: var(--csh-radius-lg) !important;
    color: var(--csh-white) !important;
    font-size: 1.05rem !important;
    font-family: inherit !important;
    line-height: 1.5 !important;
    outline: none !important;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.08) !important;
    transition: border-color var(--csh-transition), box-shadow var(--csh-transition), background var(--csh-transition) !important;
    box-sizing: border-box !important;
}

.csh-input::placeholder { color: rgba(255,255,255,0.38) !important; }

.csh-input:focus {
    border-color: var(--csh-primary) !important;
    background: rgba(255, 255, 255, 0.09) !important;
    box-shadow:
        0 8px 32px rgba(0,0,0,0.5),
        0 0 0 4px var(--csh-primary-glow),
        inset 0 1px 0 rgba(255,255,255,0.10) !important;
}

.csh-search-icon {
    position: absolute;
    left: 18px;
    color: rgba(255,255,255,0.45);
    pointer-events: none;
    transition: color var(--csh-transition);
    flex-shrink: 0;
}

.csh-input-wrap:focus-within .csh-search-icon { color: var(--csh-primary); }

/* Loader spinner */
.csh-loader {
    position: absolute;
    right: 16px;
    color: var(--csh-primary);
    display: none;
    pointer-events: none;
}

.csh-loader.is-visible { display: flex; }

.csh-loader svg { animation: csh-spin 0.8s linear infinite; }

@keyframes csh-spin {
    to { transform: rotate(360deg); }
}

/* ─── Dropdown resultados ────────────────────────────────────────────────── */

.csh-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: rgba(6, 15, 30, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(2, 101, 128, 0.35);
    border-radius: var(--csh-radius-lg);
    box-shadow: 0 20px 60px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,255,255,0.04);
    list-style: none;
    margin: 0;
    padding: 6px;
    z-index: 9999;
    max-height: 380px;
    overflow-y: auto;

    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
    display: block;
}

.csh-dropdown.is-open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.csh-dropdown::-webkit-scrollbar { width: 4px; }
.csh-dropdown::-webkit-scrollbar-track { background: transparent; }
.csh-dropdown::-webkit-scrollbar-thumb { background: var(--csh-primary-dim); border-radius: 2px; }

/* Item del dropdown */
.csh-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--csh-radius-sm);
    cursor: pointer;
    text-decoration: none !important;
    color: var(--csh-white) !important;
    transition: background var(--csh-transition);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.csh-dropdown-item:last-child { border-bottom: none; }

.csh-dropdown-item:hover,
.csh-dropdown-item:focus,
.csh-dropdown-item.is-active {
    background: rgba(2, 101, 128, 0.18);
    outline: none;
}

.csh-item-logo {
    width: 34px;
    height: 34px;
    object-fit: contain;
    border-radius: 8px;
    background: rgba(255,255,255,0.06);
    flex-shrink: 0;
    padding: 3px;
}

.csh-item-logo-ph {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: var(--csh-primary);
    color: var(--csh-white);
    font-size: 0.78rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.csh-item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.csh-item-name {
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--csh-white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.csh-item-meta {
    display: flex;
    align-items: center;
    gap: 6px;
}

.csh-item-symbol {
    font-size: 0.77rem;
    font-weight: 700;
    color: var(--csh-primary);
    background: var(--csh-primary-10);
    border: 1px solid var(--csh-primary-dim);
    border-radius: 5px;
    padding: 1px 6px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.csh-item-exchange {
    font-size: 0.73rem;
    color: var(--csh-gray-400);
}

.csh-item-arrow {
    color: rgba(255,255,255,0.25);
    flex-shrink: 0;
    transition: color var(--csh-transition), transform var(--csh-transition);
}

.csh-dropdown-item:hover .csh-item-arrow,
.csh-dropdown-item.is-active .csh-item-arrow {
    color: var(--csh-primary);
    transform: translateX(3px);
}

.csh-dropdown-empty {
    padding: 18px 14px;
    color: var(--csh-gray-400);
    font-size: 0.9rem;
    text-align: center;
}

/* ─── Subtexto ───────────────────────────────────────────────────────────── */

.csh-subtext {
    font-size: 0.88rem !important;
    color: rgba(255,255,255,0.38) !important;
    margin: 0 !important;
    line-height: 1.7 !important;
    letter-spacing: 0.02em !important;
    animation: csh-fadein-up 0.7s ease both !important;
    animation-delay: 0.75s !important;
}

/* ─── Animaciones compartidas ────────────────────────────────────────────── */

@keyframes csh-fadein-up {
    from { opacity: 0; transform: translateY(22px); }
    to   { opacity: 1; transform: translateY(0); }
}

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

@media (max-width: 600px) {
    .csh-hero { padding: 52px 16px 68px; }
    .csh-logo { max-width: 160px; }
    .csh-logo-wrap { margin-bottom: 28px; }
    .csh-headline-wrap { margin-bottom: 28px; }
    .csh-input { padding: 15px 46px 15px 46px !important; font-size: 0.98rem !important; }
    .csh-glow-orb { width: 280px; height: 280px; }
}
