/* =========================
   Layout general – Mercado Verde
========================== */
body {
  font-family: Arial, sans-serif;
  background: #f0f5f0;
  margin: 0;
  padding: 0;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* Header */
header {
  text-align: center;
  background-color: #2e7d32;
  color: white;
  padding: 20px 0;
  border-bottom: 3px solid #1b5e20;
}

header h1 { margin:0; font-size:2em; }
header p { margin:5px 0 0; font-size:16px; }

/* Controles */
.controles {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 20px 0;
}

.controles input, .controles select {
  padding: 10px;
  font-size: 14px;
  border-radius: 5px;
  border: 1px solid #ccc;
}

/* Layout productos + ofertas */
.layout-ofertas {
  display: flex;
  gap: 20px;
  justify-content: center;
  align-items: flex-start;
}

/* Productos centrados */
#listaProductos-wrapper {
  width: 70%;
  max-width: 900px;
}

/* Ofertas a la derecha */
#ofertaCarrusel-wrapper {
  width: 25%;
  max-height: 800px;
  overflow-y: auto;
  padding-left: 10px;
  box-sizing: border-box;
}

/* =========================
   Productos – estilo MercadoLibre
========================== */
.productos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  justify-content: center;
}

.producto {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: white;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 10px;
  box-shadow: 1px 1px 8px rgba(0,0,0,0.1);
  transition: transform 0.2s;
}

.producto:hover { transform: translateY(-3px); }

.producto-img {
  width: 100%;
  height: auto;
  max-height: 250px;
  object-fit: cover;
  border-radius: 5px;
  border: 1px solid #ccc;
  margin-bottom: 10px;
}

.producto div { text-align: center; width: 100%; }

.producto button {
  background: #2e7d32;
  color: white;
  border: none;
  padding: 8px 12px;
  cursor: pointer;
  border-radius: 5px;
  font-weight: bold;
}

.producto button:hover { background: #1b5e20; }

/* =========================
   Ofertas
========================== */
.producto-oferta {
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 10px;
  text-align: center;
  margin-bottom: 10px;
  opacity: 0;
  transition: opacity 0.5s;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  max-width: 220px;      /* tarjetas más pequeñas que los productos normales */
  margin-left: auto;
  margin-right: auto;
}

.producto-oferta.show { opacity: 1; }

.producto-oferta img {
  width: 100%;
  height: auto;
  max-height: 120px;
  object-fit: cover;
  border-radius: 5px;
  border: 1px solid #ccc;
  margin-bottom: 10px;
}

.producto-oferta button {
  background: #2e7d32;
  color: white;
  border: none;
  padding: 5px 10px;
  cursor: pointer;
  border-radius: 5px;
  font-weight: bold;
}

.producto-oferta button:hover { background: #1b5e20; }

/* Responsive */
@media(max-width:900px){
  .layout-ofertas { flex-direction: column; }
  #listaProductos-wrapper, #ofertaCarrusel-wrapper {
    width: 100%;
    max-height: none;
    border-left: none;
    padding-left: 0;
    margin-top: 20px;
  }
}
/* Botones de acciones */
.edit-btn,
.del-btn{
  display: inline-block;
  padding: 6px 10px;
  margin-top: 6px;
  font-size: 13px;
  border-radius: 4px;
  text-decoration: none;
  font-weight: bold;
}

/* EDITAR → VERDE */
.edit-btn{
  background: #2e7d32;      /* verde */
  color: #fff;
}

.edit-btn:hover{
  background: #1b5e20;
}

/* BORRAR → ROJO */
.del-btn{
  background: #c62828;      /* rojo */
  color: #fff;
  margin-left: 5px;
}

.del-btn:hover{
  background: #8e0000;
}
