/* ===========================================
   CONFIGURADOR HAGEL — Estilos
   =========================================== */

:root {
  --gris-marca: #585857;
  --gris-medio: #6e6e6d;
  --gris-hover: #4a4a49;
  --naranja: #FF5F00;
  --naranja-claro: #FF8533;
  --verde-whatsapp: #25d366;
  --gris-fondo: #f5f5f5;
  --gris-texto: #585857;
  --gris-claro: #c1c6c8;
  --blanco: #ffffff;
  --sombra: 0 2px 12px rgba(0,0,0,0.08);
  --radio: 0px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Gotham', 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--gris-fondo);
  color: var(--gris-texto);
  line-height: 1.6;
}

/* --- NAV --- */
nav {
  background: #585857;
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: white;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 4px;
}

.nav-back {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}
.nav-back:hover { color: white; }

/* --- CONFIGURADOR LAYOUT --- */
.configurador {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* --- BARRA DE PROGRESO --- */
.progreso {
  margin-bottom: 2rem;
}

.progreso-bar {
  height: 6px;
  background: var(--gris-claro);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.progreso-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--naranja), var(--naranja-claro));
  border-radius: 3px;
  transition: width 0.4s ease;
  width: 0%;
}

.progreso-pasos {
  display: flex;
  justify-content: space-between;
}

.paso-label {
  font-size: 0.8rem;
  color: #a0aec0;
  font-weight: 500;
  transition: color 0.3s;
}
.paso-label.activo {
  color: var(--naranja);
  font-weight: 700;
}
.paso-label.completado {
  color: var(--naranja);
}

/* --- LAYOUT PRINCIPAL --- */
.contenido {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

/* --- PREVIEW --- */
.preview-panel {
  position: sticky;
  top: 5rem;
}

.preview-3d {
  background: #e8ecf1;
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  aspect-ratio: 4/3;
  overflow: hidden;
  position: relative;
}

#canvas3d {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: var(--radio);
}

.precio-flotante {
  background: var(--gris-marca);
  color: white;
  border-radius: var(--radio);
  padding: 1rem 1.5rem;
  margin-top: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--sombra);
}

.precio-label {
  font-size: 0.9rem;
  opacity: 0.8;
}

.precio-valor {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--naranja-claro);
}

/* --- PANEL DE OPCIONES --- */
.opciones-panel {
  background: white;
  border-radius: var(--radio);
  padding: 2rem;
  box-shadow: var(--sombra);
}

.paso h2 {
  font-size: 1.4rem;
  color: var(--gris-marca);
  margin-bottom: 0.25rem;
}

.paso-desc {
  font-size: 0.9rem;
  color: #718096;
  margin-bottom: 1.5rem;
}

.oculto { display: none !important; }

/* --- CAMPOS --- */
.campo {
  margin-bottom: 1.25rem;
}

.campo label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--gris-marca);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.campo input[type="text"],
.campo input[type="tel"] {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--gris-claro);
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.2s;
  outline: none;
}
.campo input[type="text"]:focus,
.campo input[type="tel"]:focus {
  border-color: var(--naranja);
}

/* --- SLIDER --- */
.rango-grupo {
  display: flex;
  align-items: center;
  gap: 1rem;
}

input[type="range"] {
  flex: 1;
  -webkit-appearance: none;
  height: 6px;
  background: var(--gris-claro);
  border-radius: 3px;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  background: var(--naranja);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(230,126,34,0.4);
  transition: transform 0.15s;
}
input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.rango-valor {
  font-weight: 700;
  font-size: 1rem;
  color: var(--gris-marca);
  min-width: 4rem;
  text-align: right;
}

