/* ═══════════════════════════════════════════════════════════════════════════
   MADE — Identidad de El Portón
   Colores Corporativos:
   - Fondo Base: #F2F2F2 (Light premium contrastado)
   - Énfasis Primario: #F21905 (Rojo El Portón)
   - Énfasis Secundario / Hover: #A61414 (Rojo Oscuro)
   - Profundidad: #011126 (Navy azulado) / #0D0D0D (Charcoal oscuro)
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --made-primary: #F21905;
  --made-primary-hover: #A61414;
  --made-dark: #011126;
  --made-charcoal: #0D0D0D;
  --made-light-bg: #F2F2F2;
  --made-surface: #ffffff;
  --made-border: #e2e8f0;
  --made-text: #0D0D0D;
  --made-text-secondary: #475569;
  --made-text-muted: #94a3b8;
  --made-success: #10b981;
  --made-warning: #f59e0b;
  --made-error: #ef4444;
  --made-shadow: 0 10px 30px rgba(1, 17, 38, 0.05);
  --made-radius: 12px;
  --made-radius-sm: 8px;
  --made-transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --made-font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ── Contenedores de Vista ──────────────────────────────────────────────── */
.made-container {
  font-family: var(--made-font);
  max-width: 900px;
  margin: 1.5rem auto;
  padding: 0 1rem;
  color: var(--made-text);
  background-color: var(--made-light-bg);
  border-radius: var(--made-radius);
}

.made-card {
  background: var(--made-surface);
  border: 1px solid var(--made-border);
  border-radius: var(--made-radius);
  padding: 2rem;
  box-shadow: var(--made-shadow);
  transition: var(--made-transition);
}

.made-card:hover {
  border-color: rgba(242, 25, 5, 0.2);
}

/* ── Tipografía Premium ──────────────────────────────────────────────────── */
.made-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--made-dark);
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.made-subtitle {
  font-size: 0.95rem;
  color: var(--made-text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.made-section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--made-dark);
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ── Inputs y Controles de Formulario ────────────────────────────────────── */
.made-form-group {
  margin-bottom: 1rem;
}

.made-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--made-text-secondary);
  margin-bottom: 0.35rem;
}

.made-input,
.made-select,
.made-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--made-radius-sm);
  color: var(--made-text);
  font-size: 0.9rem;
  transition: var(--made-transition);
  outline: none;
  box-sizing: border-box;
}

.made-input:focus,
.made-select:focus,
.made-textarea:focus {
  border-color: var(--made-primary);
  box-shadow: 0 0 0 3px rgba(242, 25, 5, 0.12);
}

.made-textarea {
  resize: vertical;
  min-height: 70px;
}

/* ── Botones y Alternadores ─────────────────────────────────────────────── */
.made-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--made-radius-sm);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--made-transition);
  outline: none;
  text-decoration: none;
  line-height: 1.3;
}

.made-btn-primary {
  background: var(--made-primary);
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(242, 25, 5, 0.25);
}

.made-btn-primary:hover {
  background: var(--made-primary-hover);
  transform: translateY(-1px);
}

.made-btn-secondary {
  background: var(--made-surface);
  color: var(--made-dark);
  border: 1px solid var(--made-border);
}

.made-btn-secondary:hover {
  border-color: var(--made-primary);
  background: var(--made-light-bg);
}

.made-btn-success {
  background: var(--made-success);
  color: #fff;
}

.made-btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
}

.made-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* ── Estructura de Filas de Items ────────────────────────────────────────── */
.made-item-row {
  background: #fdfdfd;
  border: 1px solid var(--made-border);
  border-radius: var(--made-radius-sm);
  padding: 1rem;
  margin-bottom: 0.75rem;
  position: relative;
}

.made-item-row .made-remove-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: rgba(239, 68, 68, 0.1);
  color: var(--made-error);
  border: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

/* ── Tarjeta de Desglose de Calculadora Simplificada ───────────────────────── */
.made-result-card {
  background: var(--made-surface);
  border: 2px solid var(--made-border);
  border-radius: var(--made-radius);
  padding: 1.5rem;
  margin-top: 1.5rem;
  box-shadow: var(--made-shadow);
}

.made-result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 0;
  border-bottom: 1px solid #f1f5f9;
}

