/* Estilos básicos */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', 'Segoe UI', sans-serif;
}

html, body {
  background-color: #0a0a0a;
  color: #f8f8f8;
}

/* Estilos del header */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: linear-gradient(90deg, #0f0f0f 0%, #1a1a1a 100%);
  border-bottom: 1px solid #333;
  box-shadow: 0 2px 15px rgba(0,0,0,0.8);
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo-container img {
  height: 50px;
  border-radius: 5px;
  border: 2px solid #ab1f98;
}

.logo-container h1 {
  color: #ffffff;
  text-shadow: 0 0 10px rgba(171, 31, 152, 0.7);
}

nav ul {
  display: flex;
  list-style: none;
  gap: 2rem;
}

nav a {
  color: #e0e0e0;
  text-decoration: none;
  font-size: 1.1rem;
  transition: all 0.3s;
  padding: 0.5rem 1rem;
  border-radius: 4px;
}

nav a:hover, nav a.active {
  color: #ffffff;
  background-color: rgba(171, 31, 152, 0.3);
  text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

.carrito {
  position: relative;
  cursor: pointer;
  padding: 10px;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 50%;
  transition: all 0.3s;
}

.carrito:hover {
  background-color: rgba(171, 31, 152, 0.3);
  transform: scale(1.1);
}

.carrito svg {
  color: white;
  width: 24px;
  height: 24px;
}

#contador-carrito {
  position: absolute;
  top: -5px;
  right: -5px;
  background-color: #ab1f98;
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: bold;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

/* Estilos del main */
main {
  display: flex;
  padding: 2rem;
  gap: 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

/* Estilos de los filtros */
.filtros {
  flex: 0 0 250px;
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  padding: 1.5rem;
  border-radius: 10px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
  height: fit-content;
  border: 1px solid #333;
}

.filtros h2 {
  margin-bottom: 1.5rem;
  color: #ab1f98;
  border-bottom: 1px solid rgba(171, 31, 152, 0.3);
  padding-bottom: 0.5rem;
}

.categoria-filtro, .precio-filtro {
  margin-bottom: 1.5rem;
}

.categoria-filtro h3, .precio-filtro h3 {
  margin-bottom: 0.8rem;
  color: #f0f0f0;
}

.categoria-filtro ul {
  list-style: none;
}

.categoria-filtro li {
  margin-bottom: 0.8rem;
  display: flex;
  align-items: center;
}

.categoria-filtro input[type="checkbox"] {
  margin-right: 10px;
  width: 18px;
  height: 18px;
  accent-color: #ab1f98;
}

.categoria-filtro label {
  color: #e0e0e0;
  cursor: pointer;
}

.precio-filtro input {
  width: 100%;
  margin-bottom: 10px;
  accent-color: #ab1f98;
}

#valor-precio {
  display: inline-block;
  background-color: rgba(171, 31, 152, 0.2);
  padding: 4px 8px;
  border-radius: 4px;
  color: #ffffff;
}

/* Estilos de productos */
.productos {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
}

.producto {
  background: linear-gradient(135deg, #2c3e50, #1e5799);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
  transition: transform 0.3s, box-shadow 0.3s;
  border: 1px solid #444;
}

.producto:hover {
  transform: translateY(-8px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.7);
}

.producto img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-bottom: 3px solid #ab1f98;
}

.producto-info {
  padding: 1.5rem;
}

.producto-info h3 {
  margin-bottom: 0.8rem;
  font-size: 1.5rem;
  color: #ffffff;
  text-shadow: 0 0 5px rgba(171, 31, 152, 0.5);
}

.producto-info p {
  color: #e0e0e0;
  margin-bottom: 0.8rem;
  line-height: 1.5;
}

.producto-info .precio {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 1.2rem 0;
}

.producto-info .precio span {
  color: #ffffff;
  background: rgba(171, 31, 152, 0.2);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 1.2rem;
  font-weight: bold;
}

.btn-comprar {
  background-color: #ab1f98;
  color: white;
  border: none;
  padding: 0.7rem 1.5rem;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s;
  font-weight: bold;
  box-shadow: 0 0 10px rgba(171, 31, 152, 0.5);
}

.btn-comprar:hover {
  background-color: #c82ebe;
  transform: scale(1.05);
}

.btn-comprar[disabled] {
  background-color: #666;
  cursor: not-allowed;
  box-shadow: none;
  opacity: 0.7;
}

.producto-info small {
  padding: 5px 10px;
  border-radius: 4px;
  display: inline-block;
  margin-top: 8px;
  font-weight: 500;
}

/* Estilos para indicadores de stock */
.stock-ok {
  color: #4caf50;
  background-color: rgba(76, 175, 80, 0.15);
  border: 1px solid rgba(76, 175, 80, 0.3);
}

.stock-bajo {
  color: #ff9800;
  background-color: rgba(255, 152, 0, 0.15);
  border: 1px solid rgba(255, 152, 0, 0.3);
}

.stock-agotado {
  color: #f44336;
  background-color: rgba(244, 67, 54, 0.15);
  border: 1px solid rgba(244, 67, 54, 0.3);
}

/* Estilo para el loader */
.productos-placeholder {
  width: 100%;
  text-align: center;
  padding: 5rem;
  grid-column: 1 / -1;
  background-color: rgba(0, 0, 0, 0.1);
  border-radius: 10px;
}

.productos-placeholder svg {
  margin-bottom: 15px;
}

.productos-placeholder p {
  color: #ab1f98;
  font-size: 1.2rem;
}

/* Estilos del modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85);
  z-index: 1000;
  backdrop-filter: blur(5px);
}

.modal-contenido {
  position: relative;
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  margin: 5% auto;
  padding: 2rem;
  width: 90%;
  max-width: 700px;
  border-radius: 10px;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.7);
  border: 1px solid #333;
  animation: fadeIn 0.3s;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

.cerrar {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 1.8rem;
  cursor: pointer;
  color: #ddd;
  transition: color 0.3s;
}

.cerrar:hover {
  color: #ab1f98;
}

.modal-contenido h2 {
  color: #ab1f98;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid rgba(171, 31, 152, 0.3);
  padding-bottom: 0.5rem;
}

#items-carrito {
  margin: 1.5rem 0;
  max-height: 50vh;
  overflow-y: auto;
  padding-right: 10px;
}

#items-carrito::-webkit-scrollbar {
  width: 8px;
}

#items-carrito::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

#items-carrito::-webkit-scrollbar-thumb {
  background-color: rgba(171, 31, 152, 0.5);
  border-radius: 4px;
}

.item-carrito {
  display: flex;
  align-items: center;
  padding: 1rem;
  margin-bottom: 1rem;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.item-carrito img {
  width: 70px;
  height: 70px;
  object-fit: cover;
  margin-right: 1rem;
  border-radius: 5px;
  border: 2px solid rgba(171, 31, 152, 0.3);
}

.item-info {
  flex: 1;
}

.item-info h4 {
  color: #ffffff;
  margin-bottom: 5px;
}

.item-info p {
  color: #ddd;
  font-size: 0.9rem;
}

.item-precio {
  margin: 0 1.5rem;
  font-weight: bold;
  color: #fff;
  background-color: rgba(171, 31, 152, 0.2);
  padding: 5px 10px;
  border-radius: 5px;
}

.btn-eliminar {
  background: none;
  border: none;
  color: #ff4d4d;
  cursor: pointer;
  font-size: 1.2rem;
  transition: all 0.3s;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.btn-eliminar:hover {
  background-color: rgba(255, 77, 77, 0.2);
  transform: scale(1.1);
}

.total-carrito {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 0 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

#total-precio {
  font-size: 1.5rem;
  font-weight: bold;
  color: #fff;
}

#btn-checkout {
  background-color: #ab1f98;
  color: white;
  border: none;
  padding: 0.8rem 1.8rem;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: bold;
  transition: all 0.3s;
  box-shadow: 0 0 10px rgba(171, 31, 152, 0.5);
}

#btn-checkout:hover {
  background-color: #c82ebe;
  transform: scale(1.05);
}

/* Responsive */
@media (max-width: 768px) {
  main {
    flex-direction: column;
    padding: 1rem;
  }

  .filtros {
    width: 100%;
    flex: none;
  }

  .modal-contenido {
    width: 95%;
    margin: 10% auto;
  }

  .total-carrito {
    flex-direction: column;
    gap: 1rem;
  }
}