:root {
 --primary-color: #0057b8;
  --secondary-color: #28a745;
  --danger-color: #dc3545;
  --dark-color: #222;
  --light-color: #f8f9fa;
  --gray-color: #6c757d;
  --border-color: #ddd;
  --header-blue: #004aad;
}

/* ESTILOS DEL HEADER */
body {
  font-family: 'Arial', sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f9f9f9;
  color: #333;
}
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 5%;
  background-color: var(--primary-color);
  color: white;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  flex-wrap: wrap;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: bold;
  font-size: 1.1rem;
}

.logo img {
  height: 40px;
}

.nav-container {
  display: flex;
  align-items: center;
}

.nav-links {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 20px;
  align-items: center;
}

.nav-links a {
  color: white;
  text-decoration: none;
  transition: color 0.3s;
  font-size: 0.95rem;
}

.nav-links a:hover {
  color: #a0c1e1;
}

.icon-container {
  position: relative;
}

.icon-container i {
  font-size: 1.2rem;
  color: white;
}

.fa-shopping-cart[data-count]:after {
  content: attr(data-count);
  position: absolute;
  top: -10px;
  right: -10px;
  font-size: 0.7rem;
  background: var(--danger-color);
  color: white;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-container {
  position: relative;
  display: flex;
  align-items: center;
}

.search-container input {
  padding: 8px 15px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  min-width: 200px;
  font-size: 0.9rem;
}

.search-icon {
  position: absolute;
  right: 10px;
  color: var(--gray-color);
  cursor: pointer;
}

/* Sección principal */
.product-section {
  max-width: 1200px;
  margin: 30px auto;
  padding: 0 20px;
}

/* ESTILOS PRINCIPALES */
.main-container {
  display: flex;
  min-height: calc(100vh - 120px);
  background-color: #f5f5f5;
}

/* Panel de Filtros */
.filters-sidebar {
  width: 250px;
  background: white;
  padding: 1.5rem;
  box-shadow: var(--box-shadow);
  position: sticky;
  top: 80px;
  height: calc(100vh - 80px);
  overflow-y: auto;
  transition: var(--transition);
  z-index: 900;
  border-right: 1px solid #eee;
}

.filters-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #eee;
}

.filters-header h3 {
  margin: 0;
  font-size: 1.2rem;
  color: var(--primary-color);
  font-weight: 600;
}

.filters-header h3 i {
  margin-right: 8px;
}

.close-filters {
  background: none;
  border: none;
  color: var(--accent-color);
  cursor: pointer;
  font-size: 1rem;
  display: none;
}

.filter-section {
  margin-bottom: 1.5rem;
}

.filter-title {
  font-size: 0.9rem;
  color: #7f8c8d;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.8rem;
  font-weight: 600;
}

.category-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.category-list li {
  margin-bottom: 0.5rem;
}

.category-list a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.7rem 1rem;
  color: var(--dark-color);
  text-decoration: none;
  border-radius: var(--border-radius);
  transition: var(--transition);
  font-size: 0.95rem;
  background-color: #f9f9f9;
}

.category-list a:hover {
  background-color: #f0f0f0;
  transform: translateX(3px);
}

.category-list a.active {
  background-color: var(--primary-color);
  color: white;
  font-weight: 500;
}

.category-list a.active .category-count {
  background-color: rgba(255, 255, 255, 0.2);
  color: white;
}

.category-name {
  flex-grow: 1;
}

.category-count {
  background-color: #e0e0e0;
  color: #555;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 500;
}

.toggle-filters {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  z-index: 800;
  transition: var(--transition);
}

.toggle-filters:hover {
  transform: scale(1.1);
}

/* Catálogo de Productos */
.catalog {
  flex: 1;
  padding: 2rem;
  background-color: white;
  border-radius: var(--border-radius);
  margin: 1.5rem;
  box-shadow: var(--box-shadow);
}

.catalog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #eee;
}

.catalog-header h1 {
  margin: 0;
  color: var(--primary-color);
  font-size: 1.8rem;
  font-weight: 700;
}

.results-count {
  color: #7f8c8d;
  font-size: 0.9rem;
  background-color: #f5f5f5;
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

/* Tarjetas de Producto Mejoradas */
.product-card {
  background: white;
  border-radius: var(--border-radius);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  transition: all 0.3s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid #eee;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.product-card img {
  width: 100%;
  height: 200px;
  object-fit: contain;
  display: block;
  background-color: #f9f9f9;
  padding: 1.5rem;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  transition: all 0.3s ease;
}

.product-card:hover img {
  transform: scale(1.03);
}

.product-info {
  padding: 1.2rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.product-info h3 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  color: var(--dark-color);
  font-weight: 600;
  line-height: 1.3;
}

.product-price {
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--primary-color);
  margin: 0.5rem 0;
}

