/* ==========================================================================
   Calculadora de Presiones de Neumáticos MTB - Fijate Tools
   Estándar Canónico: Inter, Outfit, JetBrains Mono | Midnight Slate
   ========================================================================== */

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

  /* Paleta Corporativa Midnight Slate (Dark Theme por defecto) */
  --bg-page: #0b0f17;
  --bg-card: #111827;
  --bg-card-subtle: #162032;
  --bg-card-hover: #1e293b;
  --bg-input: #0f172a;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: #10b981;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;

  /* Colores temáticos MTB */
  --primary-color: #10b981;
  --primary-light: #34d399;
  --primary-glow: rgba(16, 185, 129, 0.25);

  --front-wheel-color: #0ea5e9;
  --front-wheel-glow: rgba(14, 165, 233, 0.25);

  --rear-wheel-color: #f97316;
  --rear-wheel-glow: rgba(249, 115, 22, 0.25);

  --warning-bg: rgba(245, 158, 11, 0.12);
  --warning-border: rgba(245, 158, 11, 0.35);
  --warning-text: #fbbf24;

  --tip-bg: rgba(16, 185, 129, 0.12);
  --tip-border: rgba(16, 185, 129, 0.3);
  --tip-text: #6ee7b7;

  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-sm: 6px;
  --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Modo Claro Canónico */
[data-theme="light"],
body.light-theme {
  --bg-page: #f1f5f9;
  --bg-card: #ffffff;
  --bg-card-subtle: #f8fafc;
  --bg-card-hover: #e2e8f0;
  --bg-input: #ffffff;
  --border-color: #e2e8f0;
  --border-focus: #059669;

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

  --primary-color: #059669;
  --primary-light: #10b981;
  --primary-glow: rgba(5, 150, 105, 0.2);

  --front-wheel-color: #0284c7;
  --rear-wheel-color: #ea580c;

  --warning-bg: #fffbeb;
  --warning-border: #fde68a;
  --warning-text: #b45309;

  --tip-bg: #ecfdf5;
  --tip-border: #a7f3d0;
  --tip-text: #047857;

  --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
}

/* Estructura Base */
*, *::before, *::after {
  box-sizing: border-box;
}

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

h1, h2, h3, h4, h5, h6,
.brand-title,
.panel-section-title,
.metrics-title,
.modal-title,
.seo-title {
  font-family: var(--font-heading);
}

.mono,
.gauge-number,
.gauge-secondary-val,
.weight-total-badge span {
  font-family: var(--font-mono);
}

/* Layout y Contención */
.tool-layout {
  max-width: 1200px;
  margin: 1.5rem auto 3rem;
  padding: 0 1rem;
  flex: 1 0 auto;
}

.card-main {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  margin-bottom: 2rem;
}

/* Barra Superior de Herramientas */
.pressure-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1.25rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
}

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

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

.btn-chip {
  background: var(--bg-card-subtle);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 0.4rem 0.85rem;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  min-height: 36px;
  display: inline-flex;
  align-items: center;
}

.btn-chip:hover {
  background: var(--bg-card-hover);
  border-color: var(--text-subtle);
}

.btn-chip.is-active {
  background: var(--primary-glow);
  color: var(--primary-color);
  border-color: var(--primary-color);
  font-weight: 600;
}

.toolbar-right-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.sync-toggle-box {
  display: flex;
  align-items: center;
}

.toggle-control-label {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-muted);
  user-select: none;
}

.toggle-control-label input {
  display: none;
}

.toggle-slider {
  width: 38px;
  height: 22px;
  background-color: var(--bg-card-hover);
  border-radius: 22px;
  position: relative;
  transition: var(--transition);
  border: 1px solid var(--border-color);
}

.toggle-slider::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background-color: #ffffff;
  top: 2px;
  left: 2px;
  transition: var(--transition);
}

.toggle-control-label input:checked + .toggle-slider {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.toggle-control-label input:checked + .toggle-slider::after {
  transform: translateX(16px);
}

.unit-selector-pills {
  display: inline-flex;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 2px;
}

.btn-pill {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition);
}

.btn-pill.is-active {
  background: var(--bg-card);
  color: var(--text-main);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* Grid de la Calculadora */
.calculator-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
}

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

/* Form Groups y Tarjetas de Entrada */
.form-group-block {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.block-label {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main);
  display: block;
  margin-bottom: 0.5rem;
}

.block-header .block-label {
  margin-bottom: 0;
}

.weight-total-badge {
  background: var(--primary-glow);
  color: var(--primary-color);
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  border: 1px solid var(--primary-color);
}

.weight-total-badge .unit {
  font-size: 0.8rem;
  opacity: 0.9;
}

/* Sub-inputs de peso */
.weight-inputs-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.sub-input-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
}

.sub-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  font-size: 0.8rem;
}

.sub-card-title {
  color: var(--text-muted);
}

.sub-card-val {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-main);
}

