* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Poppins', sans-serif;
}

/* GRID */
.grid-productos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 24px;
}


/* CARD - VERSIÓN MEJORADA */
.producto.card {
  background: #fff;
  border-radius: 16px;
  padding: 18px;

  display: flex;
  flex-direction: column;
  align-items: center;

  min-height: 320px; /* Aumenté un poco para más espacio */
  box-shadow: 0 8px 24px rgba(0,0,0,.08);
}

/* 📦 CONTENEDOR FIJO DE IMAGEN */
.img-box {
  height: 110px;             /* Altura fija para todas las imágenes */
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;       /* Un poco más de espacio */
}

/* IMAGEN */
.img-box img {
  max-height: 100%;
  max-width: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* TÍTULO - MEJORADO */
.producto.card h4 {
  min-height: 48px;          /* Aumentado para títulos de 2 líneas */
  font-size: 15px;           /* Un poco más grande */
  font-weight: 500;          /* Medium en lugar de semi-bold (más elegante) */
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 8px 0 12px 0;      /* Márgenes más controlados */
  line-height: 1.4;          /* Mejor espaciado para texto multi-línea */
  color: #222;               /* Color un poco más suave que negro puro */
  letter-spacing: -0.2px;    /* Un pequeño ajuste para mejor legibilidad */
  width: 100%;
  word-break: break-word;    /* Evita desbordes de texto */
}

/* CONTROL - ¡ESTA ES LA CLAVE! */
.control {
  margin-top: auto;           /* Empuja hacia abajo */
  width: 100%;                /* Asegura que ocupe todo el ancho */
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;                  /* Un poco más de espacio entre elementos */
  padding: 8px 0 4px 0;       /* Pequeño padding vertical */
}

/* BOTONES */
.control button {
  width: 36px;                /* Un poco más grandes */
  height: 36px;
  background: #AE040F;
  border: none;
  border-radius: 10px;        /* Bordes un poco más redondeados */
  color: white;
  font-size: 20px;            /* Más grande para mejor clic */
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(174, 4, 15, 0.3); /* Sombra sutil */
}

.control button:hover {
  background: #8b030c;
  transform: scale(1.08);
  box-shadow: 0 4px 8px rgba(139, 3, 12, 0.4);
}

/* INPUT - MEJORADO */
.control input {
  width: 50px;
  height: 36px;
  border: 1.5px solid #e0e0e0;  /* Borde un poco más visible */
  border-radius: 10px;
  text-align: center;
  font-weight: 500;
  font-size: 16px;
  color: #333;
  background: #f9f9f9;          /* Fondo ligeramente gris */
  transition: border-color 0.2s;
}

.control input:focus {
  outline: none;
  border-color: #AE040F;        /* Borde rojo al enfocar */
  background: white;
}

/* TOTAL BOX - Si quieres mejorarlo también */
.total-box {
  margin-top: 30px;
  padding: 20px;
  background: #f8f8f8;
  border-radius: 16px;
  text-align: center;
  font-size: 18px;
  font-weight: 500;
}

.total-box strong {
  color: #AE040F;
  font-weight: 600;
}

#total {
  font-size: 24px;
  font-weight: 700;
  color: #222;
}

#alerta {
  margin-top: 10px;
  color: #AE040F;
  font-weight: 500;
  min-height: 24px;
}

/* GRID - COLUMNAS DE 5 */
.grid-productos {
  display: grid;
  grid-template-columns: repeat(5, 1fr); /* 5 columnas fijas */
  gap: 20px; /* Espacio entre tarjetas */
}

/* Para pantallas más pequeñas, se adapta */
@media (max-width: 1200px) {
  .grid-productos {
    grid-template-columns: repeat(4, 1fr); /* 4 columnas en tablets grandes */
  }
}

@media (max-width: 900px) {
  .grid-productos {
    grid-template-columns: repeat(3, 1fr); /* 3 columnas en tablets */
  }
}

@media (max-width: 600px) {
  .grid-productos {
    grid-template-columns: repeat(2, 1fr); /* 2 columnas en móviles */
  }
}

@media (max-width: 400px) {
  .grid-productos {
    grid-template-columns: 1fr; /* 1 columna en móviles pequeños */
  }
}
.ayuda-espacio {
  margin: 80px 0;
  padding: 40px 20px;
  background: #f9fafb;
}

.ayuda-contenido {
  max-width: 1100px;
  margin: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}

.ayuda-texto h2 {
  font-size: 32px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 20px;
}

.ayuda-texto p {
  font-size: 16px;
  line-height: 1.7;
  color: #4b5563;
  margin-bottom: 12px;
}

.ayuda-imagen {
  text-align: center;
}

.ayuda-imagen img {
  max-width: 100%;
  height: auto;
}

/* Responsive */
@media (max-width: 768px) {
  .ayuda-contenido {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .ayuda-texto h2 {
    font-size: 26px;
  }
}

/* ===== TÍTULO DE PRODUCTO (h4) PERFECTAMENTE ALINEADO ===== */
.producto.card h4 {
  height: 52px;              /* ALTURA FIJA PARA TODOS */
  display: flex;
  align-items: center;       /* Centrado vertical */
  justify-content: center;   /* Centrado horizontal */
  text-align: center;

  font-size: 15px;
  font-weight: 500;
  line-height: 1.3;
  color: #222;

  margin: 8px 0 14px 0;
  padding: 0 6px;            /* Evita que textos largos se peguen */
  width: 100%;

  word-break: break-word;
}

.detalle-espacio {
  font-size: 13px;
  color: #666;
  margin-top: 4px;
}
