/* Reset básico */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', sans-serif;
  background-color: #fff;
  color: #333;
  line-height: 1.6;
}


   

.btn-comprar {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.5rem 1rem;
  background: #1e88e5;
  color: white;
  background-color:black;
  text-decoration: none;
  border-radius: 6px;
  border: none;
  cursor: pointer;
}

.btn-comprar:hover {
  background: #1565c0;
}

/* Tabla carrito */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

table th,
table td {
  padding: 0.8rem;
  border: 1px solid #ccc;
  text-align: center;
}

h1, h2, h3 {
  text-align: center;
  margin: 1rem 0;
}

/* Formulario de compra */
form {
  max-width: 500px;
  margin: 1rem auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

input[type="text"],
input[type="email"],
input[type="number"],
textarea {
  padding: 0.6rem;
  border: 1px solid #ccc;
  border-radius: 6px;
}

button[type="submit"] {
  padding: 0.6rem;
  background: #d81b60;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

button[type="submit"]:hover {
  background: #b71c4b;
}

/* Responsive */
@media (max-width: 768px) {
    
   /* .catalogo {
    grid-template-columns: 1fr 1fr;
    padding: 1rem;
  }*/
  
 form {
    padding: 0 1rem;
  }
 /* .navbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .menu {
    flex-direction: column;
    gap: 0.5rem;
  }

  .icons {
    margin-top: 0.5rem;
  }
*/
  
}





/**------NAVBAR ----*/

 .navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    padding: 0.8rem 1rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    flex-wrap: nowrap;
    position: relative;
    z-index: 1000;
  }
  .logo {
    font-weight: bold;
    font-size: 1.3rem;
  }
  .menu {
    display: flex;
    gap: 1rem;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-grow: 1;
    justify-content: center;
  }
  .menu li a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
  }
  .icons {
    display: flex;
    gap: 1rem;
    font-size: 1.5rem;
    align-items: center;
  }
  /* Botón hamburguesa oculto por defecto */
  .menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
  }
  /* Búsqueda */
  #searchForm {
    margin-right: 1rem;
    flex-grow: 1;
    max-width: 300px;
  }
  #searchInput {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
  }

  /* RESPONSIVE */
  @media (max-width: 768px) {
    .menu-toggle {
      display: block;
      order: 1;
    }
    .logo {
      order: 2;
      flex-grow: 1;
      text-align: center;
    }
    .icons {
      order: 3;
    }
    .menu {
      display: none;
      flex-direction: column;
      width: 100%;
      background: #fff;
      box-shadow: 0 2px 10px rgba(0,0,0,0.1);
      position: absolute;
      top: 100%;
      left: 0;
      padding: 0.5rem 0;
      z-index: 999;
    }
    .menu.active {
      display: flex;
    }
    .menu li {
      text-align: center;
      margin: 0.5rem 0;
    }
    /* Formulario de búsqueda debajo, ocupando ancho completo */
    #searchForm {
      order: 3;
      width: 100%;
      margin: 0.5rem 0 0;
      max-width: none;
    }
  }


/*------CATALOGO-------------*/


.catalogo {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* 5 columnas fijas */
  gap: 1rem;
  padding: 1rem;
}

/* Responsivo: menos columnas en pantallas pequeñas */
@media (max-width: 1200px) {
  .catalogo {
    grid-template-columns: repeat(4, 1fr);
  }
}
@media (max-width: 992px) {
  .catalogo {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 768px) {
  .catalogo {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 500px) {
  .catalogo {
    grid-template-columns: 1fr;
  }
}

/*
.catalogo {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  padding: 1rem;
}*/
.producto {
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
  padding: 0.5rem;
  background-color: #fff;
}
.producto img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  display: block;
  margin-bottom: 0.5rem;
  cursor: pointer;
}
.producto h2 {
  font-size: 12px;
  margin: 0;
  font-weight: 600;
  text-align: left;
}
.producto .precio {
  font-weight: bold;
  color: black;
  text-align: left;
}
.producto .favorito {
  font-size: 1.3rem;
  cursor: pointer;

}
.producto .info {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.producto .info-text {
  flex: 1;
}

.producto:hover {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}


/*--------------FILTROS-------------------------*/







.filtros.activo {
  display: flex !important;
}

.filtro-grupo {
  display: flex;
  flex-direction: column;
  margin-bottom: 1rem;
}

.filtro-grupo input[type="range"] {
  width: 200px;
}

#price-value,
#precio-valor {
  margin-top: 4px;
  font-weight: bold;
}


/*-------*/

/* Botón filtro
.filtro-toggle {
  padding: 1rem 2rem 0;
  text-align: right;
} 
.filtro-toggle button:hover {
  background-color: #1565c0;
}*/
/*

.filtro-toggle button {
  background-color: #1e88e5;
  color: white;
  border: none;
  padding: 0.6rem 1.2rem;
  font-size: 1rem;
  border-radius: 8px;
  cursor: pointer;
}*/



/* Botón de filtrar moderno */
.filtro-toggle button {
  background-color: #333;
  color: #fff;
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: background-color 0.3s;
}
.filtro-toggle button:hover {
  background-color: #555;
}
.filtro-toggle {
  text-align: right;
  padding: 1rem;
}


/* Filtros
.filtros {
  padding: 1rem 2rem;
  border-bottom: 1px solid #eee;
  gap: 2rem;
  align-items: center;
  flex-wrap: wrap;
  display: none;
  flex-direction: column;
} */
/* Contenedor de filtros horizontal */
.filtros {
  display: NONE;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding: 1rem;
  margin: 0 auto;
  justify-content: space-around;
  background-color: #f4f4f4;
  border-radius: 10px;
  margin-bottom: 1rem;
}
.filtro-grupo {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 200px;
}
.filtro-grupo label {
  font-weight: 500;
  margin-bottom: 0.4rem;
  color: #333;
}

/* Selects estilizados */
.filtros select {
  width: 100%;
  padding: 0.5rem;
  border-radius: 8px;
  border: 1px solid #ccc;
  font-size: 1rem;
}

/* Rango de precio negro */
#price-range {
  width: 100%;
  accent-color: #000; /* Esto hace que la barra sea negra en navegadores modernos */
}
#price-value {
  margin-top: 0.4rem;
  font-weight: bold;
  color: #000;
}




/*para animacion de carrito */

#cart-icon {
  position: relative;
  font-size: 1.8rem;
  color: #333;
}

#cart-count {
  position: absolute;
  top: -10px;
  right: -10px;
  background: red;
  color: white;
  font-size: 0.75rem;
  padding: 2px 6px;
  border-radius: 50%;
  font-weight: bold;
  animation: pop 0.3s ease;
}

@keyframes pop {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.4);
  }
  100% {
    transform: scale(1);
  }
}





