/* ═══════════════════════════════════════════════════════
   bottom-nav.css — Barra de navegación inferior (mobile)
   Solo visible en pantallas < 1024px.
   Usa tokens de theme.css — compatible con Light y Dark.
   ═══════════════════════════════════════════════════════ */

/* ── Body padding para que el contenido no quede tapado ── */
@media (max-width: 1023px) {
  body.has-bnav {
    padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px));
  }
  /* FAB: subir automáticamente sobre la barra */
  body.has-bnav .fab {
    bottom: calc(60px + 20px + env(safe-area-inset-bottom, 0px)) !important;
  }
}

/* ── La barra ── */
#bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 90;
  background: var(--color-header-bg);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  height: calc(60px + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  flex-direction: row;
  align-items: stretch;
}

@media (max-width: 1023px) {
  #bottom-nav {
    display: flex;
  }
}

/* ── Items (tanto <a> como <button>) ── */
.bnav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 4px;
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: none;
  color: var(--gray4);
  font-family: var(--fb);
  transition: color 0.18s;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}

.bnav-item:hover {
  color: var(--gray5);
}

/* Indicador activo: píldora en la parte inferior del icono */
.bnav-item::after {
  content: '';
  position: absolute;
  bottom: 6px;
  width: 0;
  height: 3px;
  border-radius: 2px;
  background: var(--accent);
  transition: width 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bnav-item.bnav-active {
  color: var(--accent);
}

.bnav-item.bnav-active::after {
  width: 20px;
}

.bnav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bnav-item.bnav-active .bnav-icon,
.bnav-item:active .bnav-icon {
  transform: scale(1.18) translateY(-1px);
}

.bnav-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2px;
  line-height: 1;
  white-space: nowrap;
}

/* ── Popups (Looks y Profile) ── */
.bnav-popup {
  position: fixed;
  bottom: calc(60px + env(safe-area-inset-bottom, 0px) + 8px);
  background: var(--gray1);
  border: 1px solid var(--gray3);
  border-radius: 14px;
  padding: 6px;
  min-width: 200px;
  opacity: 0;
  transform: translateY(8px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 9999;
  display: none;
  box-shadow: var(--shadow-popup);
}

@media (max-width: 1023px) {
  .bnav-popup { display: block; }
}

.bnav-popup.bnav-popup-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* Looks popup: centrado horizontalmente */
#bnav-looks-popup {
  left: 50%;
  transform: translateX(-50%) translateY(8px) scale(0.96);
}

#bnav-looks-popup.bnav-popup-open {
  transform: translateX(-50%) translateY(0) scale(1);
}

/* Profile popup: anclado a la derecha */
#bnav-profile-popup {
  right: 8px;
}

/* Flechita del popup */
.bnav-popup-arrow {
  position: absolute;
  bottom: -7px;
  width: 12px;
  height: 7px;
  overflow: hidden;
  left: 50%;
  transform: translateX(-50%);
}

#bnav-profile-popup .bnav-popup-arrow {
  left: auto;
  right: 18px;
  transform: none;
}

.bnav-popup-arrow::after {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 11px;
  height: 11px;
  background: var(--gray1);
  border-right: 1px solid var(--gray3);
  border-bottom: 1px solid var(--gray3);
}

/* Items dentro del popup */
.bnav-popup-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  font-family: var(--fb);
  font-size: 13px;
  font-weight: 500;
  color: var(--gray5);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  min-height: 44px;
  user-select: none;
  -webkit-user-select: none;
}

.bnav-popup-item:hover,
.bnav-popup-item:active {
  background: var(--gray2);
  color: var(--white);
}

.bnav-popup-icon {
  font-size: 16px;
  line-height: 1;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}
