/**
 * Fijate Tools - Consultor de reciclaje y buscador de residuos en España
 * Estilos canónicos premium, soporte tema claro / oscuro, 100 % responsivo.
 */

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

  /* Paleta base neutra (tema claro) */
  --bg-primary: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-hover: #e2e8f0;

  --border-subtle: #e2e8f0;
  --border-focus: #0284c7;

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-subtle: #64748b;

  /* Contenedores oficiales en España */
  --c-yellow: #ca8a04;
  --c-yellow-bg: rgba(234, 179, 8, 0.12);
  --c-blue: #2563eb;
  --c-blue-bg: rgba(37, 99, 235, 0.12);
  --c-green: #16a34a;
  --c-green-bg: rgba(22, 163, 74, 0.12);
  --c-brown: #92400e;
  --c-brown-bg: rgba(146, 64, 14, 0.12);
  --c-gray: #475569;
  --c-gray-bg: rgba(100, 116, 139, 0.12);
  --c-orange: #ea580c;
  --c-orange-bg: rgba(234, 88, 12, 0.12);
  --c-teal: #0d9488;
  --c-teal-bg: rgba(13, 148, 136, 0.12);
  --c-purple: #9333ea;
  --c-purple-bg: rgba(147, 51, 234, 0.12);

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.08);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}

[data-theme="dark"] {
  --bg-primary: #0b0f17;
  --bg-surface: #131b26;
  --bg-surface-elevated: #1a2433;
  --bg-subtle: #1e293b;
  --bg-hover: #334155;

  --border-subtle: #1e293b;
  --border-focus: #38bdf8;

  --text-main: #f8fafc;
  --text-muted: #cbd5e1;
  --text-subtle: #94a3b8;

  --c-yellow: #facc15;
  --c-yellow-bg: rgba(250, 204, 21, 0.15);
  --c-blue: #60a5fa;
  --c-blue-bg: rgba(96, 165, 250, 0.15);
  --c-green: #4ade80;
  --c-green-bg: rgba(74, 222, 128, 0.15);
  --c-brown: #f59e0b;
  --c-brown-bg: rgba(245, 158, 11, 0.15);
  --c-gray: #94a3b8;
  --c-gray-bg: rgba(148, 163, 184, 0.15);
  --c-orange: #fb923c;
  --c-orange-bg: rgba(251, 146, 60, 0.15);
  --c-teal: #2dd4bf;
  --c-teal-bg: rgba(45, 212, 191, 0.15);
  --c-purple: #c084fc;
  --c-purple-bg: rgba(192, 132, 252, 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);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6);
}

/* ==========================================
   RESET & LAYOUT CANÓNICO
   ========================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-main);
}

.text-mono {
  font-family: var(--font-mono);
}

.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%;
}

/* ==========================================
   CABECERA DE LA HERRAMIENTA (HERO)
   ========================================== */
.tool-hero-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2rem 1.75rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.tool-hero-box::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #16a34a, #eab308, #2563eb, #92400e);
}

.hero-header {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.hero-icon-badge {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: rgba(22, 163, 74, 0.12);
  color: #16a34a;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-titles {
  flex: 1;
  min-width: 0;
}

.hero-main-title {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.35rem;
}

.hero-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.hero-kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-subtle);
}

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

.kpi-number {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  color: #16a34a;
  line-height: 1.1;
}

.kpi-label {
  font-size: 0.8125rem;
  color: var(--text-subtle);
  margin-top: 0.25rem;
}

/* ==========================================
   NAVEGACIÓN POR PESTAÑAS
   ========================================== */
.tool-nav-tabs {
  display: flex;
  gap: 0.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 0.35rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.tool-nav-tabs::-webkit-scrollbar {
  display: none;
}

.nav-tab-btn {
  flex: 1 1 0%;
  min-width: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-main);
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

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

.nav-tab-btn.active {
  background: #16a34a;
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(22, 163, 74, 0.25);
}

.tab-view-section {
  display: none;
}

.tab-view-section.active {
  display: block;
}

/* ==========================================
   VISTA 1: BUSCADOR REACTIVO DE RESIDUOS
   ========================================== */
.search-control-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.75rem;
  box-shadow: var(--shadow-sm);
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  margin-bottom: 1rem;
}

