/**
 * Estilos canónicos: Guía completa de las 13 vitaminas
 * Cumplimiento de estándares de Fijate Tools: tema claro/oscuro unificado,
 * responsive mobile-first, sin colisiones sticky y accesibilidad dialog/modal.
 */

:root {
  --font-main: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-heading: 'Outfit', 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;

  /* Colores tema claro */
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-surface: #f1f5f9;
  --bg-surface-hover: #e2e8f0;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --primary: #0284c7;
  --primary-hover: #0369a1;
  --primary-light: #e0f2fe;
  --accent-lipo: #d97706;
  --accent-lipo-bg: #fef3c7;
  --accent-hidro: #2563eb;
  --accent-hidro-bg: #dbeafe;
  --success: #16a34a;
  --success-bg: #dcfce7;
  --danger: #dc2626;
  --danger-bg: #fee2e2;
  --warning: #ca8a04;
  --warning-bg: #fef9c3;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

[data-theme="dark"], body.dark-theme {
  --bg-page: #0b1120;
  --bg-card: #151f32;
  --bg-surface: #1e293b;
  --bg-surface-hover: #334155;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border-color: #334155;
  --primary: #38bdf8;
  --primary-hover: #0ea5e9;
  --primary-light: rgba(56, 189, 248, 0.15);
  --accent-lipo: #fbbf24;
  --accent-lipo-bg: rgba(251, 191, 36, 0.15);
  --accent-hidro: #60a5fa;
  --accent-hidro-bg: rgba(96, 165, 250, 0.15);
  --success: #4ade80;
  --success-bg: rgba(74, 222, 128, 0.15);
  --danger: #f87171;
  --danger-bg: rgba(248, 113, 113, 0.15);
  --warning: #facc15;
  --warning-bg: rgba(250, 204, 21, 0.15);

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
}

/* Reglas universales y de accesibilidad */
*, *::before, *::after {
  box-sizing: border-box;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

body {
  margin: 0;
  background-color: var(--bg-page);
  color: var(--text-main);
  font-family: var(--font-main);
  overflow-x: clip;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* Layout canónico */
.tool-layout {
  max-width: 1200px;
  margin: 1.5rem auto 3rem;
  padding: 0 1rem;
  box-sizing: border-box;
  flex: 1 0 auto;
  width: 100%;
}

.tool-with-sidebar {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  width: 100%;
}

.tool-main-content {
  flex: 1 1 0%;
  min-width: 0;
  width: 100%;
}

/* Hero y cabecera de la herramienta */
.tool-hero {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem 1.75rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.tool-hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #f59e0b, #0284c7, #10b981, #ec4899);
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  margin-bottom: 0.75rem;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 1.85rem;
  font-weight: 800;
  line-height: 1.25;
  margin: 0 0 0.75rem;
  color: var(--text-main);
}

.hero-desc {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin: 0 0 1.5rem;
  max-width: 820px;
}

.hero-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-color);
}

.kpi-card {
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.kpi-val {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
}

.kpi-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* Barra de pestañas de navegación interna */
.tool-nav-tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 2px solid var(--border-color);
  margin-bottom: 2rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  -webkit-overflow-scrolling: touch;
}

.nav-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: none;
  padding: 0.75rem 1.25rem;
  font-family: var(--font-main);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  transition: all 0.2s ease;
  white-space: nowrap;
  min-height: 44px;
}

.nav-tab-btn:hover {
  color: var(--text-main);
  background: var(--bg-surface);
}

.nav-tab-btn.active {
  color: var(--primary);
  border-bottom: 3px solid var(--primary);
  background: var(--primary-light);
}

/* Paneles de contenido */
.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
  animation: fadeIn 0.25s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Barra de controles: buscador y filtros del catálogo */
.catalog-controls {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.search-box-row {
  display: flex;
  gap: 0.75rem;
  width: 100%;
}

.search-input-wrapper {
  position: relative;
  flex: 1 1 0%;
  min-width: 0;
}

.search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 44px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0 1rem 0 2.5rem;
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 0.95rem;
  transition: border-color 0.2s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
}

.filter-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.chip-group-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-right: 0.25rem;
  white-space: nowrap;
}

.filter-chip {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 9999px;
  padding: 0.35rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
}

.filter-chip:hover {
  background: var(--bg-surface-hover);
  color: var(--text-main);
}

