/* ══════════════════════════════════════════════════════════════════
   css/novedades.css — BUZÓN DE NOTICIAS (js/novedades.js)
   El sobre copia al engranaje (#app-gear-btn, css/cards-view.css) y el menú cae del sobre como el
   de Ajustes (#sb-settings-popup, css/styles.css). Su cristal sale del bloque «LIQUID GLASS» de
   css/cards-view.css (el de los menús de la barra): no se re-deriva aquí.
   ══════════════════════════════════════════════════════════════════ */

/* ── Sobre de la barra ── */
#app-news-btn {
  width: 32px; height: 32px; flex-shrink: 0; border-radius: 8px;
  background: none; border: none; cursor: pointer; padding: 0;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.32); transition: color 0.15s, background 0.15s, transform 0.1s;
  position: relative;
}
#app-news-btn svg { width: 17px; height: 17px; }
#app-news-btn:hover { color: rgba(255,255,255,0.65); background: rgba(255,255,255,0.06); }
#app-news-btn:active { transform: scale(0.94); }
#app-news-btn.active { color: rgba(255,255,255,0.92); background: rgba(255,255,255,0.1); }
#app-news-btn + #app-gear-btn { margin-left: 2px; }
/* Punto rojo: hay alguna entrada sin ver */
#app-news-btn .nv-dot {
  position: absolute; top: 6px; right: 5px;
  width: 7px; height: 7px; border-radius: 50%;
  background: #ff4d57;
  box-shadow: 0 0 0 2px rgba(10,10,18,0.98);   /* recorte del color de la barra */
  transform: scale(0); opacity: 0;
  transition: transform 0.22s cubic-bezier(0.34,1.4,0.64,1), opacity 0.15s;
  pointer-events: none;
}
#app-news-btn.has-new .nv-dot { transform: scale(1); opacity: 1; }

/* ── Menú «Noticias»: cae del sobre, como Ajustes ── */
#nv-popup {
  position: absolute; top: calc(100% + 8px); right: var(--nv-right, 56px); z-index: 9200;
  width: 360px; box-sizing: border-box;
  max-height: calc(100vh - 48px - 24px); max-height: calc(100dvh - 48px - 24px);
  display: flex; flex-direction: column;
  padding: 12px 12px 12px;
  border-radius: 12px;
  font-family: system-ui, -apple-system, sans-serif;
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: translateY(-6px) scale(0.97); transform-origin: top right;
  transition: opacity 0.16s ease, transform 0.16s cubic-bezier(0.22,1,0.36,1), visibility 0.16s;
}
#nv-popup > * { position: relative; z-index: 1; }
#nv-popup.open { opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0) scale(1); }

.nv-head {
  display: grid; grid-template-columns: 30px 1fr 30px; align-items: center;
  flex: 0 0 auto; margin: -2px 0 10px;
}
.nv-title {
  grid-column: 2; text-align: center;
  font-size: 14px; font-weight: 650; letter-spacing: -0.01em; color: rgba(255,255,255,0.92);
}
.nv-back {
  grid-column: 1; grid-row: 1; width: 30px; height: 30px; border-radius: 8px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  background: none; border: none; cursor: pointer; color: rgba(255,255,255,0.55);
  visibility: hidden; transition: background 0.15s, color 0.15s, transform 0.1s;
}
.nv-back svg { width: 17px; height: 17px; }
.nv-back:hover { background: rgba(255,255,255,0.07); color: rgba(255,255,255,0.9); }
.nv-back:active { transform: scale(0.94); }
.nv-is-detail .nv-back { visibility: visible; }

.nv-body {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  margin: 0 -4px; padding: 0 4px 1px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.18) transparent;
}
.nv-body > * { animation: nv-in 0.18s cubic-bezier(0.22,1,0.36,1); }
@keyframes nv-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
html.pb-reduce-motion .nv-body > * { animation: none; }

.nv-list { display: flex; flex-direction: column; gap: 8px; }
.nv-empty { padding: 22px 0; text-align: center; font-size: 13px; color: rgba(255,255,255,0.42); }

.nv-card {
  display: flex; flex-direction: column; width: 100%;
  padding: 0; text-align: left; cursor: pointer; overflow: hidden;
  border-radius: 10px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  font-family: inherit; color: inherit;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.nv-card:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.15); }
.nv-card:active { transform: scale(0.985); }
.nv-card-banner, .nv-detail-banner {
  aspect-ratio: 16 / 6; overflow: hidden; background: rgba(255,255,255,0.04);
}
.nv-card-banner img, .nv-detail-banner img { display: block; width: 100%; height: 100%; object-fit: cover; }
.nv-card-info { display: flex; flex-direction: column; gap: 5px; padding: 10px 12px 11px; }
.nv-card-title { font-size: 13.5px; font-weight: 650; line-height: 1.3; color: rgba(255,255,255,0.92); }

.nv-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.nv-date { font-size: 11px; color: rgba(255,255,255,0.45); }
.nv-tag {
  display: inline-flex; align-items: center;
  padding: 2px 7px; border-radius: 999px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.03em; line-height: 1.3;
}
.nv-tag-importante { color: #ffd27a; background: rgba(245,180,60,0.16); box-shadow: inset 0 0 0 1px rgba(245,180,60,0.38); }
.nv-tag-mejora     { color: #7ee2a8; background: rgba(76,209,138,0.15); box-shadow: inset 0 0 0 1px rgba(76,209,138,0.36); }
.nv-tag-aviso      { color: #ff9d86; background: rgba(255,122,89,0.15); box-shadow: inset 0 0 0 1px rgba(255,122,89,0.38); }

.nv-detail { display: flex; flex-direction: column; padding-bottom: 1px; }
.nv-detail-banner { border-radius: 10px; margin-bottom: 10px; }
.nv-detail-title { margin: 7px 0 8px; font-size: 15.5px; font-weight: 700; line-height: 1.3; color: rgba(255,255,255,0.95); }
.nv-detail-text p { margin: 0 0 9px; font-size: 13px; line-height: 1.55; color: rgba(255,255,255,0.7); }
.nv-detail-text p:last-child { margin-bottom: 0; }
.nv-go { margin-top: 12px; width: 100%; padding: 10px 14px; }

/* Barra móvil (≤ 900 px, la misma frontera que css/responsive.css): como Ajustes, un desplegable a
   todo el ancho colgando bajo la barra (absolute: el nav tiene backdrop-filter, ver responsive.css). */
@media (max-width: 900px) {
  #app-news-btn { width: 34px; height: 34px; }
  #nv-popup {
    top: calc(100% + 6px); left: 8px; right: 8px;
    width: auto; max-width: 400px; margin-left: auto;
    max-height: calc(100dvh - 48px - var(--safe-top, 0px) - 20px);
    border-radius: 16px;
  }
}
