/**
 * guardia-atm - Estructura de Layout y Navegación Móvil
 * 100% Mobile-First con adaptación responsive y áreas seguras.
 */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  height: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-bg);
  color: var(--color-text-main);
  line-height: 1.5;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  touch-action: manipulation;
  overflow-x: hidden;
}

/* Indicador Offline Superior Flotante */
.offline-banner-badge {
  position: fixed;
  top: calc(var(--safe-top) + 14px);
  left: 50%;
  transform: translateX(-50%);
  background-color: #0f172a;
  color: #facc15;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  z-index: 999;
  box-shadow: var(--shadow-md);
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  gap: 6px;
  animation: fadeInDown 0.3s ease;
}

/* Header Superior Fijo (Reemplazado por Screen Headers modernos) */
.app-header {
  display: none !important;
}

/* Contenedor Principal */
.app-main {
  flex: 1;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0 0 calc(var(--bottom-nav-height) + 24px) 0;
}

/* Vistas */
.view-container {
  display: none;
}

.view-container.active {
  display: block;
  animation: fadeIn 0.2s ease;
}

/* Barra de Navegación Inferior Fija */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-nav-height);
  padding-bottom: var(--safe-bottom);
  background-color: var(--color-surface);
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 100;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.bottom-nav-item {
  flex: 1;
  height: 100%;
  max-width: 140px;
  background: transparent;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 4px 2px;
  transition: color var(--transition-fast);
  position: relative;
}

.bottom-nav-item svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 2;
  transition: transform var(--transition-fast);
}

.bottom-nav-item span {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.2px;
  text-transform: capitalize;
}

.bottom-nav-item.active {
  color: var(--color-primary);
}

.bottom-nav-item.active svg {
  transform: translateY(-2px);
  stroke: var(--color-primary);
}

.bottom-nav-item.active::before {
  content: '';
  position: absolute;
  top: 4px;
  width: 32px;
  height: 3px;
  border-radius: var(--radius-full);
  background-color: var(--color-accent);
}

/* Bloqueo de Scroll al abrir modales */
body.modal-open, body.search-open {
  overflow: hidden;
}

/* Animaciones */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translate(-50%, -10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
