/* ═══════════════════════════════════════════════════════
   V5.CSS — Capa WebClic Studio 5.0
   Command Palette (Ctrl+K) · Contadores · Magnetic ·
   Toasts · Transición de página · Botón Lab flotante
   Se carga en TODAS las páginas, después de fx.css.
   Todo respeta prefers-reduced-motion.
   ═══════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────
   1) TRANSICIÓN DE ENTRADA DE PÁGINA
   ───────────────────────────────────────────── */
@keyframes v5PageIn { from { opacity: 0; } to { opacity: 1; } }
body.v5-ready main { animation: v5PageIn .45s ease both; }

/* ─────────────────────────────────────────────
   2) COMMAND PALETTE (Ctrl+K / botón buscador)
   ───────────────────────────────────────────── */
.v5-cmdk-overlay {
    position: fixed; inset: 0; z-index: 1500;
    background: rgba(8, 8, 12, .62);
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
    display: flex; align-items: flex-start; justify-content: center;
    padding: 12vh 16px 24px;
    opacity: 0; visibility: hidden;
    transition: opacity .22s ease, visibility .22s ease;
}
.v5-cmdk-overlay.open { opacity: 1; visibility: visible; }

.v5-cmdk {
    width: 100%; max-width: 620px;
    background: #121216;
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 18px;
    box-shadow: 0 30px 90px -20px rgba(0,0,0,.7), 0 0 0 1px rgba(224,18,27,.08);
    overflow: hidden;
    transform: translateY(14px) scale(.98);
    transition: transform .22s cubic-bezier(.22,.61,.36,1);
}
.v5-cmdk-overlay.open .v5-cmdk { transform: none; }

