/* ==========================================================================
   Fijate Tools - Guía interactiva y calendario de podas e injertos de frutales
   CSS Corporativo Canónico (Inter, Outfit, JetBrains Mono)
   Modo claro y oscuro nativo con paleta botánica / agrícola premium
   ========================================================================== */

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

  /* Paleta botánica - Tema claro */
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-subtle: #f1f5f9;
  --bg-card-hover: #e2e8f0;
  --border-color: #e2e8f0;
  --border-focus: #10b981;
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-subtle: #64748b;

  /* Acentos agronómicos */
  --brand-primary: #059669;
  --brand-primary-hover: #047857;
  --brand-primary-light: #ecfdf5;
  --brand-primary-border: #a7f3d0;
  --brand-earth: #b45309;
  --brand-earth-light: #fffbeb;
  --accent-amber: #d97706;
  --accent-amber-light: #fef3c7;
  --accent-blue: #0284c7;
  --accent-blue-light: #e0f2fe;
  --accent-red: #dc2626;
  --accent-red-light: #fef2f2;
  --accent-purple: #7c3aed;
  --accent-purple-light: #f5f3ff;

  /* Sombras y transiciones */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 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.04);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] {
  --bg-page: #0b0f17;
  --bg-card: #131b26;
  --bg-card-subtle: #1a2433;
  --bg-card-hover: #223044;
  --border-color: #26354a;
  --border-focus: #10b981;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;

  --brand-primary: #10b981;
  --brand-primary-hover: #34d399;
  --brand-primary-light: rgba(16, 185, 129, 0.12);
  --brand-primary-border: rgba(16, 185, 129, 0.3);
  --brand-earth: #f59e0b;
  --brand-earth-light: rgba(245, 158, 11, 0.12);
  --accent-amber: #fbbf24;
  --accent-amber-light: rgba(251, 191, 36, 0.12);
  --accent-blue: #38bdf8;
  --accent-blue-light: rgba(56, 189, 248, 0.12);
  --accent-red: #f87171;
  --accent-red-light: rgba(248, 113, 113, 0.12);
  --accent-purple: #a78bfa;
  --accent-purple-light: rgba(167, 139, 250, 0.12);

  --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);
}

/* Base obligatoria */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

h1, h2, h3, h4, h5, h6,
.brand-title,
.hero-title,
.card-title,
.section-title {
  font-family: var(--font-heading);
  letter-spacing: -0.02em;
  font-weight: 700;
  color: var(--text-main);
}

.mono, code, .badge-count, .table-month-num {
  font-family: var(--font-mono);
}

/* Barra de navegación de la suite agrícola */
.suite-nav-strip {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  padding: 0.6rem 1rem;
}

.suite-nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.suite-nav-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--brand-primary);
  white-space: nowrap;
}

.suite-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.suite-link-item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: 9999px;
  text-decoration: none;
  transition: var(--transition);
}

.suite-link-item:hover {
  color: var(--brand-primary);
  border-color: var(--brand-primary);
  background: var(--brand-primary-light);
}

.suite-link-item.active {
  color: var(--brand-primary);
  border-color: var(--brand-primary);
  background: var(--brand-primary-light);
  font-weight: 700;
}

/* Layout canónico */
.main-wrapper.tool-layout {
  max-width: 1200px;
  margin: 1.5rem auto 3rem;
  padding: 0 1rem;
  flex: 1;
  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;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Sidebar publicitaria */
.tool-ad-sidebar {
  width: 300px;
  flex-shrink: 0;
}

.ad-sticky-box {
  position: sticky;
  top: 1.5rem;
}

/* Hero card */
.hero-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  overflow: hidden;
}

.hero-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #059669 0%, #10b981 50%, #d97706 100%);
}

