/* === Estilos Generales === */
body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 20px;
  background: #f0f0f0;
  color: #222;
  transition: background 0.3s, color 0.3s;
}

header {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 15px;
  border-bottom: 2px solid #ddd;
}

header input[type="text"] {
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
  width: 200px;
}

button {
  padding: 8px 14px;
  background: #333;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s ease;
}

button:hover {
  background: #555;
}

/* === Productos === */
#productos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.producto {
  background: #fff;
  padding: 15px;
  border-radius: 10px;
  box-shadow: 0 0 5px rgba(0,0,0,0.1);
  text-align: center;
}

.producto img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  margin-bottom: 10px;
}

.producto p {
  margin: 0.5em 0;
}

/* === Carrito === */
#carrito {
    overflow-y: auto;   
  position: fixed;
  top: 10%;
  left: 25%;
  width: 50%;
  background: #fff;
  padding: 20px;
  border: 2px solid #333;
  border-radius: 10px;
  box-shadow: 0 0 10px #00000055;
  z-index: 1000;
}

#carrito ul {
  list-style: none;
  padding: 0;
}

#carrito li {
  padding: 5px 0;
}

#carrito button {
  margin-left: 10px;
  background: #b30000;
}

.oculto {
  display: none;
}

/* === Footer === */
footer {
  margin-top: 40px;
  text-align: center;
  font-size: 0.9rem;
  color: #555;
}

/* === Modo Oscuro === */
body.oscuro {
  background: #111;
  color: #eee;
}

body.oscuro .producto {
  background: #222;
}

body.oscuro header input[type=\"text\"] {
  background: #333;
  color: #fff;
  border: 1px solid #666;
}

body.oscuro #carrito {
  background: #1e1e1e;
  color: #fff;
  border-color: #666;
}

/* === Responsive === */
@media (max-width: 600px) {
  #carrito {
    width: 90%;
    left: 5%;
  }

  header {
    flex-direction: column;
    align-items: flex-start;
  }

  header input[type=\"text\"] {
    width: 100%;
  }
}
