/* =================================================================
   y_nav.css · Sistema de navegación v2 Yefris · TD-NAV-001 Sprint A
   ----------------------------------------------------------------
   Usa los tokens semánticos de tokens.css. Soporta modo claro y
   oscuro automáticamente sin media queries propias.
   ================================================================= */

/* ========== HEADER LIMPIO ========== */
/* Z1.3.c · header T1 · transparent + scroll blur (fix 12/05) */
.y-header {
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 14px 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(8, 10, 9, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  position: sticky;
  top: 0;
  z-index: 40;
}

.y-header-logo {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: inherit;
}

.y-logo-dot {
  width: 24px; height: 24px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%,
    color-mix(in srgb, var(--y-brand-vivid) 60%, #fff),
    var(--y-brand-vivid) 50%,
    var(--y-brand));
  position: relative;
  box-shadow: 0 0 12px var(--y-brand-shadow);
  flex-shrink: 0;
  opacity: 0.7; /* Z1.3.c-bis · reducir competencia visual con orb grande bloque B */
}
.y-logo-dot::after {
  content: '';
  position: absolute; inset: 0;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.5), transparent 35%);
}

.y-logo-stack { line-height: 1.1; }
.y-logo-text {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--y-text-1);
  font-family: var(--y-font-sans);
}
/* F1a · Z2-001 · text overflow defensivo para nombres largos */
.y-context {
  font-size: 10.5px;
  color: var(--y-text-3);
  font-weight: 500;
  margin-top: 1px;
  font-family: var(--y-font-sans);
  letter-spacing: .02em;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.y-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.y-h-icon {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  color: var(--y-text-2);
  position: relative;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.y-h-icon svg { width: 18px; height: 18px; }

.y-h-badge {
  position: absolute;
  top: -2px; right: -3px;
  min-width: 14px; height: 14px;
  background: var(--y-er);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
  font-family: 'JetBrains Mono', monospace;
  border: 1.5px solid var(--y-page-bg);
}

/* Z1.2.b · avatar plano opción B (fix 12/05) — círculo transparente + borde blanco fino */
.y-avatar {
  width: 32px; height: 32px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid var(--y-text-1);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--y-text-1);
  flex-shrink: 0;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  font-family: var(--y-font-sans);
}

/* ========== TABBAR ========== */
.y-tabbar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: calc(64px + env(safe-area-inset-bottom, 0px));
  padding: 8px 2px calc(8px + env(safe-area-inset-bottom, 0px));
  background: color-mix(in srgb, var(--y-surface) 94%, transparent);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--y-border);
  display: flex;
  z-index: 30;
}

.y-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--y-text-3);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
  padding: 6px 2px 0;
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.2s;
  font-family: var(--y-font-sans);
}
.y-tab-icon {
  width: 22px; height: 22px;
  stroke-width: 1.7;
  transition: stroke-width 0.2s;
}

.y-tab.is-active { color: var(--y-brand-vivid); }
.y-tab.is-active .y-tab-icon { stroke-width: 2.2; }
.y-tab.is-active::before {
  content: '';
  position: absolute;
  top: 0;
  width: 4px; height: 4px;
  background: var(--y-brand-vivid);
  border-radius: 999px;
  box-shadow: 0 0 8px var(--y-brand-vivid);
}

/* ========== BOTTOM SHEET ========== */
.y-scrim {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.y-scrim.is-open {
  opacity: 1;
  pointer-events: auto;
}

.y-sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  pointer-events: none;
  background: var(--y-surface);
  border-radius: 24px 24px 0 0;
  padding: 12px 18px calc(30px + env(safe-area-inset-bottom, 0px));
  z-index: 51;
  transform: translateY(110%);
  transition: transform 0.42s cubic-bezier(.32, .72, .18, 1);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.4);
  max-height: 90vh;
  overflow-y: auto;
  font-family: var(--y-font-sans);
}
.y-sheet.is-open {
  transform: translateY(0);
  pointer-events: auto;
}

.y-sheet-handle {
  width: 36px; height: 4px;
  background: var(--y-border-strong);
  border-radius: 999px;
  margin: 4px auto 16px;
}

.y-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding: 0 2px;
}
.y-sheet-title {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.015em;
  color: var(--y-text-1);
  margin: 0;
}
.y-sheet-close {
  width: 30px; height: 30px;
  border-radius: 999px;
  background: var(--y-surface-sub);
  display: flex; align-items: center; justify-content: center;
  color: var(--y-text-2);
  border: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.y-sheet-close svg { width: 14px; height: 14px; }

/* ========== MORE GRID (2×3) ========== */
.y-more-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.y-more-card {
  background: var(--y-surface-sub);
  border: 1px solid var(--y-border);
  border-radius: 14px;
  padding: 13px 8px 11px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  position: relative;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s, border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}
.y-more-card:hover { border-color: var(--y-border-strong); }
.y-more-card:active { transform: scale(0.97); }

.y-more-icon {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: var(--y-brand-subtle);
  display: flex; align-items: center; justify-content: center;
  color: var(--y-brand);
  margin-top: 2px;
}
.y-more-icon svg {
  width: 19px; height: 19px;
  stroke-width: 1.7;
}

.y-more-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--y-text-1);
  line-height: 1.2;
  letter-spacing: -0.005em;
}

.y-more-card.is-locked { opacity: 0.55; }
.y-more-card.is-locked .y-more-icon {
  background: var(--y-surface-sub);
  color: var(--y-text-3);
  border: 1px solid var(--y-border);
}
.y-more-lock {
  position: absolute;
  top: 6px; right: 6px;
  font-size: 8.5px;
  background: linear-gradient(135deg, var(--y-amber), color-mix(in srgb, var(--y-amber) 65%, #000));
  color: #fff;
  border-radius: 999px;
  padding: 2px 6px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: .04em;
  line-height: 1;
}

/* ========== MORE LIST (cuenta, ajustes, ayuda, tema, logout) ========== */
.y-more-divider {
  height: 1px;
  background: var(--y-border);
  margin: 8px -2px 12px;
  border: none;
}
.y-more-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.y-more-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 8px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--y-text-1);
  text-decoration: none;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  font-family: var(--y-font-sans);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.y-more-row:hover {
  background: var(--y-surface-sub);
}
.y-more-row svg {
  width: 18px; height: 18px;
  color: var(--y-text-2);
  flex-shrink: 0;
}
.y-more-row.is-danger { color: var(--y-er); }
.y-more-row.is-danger svg { color: var(--y-er); }

/* ========== APP BODY OFFSET (para no quedar bajo tabbar) ========== */
.y-app-body {
  padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  min-height: 100vh;
}

/* ========== ACCESIBILIDAD ========== */
@media (prefers-reduced-motion: reduce) {
  .y-sheet, .y-scrim, .y-tab, .y-tab-icon, .y-more-card {
    transition: none !important;
    animation: none !important;
  }
}

@media (max-width: 360px) {
  .y-tab { font-size: 8.5px; }
  .y-logo-text { font-size: 14px; }
  .y-context { font-size: 10px; }
}
