/* ================================
   RESET BÁSICO
=================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

/* ================================
   PALETA DE COLORES
=================================== */

:root {
  --verde-oscuro: #213832;
  --dorado: #f2c38f;
  --fondo: #f5f2eb;
  --texto: #213832;
  --texto-suave: #4b5563;
  --borde-suave: #e5e7eb;
  --error: #b3261e;
  --ok: #2f7d32;
}

/* ================================
   TIPOGRAFÍA / CUERPO
=================================== */

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: var(--fondo);
  color: var(--texto);
  line-height: 1.5;
}

h1,
h2,
h3 {
  margin-top: 0;
  color: var(--verde-oscuro);
}

p {
  margin-top: 0;
}

a {
  color: var(--verde-oscuro);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ================================
   HERO / CABECERA
=================================== */

.hero {
  background: var(--verde-oscuro);
  color: var(--dorado);
  padding: 2.5rem 1.25rem;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.4);
}

.hero-inner {
  max-width: 960px;
  margin: 0 auto;
  text-align: center;
}

.hero-title {
  font-size: 1.9rem;
  margin-bottom: 0.5rem;
  color: var(--dorado);
  letter-spacing: 0.03em;
}

.hero-subtitle {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--dorado);
}

.hero-descripcion {
  max-width: 650px;
  margin: 0.5rem auto 0;
  font-size: 0.95rem;
  opacity: 0.95;
  color: var(--dorado);
}

/* ================================
   LAYOUT PRINCIPAL
=================================== */

.layout-principal {
  max-width: 960px;
  margin: 1.5rem auto 2.5rem;
  padding: 0 1.25rem;
}

.cogs-calculator {
  position: relative;
}

.steps-indicator {
  font-size: 0.9rem;
  color: var(--texto-suave);
  margin-bottom: 0.75rem;
}

/* ================================
   TARJETAS / SECCIONES
=================================== */

.card {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
  padding: 1.5rem 1.5rem 1.75rem;
  margin-bottom: 1.5rem;
}

.step-card {
  display: none;
}

.step-card.step-active {
  display: block;
}

.texto-intro {
  font-size: 0.95rem;
  color: var(--texto-suave);
  margin-bottom: 1.25rem;
}

/* ================================
   GRID FORMULARIO
=================================== */

.grid-dos-columnas {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem 1.5rem;
}

@media (max-width: 720px) {
  .grid-dos-columnas {
    grid-template-columns: 1fr;
  }
}

/* ================================
   CAMPOS / FORM
=================================== */

.campo {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.campo label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--texto);
}

.campo input[type="text"],
.campo input[type="number"],
.campo select,
.campo textarea {
  border-radius: 8px;
  border: 1px solid var(--borde-suave);
  padding: 0.55rem 0.75rem;
  font-size: 0.9rem;
  outline: none;
  background: #f9fafb;
  color: var(--texto);
  transition: border-color 0.15s ease, box-shadow 0.15s ease,
    background-color 0.15s ease;
}

.campo input[type="text"]::placeholder,
.campo input[type="number"]::placeholder {
  color: #9ca3af;
}

.campo input[type="text"]:focus,
.campo input[type="number"]:focus,
.campo select:focus,
.campo textarea:focus {
  border-color: var(--verde-oscuro);
  box-shadow: 0 0 0 2px rgba(33, 56, 50, 0.18);
  background: #ffffff;
}

.campo-peso-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.campo-peso-wrapper input {
  flex: 1;
}

.campo-peso-wrapper span {
  font-size: 0.9rem;
  color: var(--texto-suave);
}

/* Nota pequeña debajo de campos */
.nota-pequena {
  font-size: 0.8rem;
  color: #6b7280;
}

/* ================================
   CONTENEDORES DE ACCIONES
=================================== */

.acciones-paso {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}

.acciones-paso--derecha {
  justify-content: flex-end;
}

/* ================================
   TABLAS
=================================== */

.tabla-ingredientes-wrapper {
  width: 100%;
  margin-top: 0.5rem;
  display: flex;
  justify-content: center;
  overflow-x: auto;
}

.tabla-ingredientes {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  border-collapse: collapse;
  font-size: 0.9rem;
  min-width: 640px;
}

.tabla-ingredientes thead {
  background: #f3f4f6;
}

.tabla-ingredientes th,
.tabla-ingredientes td {
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  vertical-align: middle;
}

.tabla-ingredientes th {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--texto);
}

.tabla-ingredientes tbody tr:nth-child(even) {
  background: #f9fafb;
}

.tabla-ingredientes input[type="number"],
.tabla-ingredientes select {
  width: 100%;
  font-size: 0.85rem;
}

/* Tabla de resumen */
.tabla-resumen th,
.tabla-resumen td {
  white-space: nowrap;
}

.detalle-ingredientes {
  margin-top: 1rem;
}

/* ================================
   BOTONES
=================================== */

.btn-principal,
.btn-secundario,
.btn-imprimir {
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.6rem 1.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.15s,
    color 0.15s, filter 0.1s;
}

