/* ========== styles.css ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: #f7f5f2;
  color: #1e1e1e;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ========== BARRA DE NAVEGACIÓN ========== */
.navbar {
  background: #1e1e1e;
  padding: 0.8rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.nav-logo a {
  color: #f0a500;
  font-size: 1.6rem;
  font-weight: 800;
  text-decoration: none;
  letter-spacing: -0.5px;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.nav-menu li a {
  color: #e0e0e0;
  text-decoration: none;
  padding: 0.5rem 1.2rem;
  border-radius: 40px;
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.2s;
}

.nav-menu li a:hover {
  background: #333;
  color: white;
}

.nav-menu li a.active {
  background: #f0a500;
  color: #1e1e1e;
}

.nav-cart {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: #333;
  padding: 0.3rem 0.8rem 0.3rem 0.5rem;
  border-radius: 40px;
  color: white;
  font-weight: 500;
  font-size: 0.9rem;
}

.cart-icon {
  font-size: 1.2rem;
}

.cart-count {
  background: #f0a500;
  color: #1e1e1e;
  padding: 0.05rem 0.5rem;
  border-radius: 40px;
  font-weight: 700;
  font-size: 0.8rem;
  min-width: 20px;
  text-align: center;
}

/* ========== CONTENIDO PRINCIPAL ========== */
.main-content {
  flex: 1;
  padding: 2rem 1.5rem;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
}

/* ========== SECCIÓN DE BIENVENIDA (index) ========== */
.welcome-section {
  background: white;
  padding: 3rem 2rem;
  border-radius: 20px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.welcome-section h1 {
  font-size: 2.5rem;
  color: #1e1e1e;
  margin-bottom: 0.5rem;
}

.welcome-section > p {
  color: #5a5a5a;
  font-size: 1.1rem;
  margin-bottom: 2.5rem;
}

.category-preview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-top: 1rem;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.preview-card {
  background: #f7f5f2;
  padding: 2.5rem 1.5rem;
  border-radius: 16px;
  transition: transform 0.2s;
}

.preview-card:hover {
  transform: translateY(-4px);
}

.preview-card h3 {
  font-size: 1.5rem;
  margin-bottom: 0.3rem;
}

.preview-card p {
  color: #5a5a5a;
  margin-bottom: 1rem;
}

.preview-btn {
  display: inline-block;
  background: #1e1e1e;
  color: white;
  text-decoration: none;
  padding: 0.6rem 2rem;
  border-radius: 40px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: background 0.2s;
}

.preview-btn:hover {
  background: #f0a500;
  color: #1e1e1e;
}

/* ========== ENCABEZADO DE SECCIÓN ========== */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 0.5rem;
  border-bottom: 3px solid #f0a500;
}

.section-header h2 {
  font-size: 2.2rem;
  font-weight: 700;
}

.section-header .product-count {
  background: #f0a500;
  color: #1e1e1e;
  padding: 0.2rem 1.2rem;
  border-radius: 40px;
  font-weight: 600;
  font-size: 1rem;
}

/* ========== CUADRÍCULA DE PRODUCTOS ========== */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2.5rem;
  margin-bottom: 2rem;
}

/* ========== TARJETA DE PRODUCTO ========== */
.product-card {
  background: white;
  border-radius: 24px;
  padding: 1.5rem 1.2rem 1.5rem;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.04);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  border: 1px solid #ebebeb;
}

.product-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.08);
  border-color: #f0a500;
}

/* ========== IMAGEN DEL PRODUCTO ========== */
.product-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #f0eee9;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  overflow: hidden;
  position: relative;
  min-height: 250px;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.product-card:hover .product-image img {
  transform: scale(1.03);
}

.product-image .placeholder {
  color: #9a9a9a;
  font-size: 0.9rem;
  text-align: center;
  padding: 1rem;
}

.product-name {
  font-weight: 700;
  font-size: 1.2rem;
  margin: 0.2rem 0 0.1rem;
}

.product-price {
  font-weight: 600;
  color: #1e1e1e;
  background: #f0eee9;
  padding: 0.2rem 1rem;
  border-radius: 40px;
  font-size: 1rem;
  margin: 0.3rem 0 0.2rem;
}

.product-tag {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: #1e1e1e;
  color: white;
  padding: 0.2rem 0.9rem;
  border-radius: 30px;
  margin-top: 0.2rem;
}

.btn-add {
  margin-top: 0.8rem;
  background: #1e1e1e;
  border: none;
  color: white;
  font-weight: 600;
  padding: 0.6rem 1.8rem;
  border-radius: 40px;
  cursor: pointer;
  transition: background 0.15s;
  font-size: 0.9rem;
  letter-spacing: 0.3px;
  width: 100%;
  max-width: 180px;
}

.btn-add:hover {
  background: #f0a500;
  color: #1e1e1e;
}

.btn-add:active {
  transform: scale(0.96);
}

/* ========== FOOTER ========== */
.store-footer {
  background: #1e1e1e;
  color: #aaa;
  padding: 1.5rem 0;
  margin-top: auto;
}

.store-footer .container {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0 1.5rem;
  font-size: 0.9rem;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 2rem;
  }
}

@media (max-width: 768px) {
  .nav-container {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  
  .nav-menu {
    justify-content: center;
  }
  
  .nav-menu li a {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
  }
  
  .nav-cart {
    align-self: center;
  }
  
  .welcome-section h1 {
    font-size: 2rem;
  }
  
  .category-preview {
    grid-template-columns: 1fr;
    max-width: 350px;
    margin: 0 auto;
  }
  
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
  }
  
  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
  }
  
  .section-header h2 {
    font-size: 1.8rem;
  }
  
  .product-image {
    min-height: 200px;
  }
  
  .store-footer .container {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .nav-menu {
    flex-wrap: wrap;
    gap: 0.2rem;
  }
  
  .nav-menu li a {
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
  }
  
  .nav-logo a {
    font-size: 1.2rem;
  }
  
  .product-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }
  
  .product-card {
    padding: 1rem 0.8rem 1rem;
  }
  
  .product-image {
    min-height: 150px;
  }
  
  .product-name {
    font-size: 1rem;
  }
  
  .btn-add {
    font-size: 0.8rem;
    padding: 0.4rem 1rem;
    max-width: 140px;
  }
}