.medidas-resumen {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.medida-chip {
  background: var(--gris-fondo);
  border: 1px solid var(--gris-claro);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
}

.medida-chip.medida-total {
  background: var(--gris-marca);
  color: var(--blanco);
  border-color: var(--gris-marca);
  font-weight: 600;
}

/* --- CARDS DE OPCIONES --- */
.opciones-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.opcion-card {
  cursor: pointer;
}

.opcion-card input { display: none; }

.card-contenido {
  border: 2px solid var(--gris-claro);
  border-radius: var(--radio);
  padding: 1.25rem 1rem;
  text-align: center;
  transition: all 0.2s;
  position: relative;
}

.card-contenido:hover {
  border-color: var(--naranja);
  background: #fff5ee;
}

.opcion-card input:checked + .card-contenido {
  border-color: var(--naranja);
  background: #fff8f0;
  box-shadow: 0 0 0 1px var(--naranja);
}

.card-icono {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.card-contenido h3 {
  font-size: 0.95rem;
  color: var(--gris-marca);
  margin-bottom: 0.25rem;
}

.card-contenido p {
  font-size: 0.8rem;
  color: #718096;
}

.badge-costo {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--naranja);
  color: white;
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
  text-transform: uppercase;
}

/* --- COLORES --- */
.colores-grid {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.color-opcion {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}
.color-opcion input { display: none; }

.color-muestra {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: block;
  transition: transform 0.2s, box-shadow 0.2s;
}

.color-opcion input:checked + .color-muestra {
  transform: scale(1.15);
  box-shadow: 0 0 0 3px var(--naranja);
}

.color-nombre {
  font-size: 0.75rem;
  font-weight: 500;
}

/* --- EXTRAS (Toggle switches) --- */
.extras-lista {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.extra-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--gris-fondo);
  border: 1px solid var(--gris-claro);
  border-radius: var(--radio);
  padding: 1.25rem;
  cursor: pointer;
  transition: border-color 0.2s;
}
.extra-item:hover { border-color: var(--naranja); }

.extra-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.extra-icono {
  font-size: 1.5rem;
}

.extra-info h3 {
  font-size: 0.95rem;
  color: var(--gris-marca);
}
.extra-info p {
  font-size: 0.8rem;
  color: #718096;
}

/* Toggle switch */
.toggle {
  position: relative;
  width: 50px;
  height: 28px;
  flex-shrink: 0;
}
.toggle input { display: none; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: #cbd5e0;
  border-radius: 14px;
  transition: background 0.3s;
  cursor: pointer;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  background: white;
  border-radius: 50%;
  top: 3px;
  left: 3px;
  transition: transform 0.3s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle input:checked + .toggle-slider {
  background: var(--naranja);
}
.toggle input:checked + .toggle-slider::before {
  transform: translateX(22px);
}

/* --- BOTONES --- */
.nav-pasos {
  display: flex;
  justify-content: space-between;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--gris-claro);
}

.btn {
  padding: 0.75rem 2rem;
  border: none;
  border-radius: 0px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primario {
  background: var(--naranja);
  color: white;
}
.btn-primario:hover {
  background: #D94F00;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(230,126,34,0.3);
}

.btn-secundario {
  background: transparent;
  color: var(--gris-texto);
  border: 2px solid var(--gris-claro);
}
.btn-secundario:hover {
  border-color: var(--naranja);
  color: var(--naranja);
}

.btn-whatsapp {
  width: 100%;
  padding: 0.9rem;
  background: var(--verde-whatsapp);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s;
  margin-top: 0.5rem;
}
.btn-whatsapp:hover {
  background: #1da851;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37,211,102,0.3);
}

/* --- RESUMEN FINAL --- */
.resumen {
  max-width: 1100px;
}

.resumen h2 {
  font-size: 1.6rem;
  color: var(--gris-marca);
  margin-bottom: 1.5rem;
}

.resumen-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

.resumen-detalle {
  background: white;
  border-radius: var(--radio);
  padding: 1.5rem;
  box-shadow: var(--sombra);
}

.resumen-seccion {
  margin-bottom: 1.25rem;
}
.resumen-seccion:last-child { margin-bottom: 0; }

.resumen-seccion h3 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--naranja);
  margin-bottom: 0.5rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid #fef0db;
}

