@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
  --primary: #2c3e50;
  --secondary: #16a085;
  --accent: #e74c3c;
  --light: #f5f5f5;
  --dark: #2c3e50;
  --text: #333333;
  --gray: #95a5a6;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --gradient: linear-gradient(135deg, #16a085, #2980b9);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
}

body {
  background-color: #ecf0f1;
  color: var(--text);
}

h1, h2, h3, h4, h5, h6, p, a, input, textarea, ul {
  margin: 0;
  padding: 0;
}

ul {
  list-style-type: none;
}

a {
  text-decoration: none;
  color: var(--primary);
  transition: color 0.3s ease;
}

a:hover {
  color: var(--secondary);
}

.wrapper {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

/* Sidebar */
aside {
  background: var(--gradient);
  padding: 2rem 1.5rem;
  color: white;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  z-index: 10;
}

.logo {
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: 1px;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Estilos para la búsqueda */
.search-container {
  margin-bottom: 1.5rem;
}

.search-box {
  display: flex;
  align-items: center;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 30px;
  padding: 0.5rem 1rem;
  transition: all 0.3s ease;
}

.search-box:hover, .search-box:focus-within {
  background-color: rgba(255, 255, 255, 0.3);
}

#buscador {
  flex: 1;
  background: transparent;
  border: none;
  color: white;
  outline: none;
  font-size: 0.9rem;
}

#buscador::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

#buscador-button {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  font-size: 1rem;
  padding: 0;
  margin-left: 0.5rem;
  transition: color 0.3s ease;
}

#buscador-button:hover {
  color: white;
}

.menu {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: auto;
}

.boton-menu {
  background-color: transparent;
  border: 0;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 500;
  padding: 0.85rem 1rem;
  font-size: 0.9rem;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.boton-menu:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: white;
}

.boton-menu.active {
  background-color: white;
  color: var(--secondary);
  font-weight: 600;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.boton-menu i {
  font-size: 1.2rem;
}

.numerito {
  background-color: var(--accent);
  color: white;
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
  font-size: 0.7rem;
  margin-left: auto;
  font-weight: 600;
}

.boton-carrito {
  margin-top: 1rem;
}

.boton-carrito.active .numerito {
  background-color: var(--secondary);
}

.texto-footer {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.8rem;
  margin-top: 2rem;
  text-align: center;
}

/* Main Content */
main {
  background-color: white;
  padding: 2rem;
  border-radius: 0;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.03);
}

.titulo-principal {
  color: var(--primary);
  font-size: 1.8rem;
  font-weight: 600;
  margin-bottom: 2rem;
  border-bottom: 2px solid #ecf0f1;
  padding-bottom: 0.75rem;
}

.contenedor-productos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
}

.producto {
  background-color: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.producto:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
}

.producto-imagen {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 12px 12px 0 0;
  transition: transform 0.5s ease;
}

.producto:hover .producto-imagen {
  transform: scale(1.05);
}

.producto-detalles {
  background-color: white;
  color: var(--text);
  padding: 1rem;
  border-radius: 0 0 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.producto-titulo {
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary);
}

.producto-precio {
  font-weight: 700;
  color: var(--secondary);
  font-size: 1.1rem;
}

.producto-agregar {
  border: 0;
  background-color: var(--secondary);
  color: white;
  padding: 0.6rem;
  text-transform: uppercase;
  border-radius: 30px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 500;
  margin-top: 0.5rem;
  transition: background-color 0.3s ease;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 5px rgba(22, 160, 133, 0.3);
}

.producto-agregar:hover {
  background-color: #1abc9c;
}

