/* =====================================================================
   SANTO PECADO — En vivo: notificaciones, búsqueda instantánea, indicadores
   ===================================================================== */

/* Mensaje nuevo que llega sin recargar */
.tmsg--new .tmsg__bubble { animation: spNewMsg 2.4s var(--ease); }
@keyframes spNewMsg {
  0% { opacity: 0; transform: translateY(12px); box-shadow: 0 0 0 2px var(--gold), 0 0 40px -6px var(--gold); }
  20% { opacity: 1; transform: none; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* Indicador "En vivo" del panel */
.live-pill { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 999px; font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--success); border: 1px solid rgba(111, 191, 115, .35); background: rgba(111, 191, 115, .07); }
.live-pill i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 0 currentColor; animation: spPulse 2s infinite; }
.live-pill.is-off { color: var(--muted); border-color: var(--line); background: none; }
.live-pill.is-off i { animation: none; }
@keyframes spPulse { 0% { box-shadow: 0 0 0 0 rgba(111, 191, 115, .6); } 70% { box-shadow: 0 0 0 8px rgba(111, 191, 115, 0); } 100% { box-shadow: 0 0 0 0 rgba(111, 191, 115, 0); } }

/* Campana de notificaciones */
.notif { position: relative; }
.notif-btn { position: relative; }
.notif-btn.ring .ico { animation: spRing 1s ease; transform-origin: 50% 0; }
@keyframes spRing { 10%, 30%, 50% { transform: rotate(14deg); } 20%, 40%, 60% { transform: rotate(-14deg); } 70% { transform: rotate(0); } }
.notif-panel {
  position: absolute; top: calc(100% + 12px); right: -60px; z-index: 70;
  width: min(380px, calc(100vw - 32px));
  border-radius: 16px; border: 1px solid var(--line-strong);
  background: rgba(17, 17, 17, .98); box-shadow: var(--shadow);
  overflow: hidden; animation: spDrop .2s var(--ease);
}
@keyframes spDrop { from { opacity: 0; transform: translateY(6px); } }
.notif-panel__head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.notif-panel__list { max-height: 380px; overflow-y: auto; }
.notif-panel__empty { padding: 26px 16px; margin: 0; text-align: center; }
.notif-panel__foot { display: flex; justify-content: space-between; padding: 12px 16px; border-top: 1px solid var(--line); font-size: 13px; }
.notif-item { display: grid; grid-template-columns: 34px 1fr; gap: 12px; padding: 12px 16px; color: var(--white); border-bottom: 1px solid rgba(197, 161, 90, .07); transition: background .2s; }
.notif-item:hover { background: rgba(197, 161, 90, .06); color: var(--white); }
.notif-item.is-unread { background: rgba(197, 161, 90, .07); box-shadow: inset 3px 0 0 var(--gold); }
.notif-item__icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: rgba(197, 161, 90, .1); color: var(--gold); }
.notif-item__icon--ticket { background: rgba(111, 191, 115, .1); color: var(--success); }
.notif-item__body { display: grid; gap: 3px; min-width: 0; font-size: 13px; }
.notif-item__body strong { font-size: 13.5px; }
.notif-item__body span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.notif-item__body time { color: var(--muted-2); font-size: 11.5px; }

/* Búsqueda instantánea */
.search-overlay { position: fixed; inset: 0; z-index: 160; display: grid; justify-items: center; align-items: start; padding: 12vh 16px 16px; }
.search-overlay__backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .7); backdrop-filter: blur(6px); opacity: 0; transition: opacity .2s; }
.search-overlay__panel { position: relative; width: min(640px, 100%); border-radius: 18px; border: 1px solid var(--line-strong); background: #111; box-shadow: var(--shadow), 0 0 80px -30px var(--gold); overflow: hidden; transform: translateY(-10px) scale(.98); opacity: 0; transition: transform .25s var(--ease), opacity .2s; }
.search-overlay.is-open .search-overlay__backdrop { opacity: 1; }
.search-overlay.is-open .search-overlay__panel { transform: none; opacity: 1; }
.search-overlay__form { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.search-overlay__form > .ico { color: var(--gold); width: 22px; height: 22px; }
.search-overlay__input { flex: 1; background: none; border: 0; outline: none; font-size: 18px; color: var(--white); min-width: 0; }
.search-overlay__input::placeholder { color: var(--muted-2); }
.search-overlay__input::-webkit-search-cancel-button { display: none; }
.search-overlay__kbd { font: 600 11px/1 var(--font-body); padding: 5px 8px; border-radius: 6px; border: 1px solid var(--line); color: var(--muted); }
.search-overlay__results { max-height: min(60vh, 520px); overflow-y: auto; padding: 8px; transition: opacity .2s; }
.search-overlay__results.is-loading { opacity: .55; }
.search-overlay__hint { padding: 18px 12px; margin: 0; text-align: center; }
.search-group { margin: 10px 10px 6px; font-size: 11px; font-weight: 600; letter-spacing: .25em; text-transform: uppercase; color: var(--gold); }
.search-item { display: grid; grid-template-columns: 52px 1fr auto; gap: 14px; align-items: center; padding: 10px; border-radius: 12px; color: var(--white); }
.search-item:hover, .search-item.is-active { background: rgba(197, 161, 90, .1); color: var(--white); }
.search-item__media { width: 52px; height: 40px; border-radius: 8px; overflow: hidden; display: grid; place-items: center; background: rgba(197, 161, 90, .08); color: var(--gold); }
.search-item__media img { width: 100%; height: 100%; object-fit: cover; }
.search-item__text { display: grid; gap: 2px; min-width: 0; }
.search-item__text strong { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-item__text small { color: var(--muted); font-size: 12px; }
.search-item__side { font-family: var(--font-display); color: var(--gold-light); font-size: 14px; white-space: nowrap; }
.search-all { display: block; margin: 8px 4px 4px; padding: 12px; border-radius: 12px; text-align: center; font-size: 13.5px; border: 1px dashed var(--line-strong); }
.search-all.is-active, .search-all:hover { background: rgba(197, 161, 90, .08); }

/* Cabecera con más botones: en móvil la cuenta va dentro del menú */
@media (max-width: 640px) {
  .header-actions .account-drop { display: none; }
  .notif-panel { right: -100px; }
  .search-overlay { padding-top: 70px; }
  .search-item { grid-template-columns: 44px 1fr; }
  .search-item__side { grid-column: 2; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .tmsg--new .tmsg__bubble, .live-pill i, .notif-btn.ring .ico { animation: none; }
}
