:root {
  --calc-primary: #0f4c81;
  --calc-primary-hover: #0a3356;
  --calc-accent: #00875a;
  --calc-bg-light: #f8fafc;
  --calc-border: #e2e8f0;
  --calc-text: #1e293b;
  --calc-text-muted: #64748b;
  --calc-danger: #d93025;
  --calc-radius: 8px;
  --calc-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.enlatam-calc-container {
  max-width: 820px;
  margin: 2rem auto;
  padding: 1.5rem;
  background: #ffffff;
  border-radius: var(--calc-radius);
  border: 1px solid var(--calc-border);
  box-shadow: var(--calc-shadow);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--calc-text);
  box-sizing: border-box;
}

.calc-header {
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--calc-border);
  padding-bottom: 1rem;
}

.calc-header h2 {
  font-size: 1.5rem;
  margin: 0 0 0.5rem 0;
  color: var(--calc-primary);
}

.calc-subtitle {
  font-size: 0.95rem;
  color: var(--calc-text-muted);
  margin: 0;
}

/* Grid de formulario */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.form-group .req {
  color: var(--calc-danger);
}

.form-group input,
.form-group select {
  height: 42px;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--calc-border);
  border-radius: 6px;
  font-size: 0.95rem;
  background-color: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--calc-primary);
  box-shadow: 0 0 0 3px rgba(15, 76, 129, 0.15);
}

.input-prefix {
  display: flex;
  align-items: center;
  border: 1px solid var(--calc-border);
  border-radius: 6px;
  background-color: #f1f5f9;
}

.input-prefix span {
  padding: 0 0.75rem;
  font-weight: bold;
  color: var(--calc-text-muted);
}

.input-prefix input {
  border: none;
  width: 100%;
  border-radius: 0 6px 6px 0;
}

.help-text {
  font-size: 0.75rem;
  color: var(--calc-text-muted);
  margin-top: 0.25rem;
}

.error-msg {
  font-size: 0.75rem;
  color: var(--calc-danger);
  margin-top: 0.25rem;
  min-height: 1rem;
}

/* Botones */
.form-actions {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.btn-primary, .btn-secondary {
  height: 44px;
  padding: 0 1.5rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s ease;
  border: none;
}

.btn-primary {
  background-color: var(--calc-primary);
  color: #fff;
  flex: 2;
}

.btn-primary:hover {
  background-color: var(--calc-primary-hover);
}

.btn-secondary {
  background-color: #f1f5f9;
  color: var(--calc-text);
  border: 1px solid var(--calc-border);
  flex: 1;
}

.btn-secondary:hover {
  background-color: #e2e8f0;
}

/* Espacio publicitario protegido contra CLS */
.calc-ad-slot-wrapper {
  min-height: 100px;
  background-color: var(--calc-bg-light);
  border: 1px dashed var(--calc-border);
  margin: 1.5rem 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}

.ad-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--calc-text-muted);
}

/* Panel de Resultados */
.calc-results {
  margin-top: 1.5rem;
  border-top: 2px solid var(--calc-border);
  padding-top: 1.5rem;
}

.results-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.results-header h3 {
  margin: 0;
  font-size: 1.25rem;
}

.total-badge {
  background: var(--calc-bg-light);
  border: 2px solid var(--calc-accent);
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  text-align: right;
}

.badge-label {
  display: block;
  font-size: 0.8rem;
  color: var(--calc-text-muted);
}

.badge-amount {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--calc-accent);
}

/* Grid de métricas secundarias */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.metric-card {
  background: var(--calc-bg-light);
  padding: 0.75rem 1rem;
  border-radius: 6px;
  border: 1px solid var(--calc-border);
}

.metric-title {
  display: block;
  font-size: 0.75rem;
  color: var(--calc-text-muted);
  text-transform: uppercase;
  font-weight: 600;
}

.metric-val {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--calc-text);
}

/* Tablas */
.table-section {
  margin-bottom: 1.5rem;
}

.table-section h4 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  color: var(--calc-primary);
}

.calc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.calc-table th, .calc-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--calc-border);
  text-align: left;
}

.calc-table th:last-child, .calc-table td:last-child {
  text-align: right;
}

.calc-table tfoot th {
  border-top: 2px solid var(--calc-border);
  font-size: 0.95rem;
}

.calc-disclaimer {
  margin-top: 1rem;
  padding: 0.75rem;
  background-color: #fffbeb;
  border-left: 4px solid #f59e0b;
  border-radius: 4px;
  font-size: 0.8rem;
  color: #92400e;
}
/* ==========================================================================
   Contenedores Publicitarios Blindados (Zero CLS)
   ========================================================================== */
.enlatam-ad-wrapper {
  margin: 1.75rem auto;
  text-align: center;
  background-color: #f8fafc;
  border: 1px solid #edf2f7;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* Etiqueta obligatoria para cumplir políticas de Google/AdSense */
.enlatam-ad-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
  margin-top: 4px;
  display: block;
}

/* Slot 1: Desktop (728x90 Leaderboard o 336x280 Rectángulo Grande) */
.enlatam-ad-slot-1 {
  width: 100%;
  max-width: 728px;
  min-height: 90px;
}

/* Adaptación para móviles (300x250 Medium Rectangle o 320x100) */
@media (max-width: 768px) {
  .enlatam-ad-slot-1 {
    max-width: 336px;
    min-height: 280px;
  }
}