.filter-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.results-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  padding: 0 0.25rem;
}

/* Cuadrícula de tarjetas de vitaminas */
.vitamins-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.vitamin-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
  overflow: hidden;
}

.vitamin-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.card-solubility-stripe {
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  bottom: 0;
}

.stripe-lipo {
  background-color: var(--accent-lipo);
}

.stripe-hidro {
  background-color: var(--accent-hidro);
}

.card-header-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.85rem;
  gap: 0.5rem;
}

.vitamin-badge-title {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.vitamin-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-main);
}

.vitamin-subnames {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.3;
}

.badge-solubility {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  white-space: nowrap;
}

.badge-lipo {
  background: var(--accent-lipo-bg);
  color: var(--accent-lipo);
}

.badge-hidro {
  background: var(--accent-hidro-bg);
  color: var(--accent-hidro);
}

.card-summary {
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text-main);
  margin-bottom: 1rem;
  flex: 1 0 auto;
}

.card-kpi-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  margin-bottom: 1rem;
}

.card-kpi-item {
  display: flex;
  flex-direction: column;
}

.kpi-item-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 700;
}

.kpi-item-val {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
}

.card-foods-preview {
  margin-bottom: 1.25rem;
}

.foods-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  display: block;
}

.food-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.food-chip {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 0.74rem;
  padding: 0.2rem 0.5rem;
  color: var(--text-main);
}

.btn-view-sheet {
  width: 100%;
  height: 42px;
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-family: var(--font-main);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.btn-view-sheet:hover {
  background: var(--primary);
  color: #ffffff;
}

/* Módulo 2: Calculadora de requerimientos dietéticos (EFSA) */
.calc-card-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem 1.75rem;
  margin-bottom: 2.5rem;
  box-shadow: var(--shadow-sm);
}

.section-head {
  margin-bottom: 1.5rem;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  color: var(--text-main);
}

.section-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

.calc-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.75rem;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
}

.form-select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 44px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0 2.5rem 0 0.85rem;
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 0.9rem;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  cursor: pointer;
}

.form-select option {
  background-color: var(--bg-card);
  color: var(--text-main);
}

.calc-results-box {
  border-top: 1px solid var(--border-color);
  padding-top: 1.5rem;
}

.alerts-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.calc-alert {
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  font-size: 0.88rem;
  line-height: 1.5;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.alert-warning {
  background: var(--warning-bg);
  border: 1px solid rgba(202, 138, 4, 0.3);
  color: #713f12;
}

[data-theme="dark"] .alert-warning {
  color: #fef08a;
}

.alert-danger {
  background: var(--danger-bg);
  border: 1px solid rgba(220, 38, 38, 0.3);
  color: #7f1d1d;
}

[data-theme="dark"] .alert-danger {
  color: #fca5a5;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  text-align: left;
}

.custom-table th {
  background: var(--bg-surface);
  color: var(--text-muted);
  font-weight: 700;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.custom-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
}

.custom-table tr:last-child td {
  border-bottom: none;
}

.custom-table tr:hover td {
  background: var(--bg-surface);
}

/* Módulo 3: Buscador inverso (síntomas y alimentos) */
.reverse-search-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem 1.75rem;
  margin-bottom: 2.5rem;
  box-shadow: var(--shadow-sm);
}

.subtabs-container {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.subtab-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.5rem 1rem;
  font-family: var(--font-main);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.subtab-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.symptoms-grid, .foods-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

.symptom-card, .food-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.symptom-header, .food-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-main);
}

.symptom-expl, .food-expl {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-muted);
  margin: 0;
}

.symptom-vitamins-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: auto;
  padding-top: 0.5rem;
}

.vitamin-pill-link {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 9999px;
  padding: 0.25rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  cursor: pointer;
}

.vitamin-pill-link:hover {
  background: var(--primary);
  color: #ffffff;
}

/* Módulo 4: Quiz interactivo de mitos */
.quiz-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem 1.75rem;
  margin-bottom: 2.5rem;
  box-shadow: var(--shadow-sm);
}

.quiz-hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  padding: 0.75rem 1.25rem;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  font-weight: 700;
}

.quiz-score-num {
  font-family: var(--font-mono);
  color: var(--primary);
}

