/* Main */
main {
  flex: 1;
  padding: 2rem;
  text-align: center;
}

/* Título de sección (si lo necesitas) */
.products-section h1,
#category-title {
  font-size: 2.5rem;
  color: var(--tittle-color);
  margin-bottom: 2rem;
}

/* GRID RESPONSIVO */
.products-grid,
.products-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  justify-items: center;
  margin-top: 2rem;
}

/* TARJETA */
.product-card {
  background-color: var(--product-card);
  color: var(--tittle-color);
  width: 100%;
  max-width: 250px;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* LINK WRAPPER */
.product-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 1.5rem;
  flex: 1; /* empuja el botón al final */
}

/* IMAGEN */
.product-card-image {
  width: 100%;
  height: auto;       /* mantiene proporción */
  object-fit: cover;  /* opcional: recorta si hace falta */
  border-radius: 8px;
  margin-bottom: 1rem;
}

/* TEXTO DENTRO DE LA TARJETA */
.product-card-name {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.product-card-price {
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

.product-card-stock,
.product-card-category {
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

/* BOTÓN */
.product-card-button {
  background-color: var(--tittle-color);
  color: var(--text-white);
  padding: 0.7rem 1rem;
  border: none;
  border-radius: 5px;
  font-size: 0.9rem;
  cursor: pointer;
  text-transform: uppercase;
  transition: background-color 0.3s;
  width: calc(100% - 3rem); /* alinea con el padding del link */
  margin: 1rem auto;
}

.product-card-button:hover {
  background-color: var(--color-background);
  color: var(--tittle-color);
}

/* Estilos del toast */
#toast-container {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
}

.toast {
  background-color: #333;
  color: #fff;
  padding: 10px 20px;
  margin-bottom: 10px;
  border-radius: 5px;
  font-size: 16px;
  opacity: 0;
  animation: fadeInOut 3s forwards;
}

@keyframes fadeInOut {
  0%   { opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { opacity: 0; }
}

/* Responsividad para móvil */
@media (max-width: 768px) {
  .product-card {
    max-width: 100%;
  }
  .product-card-name {
    width: 100%;
    font-size: 1.4rem;
  }
}

/* ===========================
   Reglas añadidas para PC
   =========================== */

/* Evitar scroll horizontal */
body {
  overflow-x: hidden;
}

/* Grid fijo y centrado en pantallas grandes */
@media (min-width: 1024px) {
  .products-container {
    max-width: 1400px;           /* ancho fijo deseado */
    margin: 0 auto 2rem;         /* centrado horizontal y espacio abajo */
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    justify-content: center;     /* centra columnas si sobra espacio */
  }
  /* Ocultar barra inferior en PC */
  .bottom-bar {
    display: none;
  }
}