.hero-header {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.hero-header h2 {
  font-size: 1.65rem;
  line-height: 1.25;
}

.hero-tagline {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 800px;
}

/* Barra rápida de filtrado mensual "¿Qué podar hoy?" */
.current-month-bar {
  background: var(--brand-primary-light);
  border: 1px solid var(--brand-primary-border);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.current-month-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.current-month-badge {
  background: var(--brand-primary);
  color: #ffffff;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.current-month-text {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-main);
}

.month-selector-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.month-selector-wrapper label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Pestañas de modo de la herramienta */
.mode-tabs-container {
  display: flex;
  gap: 0.5rem;
  background: var(--bg-card);
  padding: 0.4rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow-x: auto;
  scrollbar-width: thin;
}

.tab-btn {
  flex: 1;
  min-width: 140px;
  padding: 0.65rem 1rem;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: var(--transition);
  min-height: 42px;
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--brand-primary);
  background: var(--bg-card-subtle);
}

.tab-btn.active {
  color: #ffffff;
  background: var(--brand-primary);
  box-shadow: var(--shadow-sm);
}

/* Paneles de pestaña */
.tab-panel {
  display: none;
  flex-direction: column;
  gap: 1.5rem;
}

.tab-panel.active {
  display: flex;
}

/* ==========================================================================
   SECTOR 1: CALENDARIO Y ESPECIES
   ========================================================================== */

/* Barra de especies frutales (carrusel de chips o grid) */
.species-selector-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.species-box-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.species-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.6rem;
}

.species-card-btn {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.5rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  text-align: center;
  transition: var(--transition);
  min-height: 72px;
  justify-content: center;
}

.species-card-btn:hover {
  border-color: var(--brand-primary);
  background: var(--brand-primary-light);
  transform: translateY(-2px);
}

.species-card-btn.active {
  background: var(--brand-primary-light);
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 2px var(--brand-primary);
}

.species-icon {
  font-size: 1.4rem;
  line-height: 1;
}

.species-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.15;
}

.species-latin {
  font-size: 0.72rem;
  color: var(--text-subtle);
  font-style: italic;
  display: block;
}

/* Ficha técnica del árbol seleccionado */
.species-detail-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.species-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1rem;
}

.species-card-main-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.species-big-icon {
  font-size: 2.5rem;
  line-height: 1;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-primary-light);
  border-radius: var(--radius-md);
  border: 1px solid var(--brand-primary-border);
}

.species-card-titles h3 {
  font-size: 1.4rem;
  line-height: 1.2;
}

.species-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.species-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  background: var(--bg-card-subtle);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

.species-badge.badge-primary {
  background: var(--brand-primary-light);
  color: var(--brand-primary);
  border-color: var(--brand-primary-border);
}

.species-quick-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.85rem;
}

.fact-item {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.fact-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-subtle);
}

.fact-value {
  font-size: 0.88rem;
  color: var(--text-main);
  line-height: 1.4;
}

/* Matriz visual anual del calendario de podas */
.calendar-matrix-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.matrix-header-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.matrix-title {
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.matrix-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.8rem;
}

.legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 500;
}