.search-icon-lens {
  position: absolute;
  left: 1rem;
  color: var(--text-subtle);
  pointer-events: none;
}

.search-input-field {
  width: 100%;
  height: 52px;
  padding: 0 3rem 0 3.25rem;
  font-family: var(--font-main);
  font-size: 1.0625rem;
  color: var(--text-main);
  background: var(--bg-subtle);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  outline: none;
  transition: all 0.2s ease;
}

.search-input-field:focus {
  background: var(--bg-surface);
  border-color: #16a34a;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15);
}

.search-clear-btn {
  position: absolute;
  right: 1rem;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: var(--border-subtle);
  color: var(--text-subtle);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}

.search-clear-btn:hover {
  background: var(--bg-hover);
  color: var(--text-main);
}

/* Etiquetas de búsqueda rápida */
.quick-tags-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.quick-tags-label {
  font-size: 0.8125rem;
  color: var(--text-subtle);
  font-weight: 600;
}

.quick-tag {
  background: var(--bg-subtle);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.quick-tag:hover {
  background: #16a34a;
  color: #ffffff;
  border-color: #16a34a;
}

/* Controles de filtro secundario */
.filter-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
}

.category-select-wrapper {
  flex: 1 1 240px;
  position: relative;
}

.category-dropdown {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 42px;
  padding: 0 2.5rem 0 0.875rem;
  font-family: var(--font-main);
  font-size: 0.875rem;
  color: var(--text-main);
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  outline: none;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  cursor: pointer;
  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%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
}

.category-dropdown:focus {
  border-color: #16a34a;
}

.btn-filter-impropers {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 42px;
  padding: 0 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-family: var(--font-main);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-filter-impropers .pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ea580c;
}

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

.btn-filter-impropers.active {
  background: rgba(234, 88, 12, 0.12);
  color: #ea580c;
  border-color: #ea580c;
}

.btn-filter-impropers.active .pulse-dot {
  animation: pulse-ring 1.8s infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(234, 88, 12, 0.6); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(234, 88, 12, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(234, 88, 12, 0); }
}

/* Fila de píldoras de contenedores */
.container-pills-scroll {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 0.25rem 0;
  margin-top: 1rem;
}

.container-pills-scroll::-webkit-scrollbar {
  display: none;
}

.container-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  border-radius: 9999px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.container-pill-btn .pill-color-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.container-pill-btn:hover {
  border-color: var(--pill-color);
  color: var(--text-main);
}

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

.container-pill-btn.active .pill-color-indicator {
  background: #ffffff !important;
}

/* Encabezado de resultados */
.results-header-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.results-counter-text {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-subtle);
}

/* ==========================================
   GRID DE TARJETAS DE RESIDUOS
   ========================================== */
.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.residuo-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.residuo-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-focus);
}

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

.card-container-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
  background: var(--pill-color);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.card-container-pill .container-icon svg {
  display: block;
  width: 14px;
  height: 14px;
}

.card-improper-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  background: rgba(234, 88, 12, 0.12);
  color: #ea580c;
  border: 1px solid rgba(234, 88, 12, 0.25);
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
}

.card-improper-badge .warning-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ea580c;
}

.card-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  line-height: 1.35;
}

.card-reason-snippet {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.card-footer {
  margin-top: auto;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-subtle);
}

.btn-card-detail {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: var(--bg-subtle);
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-card-detail:hover {
  background: #16a34a;
  color: #ffffff;
}

.btn-card-detail svg {
  transition: transform 0.2s ease;
}

.btn-card-detail:hover svg {
  transform: translateX(3px);
}

/* Cargar más resultados */
.load-more-box {
  text-align: center;
  margin: 1.5rem 0 2.5rem;
}

.btn-load-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 44px;
  padding: 0 1.75rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.btn-load-more:hover {
  background: var(--bg-hover);
  border-color: var(--border-focus);
}

/* Estado vacío */
.empty-state-box {
  text-align: center;
  padding: 3.5rem 1.5rem;
  background: var(--bg-surface);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-lg);
  margin-bottom: 2rem;
}

.empty-state-icon {
  font-size: 2.75rem;
  margin-bottom: 1rem;
}