/* Botón principal con la misma paleta que el banner */
.btn-principal {
  background: var(--verde-oscuro);
  color: var(--dorado);
  box-shadow: 0 8px 16px rgba(33, 56, 50, 0.35);
}

.btn-principal:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(33, 56, 50, 0.4);
}

.btn-principal:active {
  transform: translateY(0);
  box-shadow: 0 4px 10px rgba(33, 56, 50, 0.3);
}

/* Botón secundario en blanco con borde suave */
.btn-secundario {
  background: #ffffff;
  color: var(--texto);
  border: 1px solid #d1d5db;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}

.btn-secundario:hover {
  background: #f9fafb;
}

/* Botón de imprimir con borde verde oscuro */
.btn-imprimir {
  background: #ffffff;
  color: var(--verde-oscuro);
  border: 1px dashed var(--verde-oscuro);
}

.btn-imprimir:hover {
  background: #f9fafb;
}

/* Deshabilitado */
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

/* ================================
   RESUMEN / MENSAJES
=================================== */

.resumen-porcentaje {
  margin-bottom: 1rem;
}

.mensaje-porcentaje {
  font-size: 0.9rem;
  padding: 0.7rem 0.8rem;
  border-radius: 10px;
  background: #fefce8;
  color: #854d0e;
  border: 1px solid #facc15;
}

.mensaje-porcentaje.ok {
  background: #ecfdf3;
  color: #166534;
  border-color: #22c55e;
}

/* Bloques adicionales de información */
.resumen-costos-adicionales {
  font-size: 0.9rem;
  margin-top: 1rem;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  background: #fafafa;
  border: 1px dashed #d4d4d8;
}

/* Resumen imprimible de texto */
.print-summary {
  margin-top: 1.25rem;
}

.summary-content {
  font-size: 0.9rem;
  background: #ffffff;
  border-radius: 10px;
  padding: 0.9rem 1rem;
  border: 1px solid #e5e7eb;
}

/* Advertencias */
#advertenciasResumen ul {
  margin: 0.4rem 0 0;
  padding-left: 1.15rem;
}

#advertenciasResumen li {
  font-size: 0.85rem;
  margin-bottom: 0.2rem;
}

/* ================================
   ESTADOS DE ERROR
=================================== */

.input-error {
  border-color: var(--error) !important;
  box-shadow: 0 0 0 2px rgba(179, 38, 30, 0.18) !important;
}

/* ================================
   RESPONSIVE / VARIOS
=================================== */

@media (max-width: 600px) {
  .card {
    padding: 1.2rem 1rem 1.4rem;
  }

  .acciones-paso {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-principal,
  .btn-secundario,
  .btn-imprimir {
    width: 100%;
    justify-content: center;
  }

  .hero-title {
    font-size: 1.5rem;
  }

  .hero-descripcion {
    font-size: 0.9rem;
  }
}

/* ================================
   IMPRESIÓN
=================================== */

@media print {
  body {
    background: #ffffff;
  }

  .no-print {
    display: none !important;
  }

  .card {
    box-shadow: none;
    border-radius: 0;
  }

  .layout-principal {
    margin: 0;
    max-width: 100%;
    padding: 0;
  }
}
/* ================================
   AJUSTES EXTRA PARA MÓVIL PEQUEÑO (iPhone / < 480px)
=================================== */

@media (max-width: 480px) {
  /* Un poco más de espacio lateral */
  .layout-principal {
    padding: 0 0.75rem;
    margin-bottom: 1.5rem;
  }

  /* Tarjetas un poco más compactas pero legibles */
  .card {
    padding: 1rem 0.85rem 1.2rem;
  }

  /* Títulos y textos ligeramente más compactos */
  h2 {
    font-size: 1.05rem;
  }

  .texto-intro {
    font-size: 0.9rem;
  }

  .nota-pequena {
    font-size: 0.78rem;
  }

  /* Formularios: inputs ocupan todo el ancho sin sentirse apretados */
  .campo input[type="text"],
  .campo input[type="number"],
  .campo select {
    font-size: 0.9rem;
    padding: 0.5rem 0.65rem;
  }

  /* Tabla de selección de insumos más amigable en ancho reducido */
  .tabla-ingredientes {
    min-width: 100%; /* Quitamos el mínimo ancho grande en móvil */
    font-size: 0.8rem;
  }

  .tabla-ingredientes th,
  .tabla-ingredientes td {
    padding: 0.4rem 0.45rem;
  }

  /* Tabla de resumen un poquito más compacta también */
  .tabla-resumen {
    font-size: 0.8rem;
  }

  /* Botones grandes y fáciles de tocar */
  .btn-principal,
  .btn-secundario,
  .btn-imprimir {
    width: 100%;
    font-size: 0.9rem;
    padding: 0.7rem 1rem;
  }

  /* Hero un poco más compacto en móvil */
  .hero {
    padding: 1.7rem 1rem;
  }

  .hero-title {
    font-size: 1.4rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .hero-descripcion {
    font-size: 0.85rem;
  }
}
