:root {
  /* Variables de diseño para consistencia y fácil mantenimiento */
  --primary-color: #bf4624;
  --primary-hover: #bf462481;
  --bg-color: #f8fafc;
  --card-bg: #ffffff;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --transition-speed: 0.3s;
  --radius: 8px;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* * {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
        }

        body {
            font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
            background-color: var(--bg-color);
            color: var(--text-main);
            line-height: 1.6;
            padding: 2rem;
        } */

.container {
  max-width: 900px;
  margin: 0 auto;
}

header {
  text-align: center;
  margin-bottom: 2rem;
}

h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

p.subtitle {
  color: var(--text-muted);
}

/* --- Componente: Navegación Alfabética --- */
.alphabet-nav {
  background: var(--card-bg);
  padding: 1rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
  position: sticky;
  top: 1rem;
  z-index: 100;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem;
}

.alpha-btn {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.alpha-btn:hover:not(.disabled) {
  background-color: #eff6ff;
  color: var(--primary-color);
}

.alpha-btn.active {
  background-color: var(--primary-color);
  color: white;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3);
}

.alpha-btn.disabled {
  color: #cbd5e1;
  cursor: default;
  pointer-events: none;
}

/* --- Componente: Lista de Términos --- */
.terms-container {
  min-height: 300px;
}

.empty-state {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
  font-style: italic;
}

.term-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  margin-bottom: 1rem;
  overflow: hidden;
  transition: box-shadow var(--transition-speed);
}

.term-card:hover {
  box-shadow: var(--shadow);
  border-color: #cbd5e1;
}

.term-header {
  padding: 1rem 1.5rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: white;
  user-select: none;
}

.term-title {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text-main);
  transition: color 0.2s;
}

.term-icon {
  color: var(--text-muted);
  transition: transform 0.3s ease;
}

/* Estado activo del término (abierto) */
.term-card.open .term-header {
  background-color: #f8fafc;
}

.term-card.open .term-title {
  color: var(--primary-color);
}

.term-card.open .term-icon {
  transform: rotate(180deg);
  color: var(--primary-color);
}

/* Animación suave del contenido usando max-height */
.term-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease-out;
  background-color: #fff;
}

.term-content {
  padding: 0 1.5rem 1.5rem 1.5rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.7;
  border-top: 1px solid transparent;
}

.term-card.open .term-content {
  border-top-color: #f1f5f9;
  padding-top: 1rem;
}

/* --- Responsive Design --- */
@media (max-width: 768px) {
  /* body {
    padding: 1rem;
  } */

  .alphabet-nav {
    /* Convertir a barra scrollable horizontal en móviles */
    /* flex-wrap: nowrap; */
    justify-content: flex-start;
    overflow-x: auto;
    padding: 0.75rem;
    -webkit-overflow-scrolling: touch; /* Scroll suave en iOS */

    /* Ocultar barra de scroll pero mantener funcionalidad */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
  }

  .alphabet-nav::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
  }

  .alpha-btn {
    flex: 0 0 auto; /* No encoger botones */
    width: 40px;
    height: 40px;
    font-size: 1.1rem; /* Hit area más grande para dedos */
  }

  h1 {
    font-size: 1.5rem;
  }
}