.empty-state-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.empty-state-desc {
  font-size: 0.9375rem;
  color: var(--text-muted);
  max-width: 480px;
  margin: 0 auto;
}

/* ==========================================
   VISTA 2: MINIJUEGO TEST DE RECICLAJE
   ========================================== */
.quiz-wrapper {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 2.5rem;
}

/* Pantalla de inicio del quiz */
.quiz-intro-box {
  text-align: center;
  max-width: 640px;
  margin: 0 auto;
  padding: 1rem 0;
}

.quiz-badge-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
}

.quiz-intro-title {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
}

.quiz-intro-desc {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.75rem;
}

.quiz-features-list {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.quiz-feat-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
  background: var(--bg-subtle);
  padding: 0.4rem 0.85rem;
  border-radius: 9999px;
}

.btn-primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  max-width: 320px;
  height: 48px;
  background: #16a34a;
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-main);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.35);
  transition: all 0.2s ease;
}

.btn-primary-action:hover {
  background: #15803d;
  transform: translateY(-1px);
}

/* Pantalla de juego activo */
.quiz-play-box {
  display: none;
}

.quiz-play-box.active {
  display: block;
}

.quiz-header-bar {
  margin-bottom: 1.5rem;
}

.quiz-progress-track {
  width: 100%;
  height: 8px;
  background: var(--bg-subtle);
  border-radius: 9999px;
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.quiz-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #16a34a, #22c55e);
  width: 10%;
  transition: width 0.3s ease;
}

.quiz-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-subtle);
}

.quiz-question-card {
  text-align: center;
  padding: 1.5rem;
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 1.75rem;
}

.quiz-question-pre {
  font-size: 0.875rem;
  font-weight: 600;
  color: #16a34a;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.quiz-question-text {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.3;
}

.quiz-options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
  margin-bottom: 1.75rem;
}

@media (min-width: 768px) {
  .quiz-options-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.quiz-option-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: var(--bg-surface);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.quiz-option-btn:hover:not(:disabled) {
  border-color: var(--c-accent);
  background: var(--bg-subtle);
  transform: translateY(-2px);
}

.quiz-btn-color-dot {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  border-radius: 50%;
}

.quiz-btn-text {
  display: flex;
  flex-direction: column;
}

.quiz-btn-name {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-main);
}

.quiz-btn-sub {
  font-size: 0.75rem;
  color: var(--text-subtle);
}

/* Estados de respuesta en el botón */
.quiz-option-btn.is-correct {
  border-color: #16a34a;
  background: rgba(22, 163, 74, 0.15);
}

.quiz-option-btn.is-wrong {
  border-color: #dc2626;
  background: rgba(220, 38, 38, 0.12);
  opacity: 0.7;
}

/* Caja de retroalimentación pedagógica */
.quiz-feedback-box {
  display: none;
  padding: 1.5rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  animation: fadeIn 0.3s ease;
}

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

.quiz-feedback-box.feedback-correct {
  background: rgba(22, 163, 74, 0.1);
  border: 1px solid rgba(22, 163, 74, 0.3);
}

.quiz-feedback-box.feedback-wrong {
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.25);
}

.feedback-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.0625rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.feedback-badge.success {
  color: #16a34a;
}

.feedback-badge.error {
  color: #dc2626;
}

.quiz-feedback-myth {
  font-size: 0.875rem;
  font-weight: 700;
  color: #ea580c;
  margin-bottom: 0.4rem;
}

.quiz-feedback-explanation {
  font-size: 0.9375rem;
  color: var(--text-main);
  line-height: 1.5;
  margin-bottom: 1.25rem;
}

/* Pantalla de resultados del quiz */
.quiz-result-box {
  display: none;
  text-align: center;
  max-width: 680px;
  margin: 0 auto;
}

.quiz-result-box.active {
  display: block;
}

.result-badge-display {
  font-size: 4rem;
  margin-bottom: 0.5rem;
}

.result-score-tag {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 2.25rem;
  font-weight: 800;
  color: #16a34a;
  margin-bottom: 0.25rem;
}

.result-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
}

.result-desc {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 2rem;
}

.result-actions-row {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}