/* Sliders Personalizados */
.custom-slider {
  width: 100%;
  height: 6px;
  background: var(--bg-card-hover);
  border-radius: 4px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  margin: 0.5rem 0 0.25rem;
}

.custom-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary-color);
  border: 2px solid #ffffff;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
  transition: transform 0.1s ease;
}

.custom-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.custom-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary-color);
  border: 2px solid #ffffff;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.slider-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-subtle);
  font-family: var(--font-mono);
  margin-top: 0.35rem;
}

/* Botones de opción en fila / pills */
.options-pills-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

.btn-option-pill {
  background: var(--bg-card);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  padding: 0.65rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.btn-option-pill:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
}

.btn-option-pill.is-active {
  background: var(--primary-glow);
  color: var(--primary-color);
  border-color: var(--primary-color);
}

/* Wrapper de Ruedas */
.wheels-config-wrapper {
  margin-bottom: 1.25rem;
}

.wheel-box {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.wheel-box.is-rear-specific {
  border-left: 3px solid var(--rear-wheel-color);
}

.wheel-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.wheel-box-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.wheel-box-badge {
  font-size: 0.75rem;
  background: var(--bg-card-hover);
  color: var(--text-muted);
  padding: 0.25rem 0.6rem;
  border-radius: 12px;
}

.wheel-box-badge.rear-badge {
  background: var(--rear-wheel-glow);
  color: var(--rear-wheel-color);
}

.field-item {
  margin-bottom: 1.25rem;
}

.field-item:last-child {
  margin-bottom: 0;
}

.field-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}

.field-label {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-muted);
  display: block;
}

.field-value-highlight {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--primary-color);
  font-size: 0.95rem;
}

/* Tarjetas de opción (Sistema de neumático) */
.options-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
  margin-top: 0.4rem;
}

.btn-card-option {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.5rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  min-height: 52px;
}

.btn-card-option:hover {
  background: var(--bg-card-hover);
  border-color: var(--text-subtle);
}

.btn-card-option.is-active {
  background: var(--primary-glow);
  border-color: var(--primary-color);
}

.card-option-icon {
  font-size: 1.15rem;
}

.card-option-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
}

.card-option-desc {
  font-size: 0.7rem;
  color: var(--text-subtle);
  line-height: 1.2;
}

/* Selectores Canónicos */
.custom-select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  background-color: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.65rem 2.5rem 0.65rem 0.85rem;
  font-size: 0.88rem;
  min-height: 42px;
  cursor: pointer;
  outline: none;
  transition: var(--transition);
  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='%2394a3b8' 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;
  background-size: 16px;
  -webkit-appearance: none;
  appearance: none;
}

.custom-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

.custom-select option {
  background-color: var(--bg-card);
  color: var(--text-main);
  padding: 0.5rem;
}

/* Cuadrícula de Terreno */
.terrain-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}

.btn-terrain-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.65rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  min-height: 64px;
}

.btn-terrain-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--text-subtle);
}

.btn-terrain-card.is-active {
  background: var(--primary-glow);
  border-color: var(--primary-color);
}

.terrain-icon {
  font-size: 1.25rem;
  margin-bottom: 0.2rem;
}

.terrain-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
}

.terrain-desc {
  font-size: 0.72rem;
  color: var(--text-subtle);
}

/* ==========================================================================
   Panel de Resultados y Dashboard de Ruedas
   ========================================================================== */
.results-panel {
  position: relative;
}

.results-sticky-card {
  position: sticky;
  top: 1.5rem;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

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

.results-header .panel-section-title {
  margin-bottom: 0;
}

.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  color: var(--primary-color);
  font-weight: 600;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary-color);
  animation: pulse-dot 2s infinite ease-in-out;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

/* Cuadrícula de Tarjetas de Rueda */
.wheels-display-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.wheel-result-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem 1rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.wheel-result-card.is-front-card {
  border-top: 3px solid var(--front-wheel-color);
}

.wheel-result-card.is-rear-card {
  border-top: 3px solid var(--rear-wheel-color);
}

.card-wheel-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--front-wheel-color);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
}

.card-wheel-badge.rear-color {
  color: var(--rear-wheel-color);
}

/* Manómetros Circulares SVG */
.gauge-container {
  position: relative;
  width: 110px;
  height: 110px;
  margin: 0 auto 0.75rem;
}

.pressure-gauge-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.gauge-track {
  fill: none;
  stroke: var(--bg-card-hover);
  stroke-width: 8;
}

.gauge-bar {
  fill: none;
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 314;
  stroke-dashoffset: 120;
  transition: stroke-dashoffset 0.5s ease-out, stroke 0.3s;
}

.gauge-front {
  stroke: var(--front-wheel-color);
  filter: drop-shadow(0 0 6px var(--front-wheel-glow));
}

.gauge-rear {
  stroke: var(--rear-wheel-color);
  filter: drop-shadow(0 0 6px var(--rear-wheel-glow));
}

.gauge-inner-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.gauge-number {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1;
  color: var(--text-main);
}

