/* ============================================================
   Pestana lateral "Novedades" (functions/templates/web/_novedades.html).
   Fija al borde derecho, a media pantalla. Palpita mientras haya
   novedades sin ver (clase .sin-ver, la pone novedades.js).
   ============================================================ */

.novedades {
    --nv-navy: #1f3a52;
    --nv-lime: #a4c62a;
    position: fixed;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    z-index: 1030;
    display: flex;
    align-items: center;
}

/* La flecha derecha del carrusel de la portada queda a media pantalla,
   justo donde va la pestana: se corre hacia adentro para no taparse. */
.hero-swiper .swiper-button-next { right: 56px; }

/* ===== Pestana vertical ===== */
.novedades-tab {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 16px 9px;
    border: 0;
    border-radius: 14px 0 0 14px;
    background: var(--nv-navy);
    color: #fff;
    box-shadow: -4px 6px 18px rgba(15,23,42,.25);
    cursor: pointer;
    transition: padding .2s ease, background .2s ease;
}
.novedades-tab:hover { background: #16293b; padding-right: 13px; }
.novedades-tab:focus-visible { outline: 3px solid var(--nv-lime); outline-offset: 2px; }
.novedades-tab i { color: var(--nv-lime); font-size: 15px; }
.novedades-tab span:not(.novedades-punto) {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
}

/* Punto de "nuevo" */
.novedades-punto {
    position: absolute;
    top: -5px;
    left: -5px;
    width: 14px;
    height: 14px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: var(--nv-lime);
    display: none;
}

/* ===== Palpitar (solo mientras hay algo sin ver) ===== */
.novedades.sin-ver .novedades-punto { display: block; }
.novedades.sin-ver .novedades-tab { animation: nv-palpito 1.8s ease-in-out infinite; }
.novedades.sin-ver .novedades-punto { animation: nv-onda 1.8s ease-out infinite; }

@keyframes nv-palpito {
    0%, 100% { transform: translateX(0) scale(1); }
    12%      { transform: translateX(-3px) scale(1.06); }
    24%      { transform: translateX(0) scale(1); }
    36%      { transform: translateX(-2px) scale(1.04); }
    48%      { transform: translateX(0) scale(1); }
}
@keyframes nv-onda {
    0%   { box-shadow: 0 0 0 0 rgba(164,198,42,.75); }
    70%  { box-shadow: 0 0 0 12px rgba(164,198,42,0); }
    100% { box-shadow: 0 0 0 0 rgba(164,198,42,0); }
}
@media (prefers-reduced-motion: reduce) {
    .novedades.sin-ver .novedades-tab,
    .novedades.sin-ver .novedades-punto { animation: none; }
}

/* ===== Panel ===== */
.novedades-panel {
    position: absolute;
    top: 50%;
    right: calc(100% + 10px);
    transform: translateY(-50%);
    width: 320px;
    max-width: calc(100vw - 70px);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 18px 48px rgba(15,23,42,.22);
    overflow: hidden;
    animation: nv-entrar .22s ease-out;
}
.novedades-panel[hidden] { display: none; }
@keyframes nv-entrar {
    from { opacity: 0; transform: translate(12px, -50%); }
    to   { opacity: 1; transform: translate(0, -50%); }
}

.novedades-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px 12px 16px;
    background: var(--nv-navy);
    color: #fff;
}
.novedades-panel-head i { color: var(--nv-lime); margin-right: 6px; }
.novedades-cerrar {
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 50%;
    background: rgba(255,255,255,.12);
    color: #fff;
    cursor: pointer;
}
.novedades-cerrar:hover { background: rgba(255,255,255,.25); }

.novedades-lista {
    list-style: none;
    margin: 0;
    padding: 8px;
    max-height: 60vh;
    overflow-y: auto;
}
.novedades-item {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 10px;
    border-radius: 12px;
    color: #0f172a;
    text-decoration: none;
    transition: background .15s ease;
}
.novedades-item:hover { background: #f3f6ec; color: #0f172a; }
.novedades-item img {
    flex: none;
    width: 72px;
    height: 90px;
    object-fit: cover;
    border-radius: 8px;
}
.novedades-item strong { display: block; font-size: .95rem; color: var(--nv-navy); }
.novedades-item small { display: block; margin: 2px 0 6px; color: #5b6676; line-height: 1.4; }
.novedades-item em {
    font-style: normal;
    font-size: .82rem;
    font-weight: 700;
    color: #6b8a2a;
}

/* ===== Celular: pestana mas delgada ===== */
@media (max-width: 575px) {
    .novedades-tab { padding: 12px 7px; gap: 8px; }
    .novedades-tab span:not(.novedades-punto) { font-size: 10.5px; }
}