/* Mensajes de búsqueda */
.search-results-info {
  text-align: center;
  color: var(--gray);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

.search-reset {
  background-color: transparent;
  border: 1px solid var(--secondary);
  color: var(--secondary);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.8rem;
  margin-left: 0.5rem;
  transition: all 0.3s ease;
}

.search-reset:hover {
  background-color: var(--secondary);
  color: white;
}

/* Carrito */
.contenedor-carrito {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.carrito-vacio,
.carrito-comprado {
  color: var(--gray);
  text-align: center;
  padding: 3rem 0;
  font-size: 1.1rem;
}

.carrito-productos {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.carrito-producto {
  display: flex;
  align-items: center;
  background-color: white;
  padding: 1rem;
  border-radius: 12px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease;
}

.carrito-producto:hover {
  transform: translateX(3px);
}

.carrito-producto-imagen {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  margin-right: 1rem;
}

.carrito-producto-titulo {
  font-weight: 600;
  color: var(--primary);
  font-size: 1rem;
}

.carrito-producto-precio {
  font-weight: 700;
  color: var(--secondary);
  margin-top: 0.25rem;
}

.carrito-producto-cantidad {
  background-color: #f5f5f5;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

.carrito-producto-subtotal {
  margin-left: auto;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--primary);
}

.carrito-producto-eliminar {
  border: 0;
  background-color: #f8f9fa;
  color: var(--accent);
  width: 35px;
  height: 35px;
  border-radius: 50%;
  cursor: pointer;
  margin-left: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
}

.carrito-producto-eliminar:hover {
  background-color: #fce8e6;
}

.carrito-acciones {
  display: flex;
  justify-content: space-between;
  margin-top: 1rem;
}

.carrito-acciones-vaciar {
  border: 0;
  background-color: #f5f5f5;
  padding: 0.75rem 1.25rem;
  border-radius: 30px;
  color: var(--gray);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.carrito-acciones-vaciar:hover {
  background-color: #e0e0e0;
  color: var(--primary);
}

.carrito-acciones-derecha {
  display: flex;
  gap: 1rem;
}

.carrito-acciones-total {
  display: flex;
  align-items: center;
  background-color: #f5f5f5;
  padding: 1rem 1.5rem;
  border-radius: 30px;
  gap: 0.5rem;
}

.carrito-acciones-total span:first-child {
  font-size: 0.9rem;
  color: var(--gray);
}

.carrito-acciones-total span:last-child {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
}

.carrito-acciones-comprar {
  border: 0;
  background-color: var(--secondary);
  padding: 1rem 1.5rem;
  color: white;
  font-weight: 600;
  cursor: pointer;
  border-radius: 30px;
  transition: background-color 0.3s ease;
  box-shadow: 0 2px 5px rgba(22, 160, 133, 0.3);
}

.carrito-acciones-comprar:hover {
  background-color: #1abc9c;
}

/* Mobile Header */
.header-mobile {
  display: none;
  background: var(--gradient);
  padding: 1rem;
  color: white;
}

.close-menu {
  display: none;
}

.disabled {
  display: none;
}

.enlace-contacto {
  color: rgba(255, 255, 255, 0.8);
  transition: color 0.3s ease;
}

.enlace-contacto:hover {
  color: white;
  text-decoration: underline;
}

/* Media Queries */
@media screen and (max-width: 850px) {
  .wrapper {
    grid-template-columns: 240px 1fr;
  }
  
  .contenedor-productos {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
}

@media screen and (max-width: 768px) {
  .wrapper {
    display: flex;
    flex-direction: column;
  }
  
  aside {
    position: fixed;
    height: 100vh;
    width: 300px;
    transform: translateX(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
  }
  
  .aside-visible {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
  }
  
  main {
    padding: 1.5rem;
  }
  
  .header-mobile {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
  }
  
  .header-mobile .logo {
    font-size: 1.3rem;
    font-weight: 700;
  }
  
  .open-menu, .close-menu {
    background-color: transparent;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    transition: background-color 0.2s ease;
  }
  
  .open-menu:hover, .close-menu:hover {
    background-color: rgba(255, 255, 255, 0.1);
  }
  
  .close-menu {
    display: block;
    position: absolute;
    top: 1rem;
    right: 1rem;
  }
  
  /* Ajustes para búsqueda en móvil */
  .search-container {
    margin-top: 1rem;
    width: 90%;
    margin-left: auto;
    margin-right: auto;
  }
  
  .carrito-producto {
    flex-wrap: wrap;
  }
  
  .carrito-producto-subtotal {
    width: 100%;
    margin-top: 0.5rem;
    margin-left: 0;
    padding-top: 0.5rem;
    border-top: 1px solid #f5f5f5;
  }
  
  .carrito-acciones {
    flex-direction: column;
    gap: 1rem;
  }
  
  .carrito-acciones-derecha {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .carrito-acciones-total {
    justify-content: space-between;
    width: 100%;
  }
  
  .carrito-acciones-comprar {
    width: 100%;
  }
}

@media screen and (max-width: 576px) {
  .contenedor-productos {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }
  
  .producto-imagen {
    height: 150px;
  }
  
  .carrito-producto-imagen {
    width: 60px;
    height: 60px;
  }
}

@media screen and (max-width: 400px) {
  .contenedor-productos {
    grid-template-columns: 1fr;
  }
  
  .titulo-principal {
    font-size: 1.5rem;
  }
}