.btn-secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 48px;
  padding: 0 1.5rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary-action:hover {
  background: var(--bg-hover);
}

.quiz-review-section {
  text-align: left;
  border-top: 1px solid var(--border-subtle);
  padding-top: 2rem;
}

.quiz-review-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.quiz-review-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.quiz-review-item {
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  border-left: 4px solid var(--border-subtle);
}

.quiz-review-item.is-correct {
  border-left-color: #16a34a;
}

.quiz-review-item.is-wrong {
  border-left-color: #dc2626;
}

.review-item-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.review-status.success {
  color: #16a34a;
  font-weight: 800;
}

.review-status.error {
  color: #dc2626;
  font-weight: 800;
}

.tag-destination {
  font-weight: 700;
  color: #16a34a;
}

.review-explanation {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* ==========================================
   VISTA 3: GUÍA DE CONTENEDORES EN ESPAÑA
   ========================================== */
.guide-containers-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

@media (min-width: 768px) {
  .guide-containers-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.guide-container-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.guide-container-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: var(--guide-color);
}

.guide-card-head {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.guide-icon-box {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--guide-bg);
  color: var(--guide-color);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.guide-title {
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.2;
}

.guide-subtitle {
  font-size: 0.8125rem;
  color: var(--text-subtle);
}

.guide-block {
  margin-bottom: 1rem;
}

.guide-block-label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}

.guide-block-label.yes {
  color: #16a34a;
}

.guide-block-label.no {
  color: #dc2626;
}

.guide-block-content {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.guide-law-badge {
  margin-top: 1.25rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  font-size: 0.75rem;
  color: var(--text-subtle);
  line-height: 1.45;
  border-left: 3px solid var(--guide-color);
}

/* ==========================================
   MODAL DE DETALLE DE RESIDUO
   ========================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

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

.modal-window {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  max-width: 580px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  padding: 2rem;
  position: relative;
  transform: scale(0.95);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.is-open .modal-window {
  transform: scale(1);
}

.modal-close-btn {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--bg-subtle);
  color: var(--text-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.modal-residuo-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 0.85rem;
  padding-right: 2.5rem;
}

.modal-badge-container {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 700;
  border: 1px solid transparent;
  margin-bottom: 1.25rem;
}

.modal-improper-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(234, 88, 12, 0.12);
  border: 1px solid rgba(234, 88, 12, 0.25);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  color: #ea580c;
  margin-bottom: 1.25rem;
}

.improper-alert-title {
  font-size: 0.875rem;
  font-weight: 700;
}

.modal-section-block {
  margin-bottom: 1.25rem;
}

.modal-block-heading {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
}

.modal-text-content {
  font-size: 0.9375rem;
  color: var(--text-main);
  line-height: 1.6;
}

.modal-synonyms-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.5rem;
}

.synonym-tag {
  background: var(--bg-subtle);
  color: var(--text-muted);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 500;
}

/* ==========================================
   SECCIÓN SEO Y NORMATIVA AL PIE
   ========================================== */
.seo-knowledge-section {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-top: 3rem;
  margin-bottom: 2rem;
}

.seo-knowledge-title {
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 1rem;
}

.seo-knowledge-text {
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 1.25rem;
}

.seo-accordion-item {
  border-top: 1px solid var(--border-subtle);
  padding: 1.25rem 0;
}

.seo-accordion-title {
  font-size: 1.0625rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

/* ==========================================
   RESPONSIVIDAD Y CONTROLES MÓVILES
   ========================================== */
@media (max-width: 768px) {
  .hero-header {
    flex-direction: column;
    gap: 0.75rem;
  }

  .hero-main-title {
    font-size: 1.35rem;
  }

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

  .filter-controls-row {
    flex-direction: column;
    align-items: stretch;
  }

  .category-select-wrapper {
    width: 100%;
  }

  .btn-filter-impropers {
    width: 100%;
    justify-content: center;
  }

  .results-grid {
    grid-template-columns: 1fr;
  }

  .quiz-options-grid {
    grid-template-columns: 1fr;
  }

  .result-actions-row {
    flex-direction: column;
  }

  .btn-primary-action, .btn-secondary-action {
    max-width: 100%;
    width: 100%;
  }
}