.made-result-row:last-child {
  border-bottom: none;
  padding-top: 1rem;
  margin-top: 0.5rem;
  border-top: 2px dashed var(--made-primary);
}

.made-result-label {
  color: var(--made-text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.made-result-value {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--made-charcoal);
}

.made-result-row:last-child .made-result-value {
  font-size: 1.4rem;
  color: var(--made-primary);
}

/* ── Tooltips Interactivos de Ayuda ────────────────────────────────────────── */
.made-help-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  background: #e2e8f0;
  color: var(--made-text-secondary);
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: bold;
  cursor: help;
  transition: var(--made-transition);
}

.made-help-trigger:hover {
  background: var(--made-primary);
  color: #fff;
}

.made-help-tooltip {
  background: var(--made-dark);
  color: #fff;
  font-size: 0.78rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--made-radius-sm);
  margin-top: 0.5rem;
  line-height: 1.4;
  border-left: 3px solid var(--made-primary);
}

/* ── Badges Dinámicos de Líneas de Tiempo ────────────────────────────────── */
.made-badge {
  padding: 0.25rem 0.6rem;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 700;
}

.made-badge-interes { background: #fee2e2; color: var(--made-primary); }
.made-badge-cotizado { background: #fef3c7; color: var(--made-warning); }
.made-badge-comprado { background: #d1fae5; color: var(--made-success); }
.made-badge-transito { background: #e0f2fe; color: #0284c7; }
.made-badge-bodega { background: #f3e8ff; color: #7c3aed; }
.made-badge-porton { background: #d1fae5; color: var(--made-success); border: 1px solid var(--made-success); }

/* ── Widget de Chat Flotante ────────────────────────────────────────────── */
.made-chat-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--made-primary);
  color: #ffffff;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(242, 25, 5, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  z-index: 9999;
  transition: var(--made-transition);
}

.made-chat-toggle:hover {
  background: var(--made-primary-hover);
  transform: scale(1.05);
}

.made-chat-window {
  position: fixed;
  bottom: 90px;
  right: 24px;
  width: 360px;
  height: 480px;
  background: #ffffff;
  border: 1px solid var(--made-border);
  border-radius: var(--made-radius);
  box-shadow: 0 10px 40px rgba(1, 17, 38, 0.12);
  display: flex;
  flex-direction: column;
  z-index: 9998;
  overflow: hidden;
}

.made-chat-header {
  background: var(--made-dark);
  padding: 0.85rem 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  border-bottom: 2px solid var(--made-primary);
}

.made-chat-header-info h4 {
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  margin: 0;
}

.made-chat-header-info span {
  color: var(--made-text-muted);
  font-size: 0.72rem;
}

.made-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  background: var(--made-light-bg);
}

.made-chat-bubble {
  max-width: 80%;
  padding: 0.65rem 0.85rem;
  border-radius: var(--made-radius-sm);
  font-size: 0.85rem;
  line-height: 1.45;
}

.made-chat-bubble.user {
  align-self: flex-end;
  background: var(--made-primary);
  color: #ffffff;
  border-bottom-right-radius: 2px;
}

.made-chat-bubble.bot {
  align-self: flex-start;
  background: #ffffff;
  color: var(--made-charcoal);
  border: 1px solid var(--made-border);
  border-bottom-left-radius: 2px;
}

.made-chat-input-area {
  padding: 0.6rem;
  background: #ffffff;
  border-top: 1px solid var(--made-border);
  display: flex;
  gap: 0.4rem;
}

.made-chat-input-area input {
  flex: 1;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--made-border);
  border-radius: var(--made-radius-sm);
  outline: none;
}

.made-chat-send {
  width: 36px;
  height: 36px;
  border-radius: var(--made-radius-sm);
  background: var(--made-primary);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Estilos de los Nuevos Módulos ────────────────────────────────────────── */
.made-compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 1rem;
}

.made-compare-box {
  background: #ffffff;
  border: 1px solid var(--made-border);
  border-radius: var(--made-radius-sm);
  padding: 1rem;
}

.made-pc-build-step {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  background: #ffffff;
  border: 1px solid var(--made-border);
  border-radius: var(--made-radius-sm);
  margin-bottom: 0.5rem;
}

@media (max-width: 640px) {
  .made-compare-grid {
    grid-template-columns: 1fr;
  }
}