.legend-color-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.dot-invernal { background: #0284c7; }
.dot-formacion { background: #7c3aed; }
.dot-verde { background: #059669; }
.dot-rejuvenecimiento { background: #d97706; }

/* Tabla interactiva de 12 meses */
.calendar-matrix-scroll {
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-card);
}

.calendar-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 700px;
  font-size: 0.85rem;
}

.calendar-table th,
.calendar-table td {
  padding: 0.65rem 0.5rem;
  text-align: center;
  border: 1px solid var(--border-color);
}

.calendar-table th {
  background: var(--bg-card-subtle);
  font-weight: 700;
  color: var(--text-main);
}

.calendar-table th.col-poda {
  text-align: left;
  min-width: 180px;
  padding-left: 0.85rem;
}

.calendar-table td.col-poda-title {
  text-align: left;
  font-weight: 600;
  padding-left: 0.85rem;
  background: var(--bg-card);
  color: var(--text-main);
}

.cal-cell {
  position: relative;
  transition: var(--transition);
  cursor: pointer;
  height: 48px;
  font-size: 0.75rem;
  font-weight: 600;
}

.cal-cell.status-optimo-invernal { background: rgba(2, 132, 199, 0.22); color: #0284c7; }
.cal-cell.status-posible-invernal { background: rgba(2, 132, 199, 0.08); color: #0284c7; }

.cal-cell.status-optimo-formacion { background: rgba(124, 58, 237, 0.22); color: #7c3aed; }
.cal-cell.status-posible-formacion { background: rgba(124, 58, 237, 0.08); color: #7c3aed; }

.cal-cell.status-optimo-verde { background: rgba(5, 150, 105, 0.22); color: #059669; }
.cal-cell.status-posible-verde { background: rgba(5, 150, 105, 0.08); color: #059669; }

.cal-cell.status-optimo-rejuvenecimiento { background: rgba(217, 119, 6, 0.22); color: #d97706; }
.cal-cell.status-posible-rejuvenecimiento { background: rgba(217, 119, 6, 0.08); color: #d97706; }

.cal-cell.status-none {
  background: transparent;
  color: var(--text-subtle);
  opacity: 0.35;
}

.cal-cell:hover:not(.status-none) {
  filter: brightness(0.95);
  box-shadow: inset 0 0 0 2px currentColor;
}

.cal-cell.is-current-month-col {
  box-shadow: inset 0 0 0 2px var(--brand-primary);
}

/* Fichas detalladas de las 4 modalidades de poda */
.pruning-modalities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.modality-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: relative;
  overflow: hidden;
}

.modality-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  bottom: 0;
}

.modality-card.card-invernal::before { background: #0284c7; }
.modality-card.card-formacion::before { background: #7c3aed; }
.modality-card.card-verde::before { background: #059669; }
.modality-card.card-rejuvenecimiento::before { background: #d97706; }

.modality-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.modality-header h4 {
  font-size: 1.05rem;
  line-height: 1.2;
}

.modality-period-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 9999px;
  background: var(--bg-card-subtle);
  color: var(--text-muted);
}

.modality-steps-list {
  padding-left: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.86rem;
  color: var(--text-main);
}

.modality-steps-list li {
  line-height: 1.45;
}

/* ==========================================================================
   SECTOR 2: TALLER DE INJERTOS Y COMPATIBILIDAD
   ========================================================================== */

.graft-tool-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Comprobador interactivo de afinidad */
.compatibility-tester-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.tester-title-area h3 {
  font-size: 1.35rem;
}

.tester-title-area p {
  color: var(--text-muted);
  font-size: 0.92rem;
}

.tester-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  align-items: flex-end;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.field-group label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
}

.field-select,
.field-input {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  height: 44px;
  padding: 0.5rem 2.5rem 0.5rem 0.85rem;
  font-size: 0.92rem;
  font-family: var(--font-main);
  background-color: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  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;
  transition: var(--transition);
}

.field-input {
  padding-right: 0.85rem;
  background-image: none;
}

.field-select:focus,
.field-input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

/* Tarjeta de resultado de afinidad biológica */
.affinity-result-box {
  border-radius: var(--radius-md);
  padding: 1.25rem;
  border: 1px solid var(--border-color);
  background: var(--bg-card-subtle);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: var(--transition);
}

.affinity-result-box.affinity-compatible {
  border-color: var(--brand-primary);
  background: var(--brand-primary-light);
}

.affinity-result-box.affinity-intermediate {
  border-color: var(--accent-amber);
  background: var(--accent-amber-light);
}

.affinity-result-box.affinity-incompatible {
  border-color: var(--accent-red);
  background: var(--accent-red-light);
}

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

.affinity-badge-status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 700;
  font-size: 0.95rem;
}

.affinity-compatible .affinity-badge-status { color: var(--brand-primary); }
.affinity-intermediate .affinity-badge-status { color: var(--accent-amber); }
.affinity-incompatible .affinity-badge-status { color: var(--accent-red); }

.affinity-explanation {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-main);
}

.affinity-grafts-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.affinity-graft-tag {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition: var(--transition);
}

.affinity-graft-tag:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}

/* Fichas de las 5 técnicas canónicas de injerto */
.graft-techniques-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.techniques-nav-chips {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

.technique-chip-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
  min-height: 40px;
}

.technique-chip-btn:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}

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

.technique-detail-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.technique-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1rem;
}

.technique-header h3 {
  font-size: 1.35rem;
}

.technique-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
}

.technique-meta-pill {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.technique-meta-pill .label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-subtle);
}

.technique-meta-pill .val {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
}

/* Pasos ilustrados del injerto */
.steps-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.step-card {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.step-badge-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--brand-primary);
  color: #ffffff;
  font-weight: 800;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-content {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.step-content h5 {
  font-size: 0.98rem;
}

.step-content p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* Alertas de errores comunes */
.critical-tip-box {
  background: var(--accent-amber-light);
  border: 1px solid var(--accent-amber);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.critical-tip-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.critical-tip-text h6 {
  font-size: 0.92rem;
  color: var(--brand-earth);
  margin-bottom: 0.25rem;
}

.critical-tip-text p {
  font-size: 0.85rem;
  color: var(--text-main);
  line-height: 1.4;
}

/* ==========================================================================
   SECTOR 3: BUSCADOR POR SÍNTOMAS
   ========================================================================== */

.symptoms-container {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.symptoms-search-bar {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.search-input-wrapper {
  position: relative;
  width: 100%;
}

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

.symptom-search-input {
  width: 100%;
  height: 46px;
  padding: 0.5rem 1rem 0.5rem 2.6rem;
  font-size: 0.95rem;
  background: var(--bg-page);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.symptom-search-input:focus {
  outline: none;
  border-color: var(--border-focus);
  background: var(--bg-card);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.symptoms-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

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

.symptom-card:hover {
  border-color: var(--brand-primary);
  transform: translateY(-1px);
}

.symptom-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.symptom-card-header h4 {
  font-size: 1.1rem;
  line-height: 1.3;
}

.urgency-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  white-space: nowrap;
}

.urgency-alta {
  background: var(--accent-red-light);
  color: var(--accent-red);
}

.urgency-media {
  background: var(--accent-amber-light);
  color: var(--accent-amber);
}

.symptom-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
  background: var(--bg-card-subtle);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
}

.symptom-box-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.symptom-box-item .s-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-subtle);
}

.symptom-box-item .s-text {
  font-size: 0.88rem;
  color: var(--text-main);
  line-height: 1.4;
}

/* ==========================================================================
   SECTOR 4: MANUAL DE CORTE Y HERRAMIENTAS
   ========================================================================== */

.manual-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.guide-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
}

.guide-box h4 {
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.rules-list {
  padding-left: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.88rem;
}

.rules-list li {
  line-height: 1.45;
}

.tools-checklist {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.tool-check-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.88rem;
  background: var(--bg-card-subtle);
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.tool-check-icon {
  color: var(--brand-primary);
  font-weight: 800;
}

/* Modales accesibles (Sin alert nativo) */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 9999;
}

.modal-overlay.active {
  display: flex;
}

.modal-window {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 580px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 1.2rem;
}

.btn-close-modal {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.4rem;
  line-height: 1;
  padding: 0.25rem;
  border-radius: 4px;
}

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

.modal-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  font-size: 0.92rem;
  line-height: 1.55;
}

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

.btn-modal-action {
  height: 42px;
  padding: 0 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  background: var(--brand-primary);
  color: #ffffff;
  border: none;
  transition: var(--transition);
}

.btn-modal-action:hover {
  background: var(--brand-primary-hover);
}

/* ==========================================================================
   ADAPTACIÓN RESPONSIVE ESTRICTA (Móvil y Desktop)
   ========================================================================== */

@media (max-width: 1024px) {
  .tool-with-sidebar {
    flex-direction: column;
  }
  .tool-ad-sidebar {
    display: none;
  }
}

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

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

  .hero-header h2 {
    font-size: 1.35rem;
  }

  .species-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .species-card-btn {
    min-height: 64px;
    padding: 0.5rem 0.25rem;
  }

  .species-icon {
    font-size: 1.2rem;
  }

  .species-name {
    font-size: 0.78rem;
  }

  .species-latin {
    display: none;
  }

  .species-detail-card,
  .compatibility-tester-card,
  .technique-detail-card,
  .guide-box {
    padding: 1rem;
  }

  .current-month-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .month-selector-wrapper {
    width: 100%;
  }

  .month-selector-wrapper select {
    flex: 1;
  }

  .step-card {
    flex-direction: column;
    gap: 0.5rem;
  }

  .tab-btn {
    min-width: 120px;
    font-size: 0.82rem;
    padding: 0.5rem 0.75rem;
  }
}

@media (max-width: 480px) {
  .species-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