.quiz-question-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.quiz-q-num {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.quiz-q-text {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.4;
  margin: 0 0 1.25rem;
  color: var(--text-main);
}

.quiz-actions {
  display: flex;
  gap: 1rem;
}

.btn-quiz {
  flex: 1 1 0%;
  height: 48px;
  border-radius: var(--radius-sm);
  font-family: var(--font-main);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-true {
  background: var(--success-bg);
  color: var(--success);
  border-color: rgba(22, 163, 74, 0.4);
}

.btn-true:hover:not(:disabled) {
  background: var(--success);
  color: #ffffff;
}

.btn-false {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: rgba(220, 38, 38, 0.4);
}

.btn-false:hover:not(:disabled) {
  background: var(--danger);
  color: #ffffff;
}

.btn-quiz:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.quiz-feedback {
  margin-top: 1.25rem;
  padding: 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  line-height: 1.5;
  display: none;
}

.quiz-feedback.correct {
  display: block;
  background: var(--success-bg);
  color: #14532d;
  border: 1px solid rgba(22, 163, 74, 0.3);
}

[data-theme="dark"] .quiz-feedback.correct {
  color: #bbf7d0;
}

.quiz-feedback.incorrect {
  display: block;
  background: var(--danger-bg);
  color: #7f1d1d;
  border: 1px solid rgba(220, 38, 38, 0.3);
}

[data-theme="dark"] .quiz-feedback.incorrect {
  color: #fecaca;
}

.btn-next-quiz {
  margin-top: 1rem;
  height: 42px;
  background: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0 1.5rem;
  font-family: var(--font-main);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}

/* Modal accesible de ficha técnica detallada */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.modal-dialog {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  max-width: 760px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  position: relative;
  transform: scale(0.95);
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
}

.modal-backdrop.open .modal-dialog {
  transform: scale(1);
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  background: var(--bg-card);
  z-index: 10;
}

.modal-title-box {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.modal-title {
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 800;
  margin: 0;
  color: var(--text-main);
}

.modal-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.btn-close-modal {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-close-modal:hover {
  background: var(--bg-surface-hover);
  color: var(--text-main);
}

.modal-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.modal-section-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-list {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--text-main);
  font-size: 0.9rem;
  line-height: 1.6;
}

.modal-grid-duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.modal-box-alert {
  border-radius: var(--radius-sm);
  padding: 1rem;
  font-size: 0.85rem;
  line-height: 1.5;
}

.box-deficiency {
  background: var(--danger-bg);
  border: 1px solid rgba(220, 38, 38, 0.2);
  color: var(--text-main);
}

.box-toxicity {
  background: var(--warning-bg);
  border: 1px solid rgba(202, 138, 4, 0.2);
  color: var(--text-main);
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  background: var(--bg-surface);
  display: flex;
  justify-content: flex-end;
}

/* Acordeón FAQ y Guía SEO */
.seo-faq-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem 1.75rem;
  margin-top: 2rem;
  margin-bottom: 2rem;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.faq-item {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.faq-question {
  width: 100%;
  background: var(--bg-surface);
  border: none;
  padding: 1rem 1.25rem;
  text-align: left;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.2s ease;
  min-height: 48px;
}

.faq-question:hover {
  background: var(--bg-surface-hover);
}

.faq-chevron {
  transition: transform 0.2s ease;
  color: var(--text-muted);
}

.faq-item.open .faq-chevron {
  transform: rotate(180deg);
}

.faq-answer {
  display: none;
  padding: 1.25rem;
  background: var(--bg-card);
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
}

.faq-item.open .faq-answer {
  display: block;
}

/* Ajustes Responsive */
@media (max-width: 992px) {
  .vitamins-grid, .symptoms-grid, .foods-grid {
    grid-template-columns: 1fr;
  }

  .modal-grid-duo {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .tool-layout {
    margin: 1rem auto 2rem;
    padding: 0 0.75rem;
  }

  .tool-hero {
    padding: 1.25rem 1rem;
  }

  .hero-title {
    font-size: 1.45rem;
  }

  .hero-kpis {
    grid-template-columns: 1fr 1fr;
  }

  .calc-card-container, .reverse-search-wrapper, .quiz-wrapper, .seo-faq-section {
    padding: 1.25rem 1rem;
  }

  .quiz-actions {
    flex-direction: column;
  }
}
