/* ==========================================================================
   HEY! Newsticker – Estilos principales
   Plugin por HEY! World Publicidad (https://heyworld.es)
   ========================================================================== */

/* ── Contenedor principal ─────────────────────────────────────────────────── */

.hey-newsticker {
    display: flex;
    align-items: center;
    overflow: hidden;
    width: 100%;
    height: 50px;
    background-color: #0d0d0d;
    position: relative;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

/* ── Etiqueta ─────────────────────────────────────────────────────────────── */

.hey-newsticker__label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 100%;
    padding: 0 22px;
    background-color: #e63946;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    white-space: nowrap;
    flex-shrink: 0;
    position: relative;
    z-index: 3;
}

.hey-newsticker__label i,
.hey-newsticker__label svg {
    font-size: 13px;
    width: 13px;
    height: 13px;
    fill: currentColor;
}

/* Flecha decorativa (pseudo-triángulo) */
.hey-newsticker__label--arrow {
    flex-shrink: 0;
    width: 0;
    height: 0;
    border-top: 25px solid transparent;
    border-bottom: 25px solid transparent;
    border-left: 12px solid #e63946;
    z-index: 3;
}

/* ── Pista de scroll ─────────────────────────────────────────────────────── */

.hey-newsticker__track-wrapper {
    flex: 1;
    overflow: hidden;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
}

.hey-newsticker__track {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    will-change: transform;
    animation: hey-ticker-left 35s linear infinite;
}

/* ── Items ────────────────────────────────────────────────────────────────── */

.hey-newsticker__item {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    margin-inline-end: 50px;
}

.hey-newsticker__item a,
.hey-newsticker__item .hey-newsticker__text {
    color: #ffffff;
    text-decoration: none;
    white-space: nowrap;
    font-size: 14px;
    line-height: 1.4;
    transition: color 0.2s ease;
    cursor: pointer;
}

.hey-newsticker__item a:hover {
    color: #e63946;
    text-decoration: underline;
}

/* ── Separador ────────────────────────────────────────────────────────────── */

.hey-newsticker__sep {
    display: inline-block;
    margin-inline-start: 50px;
    color: #e63946;
    font-size: 16px;
    line-height: 1;
    flex-shrink: 0;
    pointer-events: none;
}

/* ── Fade en bordes ─────────────────────────────────────────────────────── */

.hey-newsticker__fade {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 60px;
    z-index: 2;
    pointer-events: none;
}

.hey-newsticker__fade--left {
    left: 0;
    background: linear-gradient(to right, var(--hey-ticker-bg, #0d0d0d) 0%, transparent 100%);
}

.hey-newsticker__fade--right {
    right: 0;
    background: linear-gradient(to left, var(--hey-ticker-bg, #0d0d0d) 0%, transparent 100%);
}

/* Ajuste: si hay etiqueta, el fade izquierdo aparece después */
.hey-newsticker__label ~ .hey-newsticker__fade--left,
.hey-newsticker__label--arrow ~ .hey-newsticker__fade--left {
    display: none;
}

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

/* Scroll de derecha a izquierda (predeterminado) */
@keyframes hey-ticker-left {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* Scroll de izquierda a derecha */
@keyframes hey-ticker-right {
    0%   { transform: translateX(-50%); }
    100% { transform: translateX(0); }
}

/* Dirección aplicada via data-attribute (gestionada por JS) */
.hey-newsticker[data-direction="right"] .hey-newsticker__track {
    animation-name: hey-ticker-right;
}

/* Estado pausado */
.hey-newsticker__track.is-paused {
    animation-play-state: paused;
}

/* ── Accesibilidad: reduce motion ─────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
    .hey-newsticker__track {
        animation-play-state: paused !important;
    }
}

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

@media (max-width: 768px) {
    .hey-newsticker__label {
        padding: 0 14px;
        font-size: 11px;
        letter-spacing: 0.5px;
    }

    .hey-newsticker__label--arrow {
        border-top-width: 25px;
        border-bottom-width: 25px;
        border-left-width: 9px;
    }

    .hey-newsticker__item a,
    .hey-newsticker__item .hey-newsticker__text {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .hey-newsticker__label-text {
        display: none; /* Solo ícono en móvil muy pequeño */
    }
    .hey-newsticker__label {
        padding: 0 12px;
    }
}