.product-meta {
  font-size: 0.85rem;
  color: #666;
  margin: 0.3rem 0;
}

.stock-status {
  font-weight: bold;
  margin: 0.5rem 0;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  display: inline-block;
  font-size: 0.85rem;
  background-color: rgba(40, 167, 69, 0.1);
  color: #28a745;
  align-self: flex-start;
}

.stock-status.out-of-stock {
  background-color: rgba(220, 53, 69, 0.1);
  color: #dc3545;
}

.rating {
  display: flex;
  align-items: center;
  margin: 0.3rem 0;
  color: #f39c12;
  font-size: 0.9rem;
}

.rating i {
  margin-right: 0.3rem;
}

.product-actions {
  margin-top: auto;
  padding-top: 1rem;
}

.quantity-selector {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0.8rem 0;
  border: 1px solid #ddd;
  border-radius: 20px;
  padding: 0.4rem;
  background-color: #f9f9f9;
}

.quantity-selector button {
  background-color: #f0f0f0;
  color: var(--dark-color);
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  transition: all 0.2s ease;
}

.quantity-selector button:hover {
  background-color: #e0e0e0;
}

.quantity-selector span {
  min-width: 24px;
  text-align: center;
  font-weight: 500;
  font-size: 0.95rem;
}

.buy-now {
  margin-top: 0.5rem;
  padding: 0.7rem;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-size: 0.95rem;
  width: 100%;
  transition: all 0.3s ease;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.buy-now:hover {
  background-color: #003b8a;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 74, 173, 0.2);
}

.buy-now i {
  font-size: 0.9rem;
}

.out-of-stock-btn {
  background-color: #6c757d;
  color: white;
  border: none;
  border-radius: var(--border-radius);
  padding: 0.7rem;
  font-size: 0.9rem;
  width: 100%;
  margin-top: 0.5rem;
  cursor: not-allowed;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

/* No hay productos */
.no-products {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem;
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
}

.no-products i {
  font-size: 3rem;
  color: #bdc3c7;
  margin-bottom: 1rem;
}

.no-products p {
  color: #7f8c8d;
  font-size: 1.1rem;
  margin: 0;
}

/* Notificaciones */
.notification {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--success-color);
  color: white;
  padding: 1rem 2rem;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  display: flex;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  z-index: 1000;
}

.notification.show {
  opacity: 1;
  transform: translateX(-50%) translateY(-10px);
}

.notification.error {
  background-color: var(--accent-color);
}

.notification i {
  margin-right: 0.8rem;
  font-size: 1.2rem;
}

/* Efectos adicionales */
.product-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,0.03) 100%);
  z-index: 1;
  pointer-events: none;
}

.product-card:hover::before {
  background: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,0.05) 100%);
}

.buy-now {
  position: relative;
  overflow: hidden;
}

.buy-now::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -60%;
  width: 200%;
  height: 200%;
  background: rgba(255,255,255,0.1);
  transform: rotate(30deg);
  transition: all 0.3s ease;
}

.buy-now:hover::after {
  left: 100%;
}

/* Animación para el icono del carrito */
.animate-bounce {
  animation: bounce 0.5s;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

/* Footer */
.footer {
  background-color: var(--dark-color);
  color: white;
  padding: 2rem 0;
  text-align: center;
}

/* Responsividad */
@media (max-width: 1200px) {
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }
}

@media (max-width: 992px) {
  .filters-sidebar {
    position: fixed;
    top: 0;
    left: -250px;
    height: 100vh;
    z-index: 1000;
    width: 280px;
  }
  
  .filters-sidebar.active {
    left: 0;
  }
  
  .close-filters {
    display: block;
  }
  
  .toggle-filters {
    display: block;
  }
  
  .catalog {
    margin: 1rem;
    padding: 1.5rem;
  }
  
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }
}

@media (max-width: 768px) {
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.2rem;
  }
  
  .product-card img {
    height: 180px;
  }
  
  .catalog-header h1 {
    font-size: 1.5rem;
  }
}

@media (max-width: 576px) {
  .catalog {
    padding: 1rem;
    margin: 0.5rem;
  }
  
  .catalog-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
  
  .product-card img {
    height: 150px;
    padding: 1rem;
  }
  
  .product-info h3 {
    font-size: 1rem;
  }
  
  .product-price {
    font-size: 1.1rem;
  }
  
  .buy-now {
    font-size: 0.85rem;
    padding: 0.6rem;
  }
  
  .no-products {
    padding: 2rem 1rem;
  }
  
  .no-products i {
    font-size: 2.5rem;
  }
}

@media (max-width: 400px) {
  .product-grid {
    grid-template-columns: 1fr;
  }
  
  .product-card img {
    height: 180px;
  }
}