.resumen-linea {
  display: flex;
  justify-content: space-between;
  padding: 0.4rem 0;
  font-size: 0.9rem;
}
.resumen-linea span { color: #718096; }
.resumen-linea strong { color: var(--gris-marca); }

.resumen-precio-panel {
  position: sticky;
  top: 5rem;
}

.resumen-precio-card {
  background: var(--gris-marca);
  color: white;
  border-radius: var(--radio);
  padding: 2rem;
  text-align: center;
  margin-bottom: 1.5rem;
}

.resumen-precio-label {
  display: block;
  font-size: 0.85rem;
  opacity: 0.7;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.resumen-precio-total {
  display: block;
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--naranja-claro);
  margin-bottom: 0.5rem;
}

.resumen-precio-nota {
  font-size: 0.75rem;
  opacity: 0.6;
  line-height: 1.5;
}

.resumen-contacto {
  background: white;
  border-radius: var(--radio);
  padding: 1.5rem;
  box-shadow: var(--sombra);
}

.resumen-contacto h3 {
  font-size: 1rem;
  color: var(--gris-marca);
  margin-bottom: 1rem;
}

/* --- ABERTURAS CATALOG (Step 5) --- */
.linea-toggle {
  display: flex;
  gap: 0;
  border-radius: 0px;
  overflow: hidden;
  border: 2px solid var(--gris-claro);
}

.linea-btn {
  flex: 1;
  padding: 0.6rem 1rem;
  border: none;
  background: var(--gris-fondo);
  color: var(--gris-texto);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.linea-btn.activa {
  background: var(--naranja);
  color: white;
}

.aberturas-catalogo {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.abertura-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--gris-fondo);
  border: 1px solid var(--gris-claro);
  border-radius: 0px;
  transition: border-color 0.2s;
}

.abertura-card:hover {
  border-color: var(--naranja);
}

.abertura-icono {
  font-size: 1.3rem;
  width: 2rem;
  text-align: center;
  flex-shrink: 0;
}

.abertura-info {
  flex: 1;
  min-width: 0;
}

.abertura-info h4 {
  font-size: 0.85rem;
  color: var(--gris-marca);
  margin-bottom: 0.1rem;
}

.abertura-medida {
  font-size: 0.72rem;
  color: #718096;
  display: block;
}

.abertura-precio {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--naranja);
}

.btn-agregar {
  padding: 0.4rem 0.8rem;
  background: var(--naranja);
  color: white;
  border: none;
  border-radius: 0px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.2s;
}

.btn-agregar:hover {
  background: var(--azul-medio);
}

.aberturas-colocadas {
  margin-top: 1rem;
}

.aberturas-colocadas h3 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--naranja);
  margin-bottom: 0.5rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid #fef0db;
}

.lista-colocadas {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
  max-height: 200px;
  overflow-y: auto;
}

.sin-aberturas {
  font-size: 0.82rem;
  color: #a0aec0;
  font-style: italic;
  padding: 0.5rem 0;
}

.colocada-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  background: white;
  border: 1px solid var(--gris-claro);
  border-radius: 0px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.colocada-item:hover {
  border-color: var(--naranja);
  background: #fff5ee;
}

.colocada-item.seleccionada {
  border-color: var(--naranja);
  background: #fff8f0;
}

.colocada-item-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.colocada-item-nombre {
  font-weight: 600;
  color: var(--gris-marca);
}

.colocada-item-pared {
  font-size: 0.72rem;
  color: #718096;
}

.colocada-item-precio {
  font-weight: 600;
  color: var(--naranja);
  font-size: 0.8rem;
}

.btn-eliminar {
  background: none;
  border: none;
  color: #e74c3c;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  transition: background 0.2s;
  line-height: 1;
}

.btn-eliminar:hover {
  background: #fde8e8;
}

.aberturas-subtotal {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-top: 1px solid var(--gris-claro);
  font-size: 0.9rem;
}

.aberturas-subtotal strong {
  color: var(--naranja);
  font-size: 1rem;
}

.modo-colocacion {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: #fff8f0;
  border: 2px solid var(--naranja);
  border-radius: 8px;
  text-align: center;
  animation: pulsar 1.5s ease-in-out infinite;
}

.modo-colocacion p {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--naranja);
  margin-bottom: 0.5rem;
}

.btn-sm {
  padding: 0.35rem 0.8rem !important;
  font-size: 0.8rem !important;
}

@keyframes pulsar {
  0%, 100% { border-color: var(--naranja); }
  50% { border-color: var(--naranja-claro); }
}

/* 3D canvas cursor when in placement mode */
.canvas-colocacion {
  cursor: crosshair !important;
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
  .configurador {
    padding: 1rem;
  }

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

  .preview-panel {
    position: relative;
    top: auto;
  }

  .preview-3d {
    aspect-ratio: 16/9;
  }

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

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

  .resumen-precio-panel {
    position: relative;
    top: auto;
  }

  .progreso-pasos {
    gap: 0.25rem;
  }

  .paso-label {
    font-size: 0.7rem;
  }

  .precio-valor {
    font-size: 1.2rem;
  }
}