.v5-cmdk__head {
    display: flex; align-items: center; gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid rgba(255,255,255,.07);
}
.v5-cmdk__head svg { width: 18px; height: 18px; color: #E0121B; flex: none; }
.v5-cmdk__input {
    flex: 1; background: none; border: none; outline: none;
    font-size: 16px; color: #fff; font-family: var(--font, 'Inter', sans-serif);
}
.v5-cmdk__input::placeholder { color: rgba(255,255,255,.35); }
.v5-cmdk__esc {
    flex: none; font-size: 10px; font-weight: 700; letter-spacing: .08em;
    color: rgba(255,255,255,.4);
    border: 1px solid rgba(255,255,255,.14); border-radius: 6px;
    padding: 3px 7px; cursor: pointer; background: rgba(255,255,255,.04);
}

.v5-cmdk__list {
    max-height: min(54vh, 420px); overflow-y: auto;
    padding: 8px;
}
.v5-cmdk__group {
    font-size: 10px; font-weight: 800; letter-spacing: .14em;
    text-transform: uppercase; color: rgba(255,255,255,.32);
    padding: 12px 12px 6px;
}
.v5-cmdk__item {
    display: flex; align-items: center; gap: 12px;
    width: 100%; text-align: left;
    padding: 11px 12px; border-radius: 11px;
    color: rgba(255,255,255,.82); cursor: pointer;
    font-size: 14px; font-weight: 500;
    border: none; background: none; font-family: inherit;
    transition: background .12s;
}
.v5-cmdk__item i {
    width: 30px; height: 30px; flex: none;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(224,18,27,.10); border: 1px solid rgba(224,18,27,.18);
    border-radius: 9px; color: #FF4B52; font-size: 13px; font-style: normal;
}
.v5-cmdk__item span small {
    display: block; font-size: 12px; font-weight: 400;
    color: rgba(255,255,255,.38); margin-top: 1px;
}
.v5-cmdk__item:hover,
.v5-cmdk__item.sel { background: rgba(224,18,27,.13); color: #fff; }
.v5-cmdk__empty {
    padding: 34px 16px; text-align: center;
    color: rgba(255,255,255,.4); font-size: 14px;
}
.v5-cmdk__foot {
    display: flex; gap: 16px; align-items: center;
    padding: 10px 18px;
    border-top: 1px solid rgba(255,255,255,.07);
    font-size: 11px; color: rgba(255,255,255,.35);
}
.v5-cmdk__foot kbd {
    font-family: inherit; font-size: 10px; font-weight: 700;
    border: 1px solid rgba(255,255,255,.16); border-radius: 5px;
    padding: 1px 6px; margin-right: 4px; background: rgba(255,255,255,.05);
}

/* Botón flotante buscador (junto a fx-top, lado izquierdo) */
.v5-search-btn {
    position: fixed; bottom: 24px; left: 80px;
    height: 46px; padding: 0 16px; border-radius: 14px;
    background: #16161B; color: rgba(255,255,255,.75);
    border: 1px solid rgba(255,255,255,.12);
    display: flex; align-items: center; gap: 9px;
    cursor: pointer; z-index: 779;
    font-size: 13px; font-weight: 600; font-family: var(--font, 'Inter', sans-serif);
    box-shadow: 0 10px 30px -10px rgba(0,0,0,.55);
    opacity: 0; visibility: hidden; transform: translateY(16px);
    transition: opacity .3s, transform .3s, visibility .3s, border-color .2s, color .2s;
}
.v5-search-btn.show { opacity: 1; visibility: visible; transform: none; }
.v5-search-btn:hover { border-color: rgba(224,18,27,.55); color: #fff; }
.v5-search-btn svg { width: 15px; height: 15px; color: #E0121B; }
.v5-search-btn kbd {
    font-size: 10px; font-weight: 700; font-family: inherit;
    border: 1px solid rgba(255,255,255,.18); border-radius: 5px;
    padding: 1px 6px; color: rgba(255,255,255,.5);
}
@media (max-width: 700px) {
    .v5-search-btn { left: 72px; padding: 0 13px; }
    .v5-search-btn kbd { display: none; }
}

/* ─────────────────────────────────────────────
   3) TOASTS (notificaciones)
   ───────────────────────────────────────────── */
.v5-toasts {
    position: fixed; bottom: 24px; right: 24px; z-index: 1600;
    display: flex; flex-direction: column; gap: 10px;
    pointer-events: none;
}
.v5-toast {
    pointer-events: auto;
    display: flex; align-items: center; gap: 11px;
    background: #16161B; color: #fff;
    border: 1px solid rgba(255,255,255,.12);
    border-left: 3px solid #E0121B;
    border-radius: 13px;
    padding: 13px 18px; max-width: 340px;
    font-size: 14px; font-weight: 500;
    box-shadow: 0 16px 44px -12px rgba(0,0,0,.6);
    animation: v5ToastIn .3s cubic-bezier(.22,.61,.36,1) both;
}
.v5-toast--ok    { border-left-color: #22C55E; }
.v5-toast--warn  { border-left-color: #F59E0B; }
.v5-toast.out { animation: v5ToastOut .25s ease both; }
@keyframes v5ToastIn  { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: none; } }
@keyframes v5ToastOut { to { opacity: 0; transform: translateX(30px); } }
@media (max-width: 600px) {
    .v5-toasts { right: 12px; bottom: 80px; left: 12px; }
    .v5-toast { max-width: none; }
}

/* ─────────────────────────────────────────────
   4) CONTADORES — sin estilos especiales, el JS
   anima cualquier [data-count]. Reservado.
   ───────────────────────────────────────────── */
[data-count] { font-variant-numeric: tabular-nums; }

/* ─────────────────────────────────────────────
   5) BADGE "NUEVO" reutilizable (navbar / cards)
   ───────────────────────────────────────────── */
.v5-new {
    display: inline-flex; align-items: center;
    font-size: 9px; font-weight: 800; letter-spacing: .1em;
    text-transform: uppercase; line-height: 1;
    color: #fff; background: linear-gradient(120deg, #E0121B, #FF4B52);
    border-radius: 999px; padding: 4px 8px;
    margin-left: 7px; vertical-align: middle;
    box-shadow: 0 0 14px rgba(224,18,27,.45);
    animation: v5NewPulse 2.4s ease-in-out infinite;
}
@keyframes v5NewPulse {
    0%, 100% { box-shadow: 0 0 8px  rgba(224,18,27,.35); }
    50%      { box-shadow: 0 0 18px rgba(224,18,27,.65); }
}

/* ─────────────────────────────────────────────
   6) SECCIÓN LAB EN LA HOME
   ───────────────────────────────────────────── */
.lab-band {
    position: relative;
    background:
        radial-gradient(ellipse 60% 70% at 85% 10%, rgba(224,18,27,.14), transparent 60%),
        radial-gradient(ellipse 50% 60% at 8% 90%, rgba(124,58,237,.10), transparent 60%),
        #0D0D0D;
    overflow: hidden;
}
.lab-grid {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 18px; margin-top: 48px;
}
@media (max-width: 1020px) { .lab-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px)  { .lab-grid { grid-template-columns: 1fr; } }

.lab-card {
    position: relative; display: block;
    background: rgba(255,255,255,.035);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 20px;
    padding: 28px 24px;
    transition: transform .25s cubic-bezier(.22,.61,.36,1),
                border-color .25s, background .25s, box-shadow .25s;
    overflow: hidden;
}
.lab-card::before {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background: radial-gradient(220px circle at var(--mx, 50%) var(--my, 0%),
                rgba(224,18,27,.16), transparent 65%);
    opacity: 0; transition: opacity .3s;
}
.lab-card:hover { transform: translateY(-5px); border-color: rgba(224,18,27,.42); box-shadow: 0 22px 50px -18px rgba(224,18,27,.30); }
.lab-card:hover::before { opacity: 1; }

.lab-card__icon {
    width: 50px; height: 50px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, rgba(224,18,27,.18), rgba(224,18,27,.05));
    border: 1px solid rgba(224,18,27,.30);
    color: #FF4B52; font-size: 20px;
    margin-bottom: 18px;
}
.lab-card__title { font-size: 16.5px; font-weight: 800; color: #fff; margin-bottom: 8px; }
.lab-card__desc  { font-size: 13.5px; line-height: 1.65; color: rgba(255,255,255,.52); margin-bottom: 18px; }
.lab-card__cta {
    display: inline-flex; align-items: center; gap: 7px;
    font-size: 13px; font-weight: 700; color: #FF4B52;
}
.lab-card__cta i { transition: transform .2s; font-size: 11px; }
.lab-card:hover .lab-card__cta i { transform: translateX(4px); }

/* ─────────────────────────────────────────────
   ACCESIBILIDAD
   ───────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    body.v5-ready main { animation: none; }
    .v5-toast, .v5-new { animation: none !important; }
    .v5-cmdk, .v5-cmdk-overlay, .lab-card { transition: none !important; }
}

/* Safe area iOS */
@supports (padding: env(safe-area-inset-bottom)) {
    .v5-search-btn { bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }
    .v5-toasts     { bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }
}