.gauge-unit {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 2px;
}

.gauge-secondary-val {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

.unit-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.gauge-tolerance {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.gauge-load-info {
  font-size: 0.72rem;
  color: var(--text-subtle);
  padding-top: 0.4rem;
  border-top: 1px dashed var(--border-color);
}

/* Esquema de Bicicleta SVG */
.bike-schematic-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 0.5rem;
  margin-bottom: 1.25rem;
  position: relative;
  display: flex;
  justify-content: center;
}

.bike-svg {
  width: 100%;
  max-width: 280px;
  height: auto;
  color: var(--text-subtle);
}

.bike-wheel-rear {
  stroke: var(--rear-wheel-color);
  stroke-dasharray: 6 3;
}

.bike-wheel-front {
  stroke: var(--front-wheel-color);
  stroke-dasharray: 6 3;
}

.bike-labels-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.bike-wheel-tag {
  position: absolute;
  padding: 0.25rem 0.55rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #ffffff;
  bottom: 12px;
}

.bike-wheel-tag.tag-rear {
  left: 12%;
  background: var(--rear-wheel-color);
}

.bike-wheel-tag.tag-front {
  right: 12%;
  background: var(--front-wheel-color);
}

/* Métricas de Rendimiento */
.performance-metrics-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  margin-bottom: 1.25rem;
}

.metrics-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 0.85rem;
}

.metric-row {
  margin-bottom: 0.75rem;
}

.metric-row:last-child {
  margin-bottom: 0;
}

.metric-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.progress-bar-track {
  width: 100%;
  height: 6px;
  background: var(--bg-card-hover);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}

.fill-grip { background: #10b981; }
.fill-rolling { background: #38bdf8; }
.fill-protection { background: #f59e0b; }

/* Contenedor de Diagnósticos */
.diagnostics-container {
  margin-bottom: 1.25rem;
}

.diag-alert-card {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  line-height: 1.35;
  margin-bottom: 0.5rem;
}

.diag-alert-card.is-warning {
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  color: var(--warning-text);
}

.diag-alert-card.is-tip {
  background: var(--tip-bg);
  border: 1px solid var(--tip-border);
  color: var(--tip-text);
}

.diag-alert-card svg {
  flex-shrink: 0;
  margin-top: 1px;
}

/* Botones de Acción en Dashboard */
.results-actions-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 0.5rem;
}

.btn-action-primary,
.btn-action-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  min-height: 42px;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  padding: 0.5rem 0.75rem;
  text-decoration: none;
  width: 100%;
}

.btn-action-primary {
  background: var(--primary-color);
  color: #ffffff;
}

.btn-action-primary:hover {
  background: var(--primary-light);
  box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-action-secondary {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-action-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--text-subtle);
}

/* ==========================================================================
   Modales Canónicos y Notificaciones Toast
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.2s ease-out;
}

.modal-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  max-width: 520px;
  width: 100%;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.modal-title {
  margin: 0;
  font-size: 1.15rem;
  color: var(--text-main);
}

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

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

.modal-body {
  padding: 1.5rem;
  color: var(--text-main);
  font-size: 0.92rem;
  max-height: 70vh;
  overflow-y: auto;
}

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

.trail-guide-list {
  padding-left: 1.25rem;
  margin: 0;
  line-height: 1.6;
}

.trail-guide-list li {
  margin-bottom: 0.85rem;
}

.trail-guide-list li:last-child {
  margin-bottom: 0;
}

/* Ficha de ruta formateada */
.route-setup-sheet {
  background: var(--bg-card-subtle);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.6;
}

.sheet-header-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--primary-color);
}

/* Toast flotante */
.toast-notification {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: #10b981;
  color: #ffffff;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  font-weight: 600;
  z-index: 10000;
  animation: slideInToast 0.3s ease-out;
}

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(30px) scale(0.97); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

/* ==========================================================================
   Adaptación Responsiva Móvil y Tablets
   ========================================================================== */
@media (max-width: 980px) {
  .calculator-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .results-sticky-card {
    position: static;
  }

  .pressure-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .preset-chips-group {
    justify-content: flex-start;
  }

  .toolbar-right-controls {
    justify-content: space-between;
  }
}

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

  .card-main {
    padding: 1.1rem;
  }

  .weight-inputs-grid {
    grid-template-columns: 1fr;
  }

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

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

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

  .wheels-display-grid {
    grid-template-columns: 1fr;
  }

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

  .toast-notification {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    justify-content: center;
  }
}

/* ==========================================================================
   Estilos de Impresión A4 (.print-sheet)
   ========================================================================== */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }

  .app-header,
  .tools-ad-banner-section,
  .tool-ad-sidebar,
  .fijate-footer,
  .pressure-toolbar,
  .input-panel,
  .results-actions-grid,
  .seo-guide-section {
    display: none !important;
  }

  .tool-layout {
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .card-main {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
  }

  .results-sticky-card {
    border: 1px solid #000000 !important;
  }
}
