* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Segoe UI', sans-serif; scroll-behavior: smooth; }
body { background: #F5F0E6; color: #3E2723; overflow-x: hidden; }

/* BARRA SUPERIOR */
.top-bar {
  background: #3E2723; color: #D7CCC8; text-align: center;
  padding: 8px; font-size: 0.85rem; font-weight: 500;
}

/* HEADER PRINCIPAL */
.header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; padding: 15px 30px; background: #FFFDF8;
  box-shadow: 0 2px 10px rgba(62, 39, 35, 0.05); flex-wrap: wrap;
  position: sticky; top: 0; z-index: 90;
}
.logo { font-size: 1.6rem; font-weight: 800; color: #3E2723; }

/* BUSCADOR */
.search-bar {
  display: flex; flex: 1; max-width: 600px; background: #F5F0E6;
  border: 2px solid #D7CCC8; border-radius: 30px; overflow: hidden;
}
.search-bar input {
  flex: 1; padding: 12px 20px; border: none; outline: none;
  background: transparent; color: #3E2723; font-size: 1rem;
}
.search-bar input::placeholder { color: #8D6E63; }
.search-btn {
  background: #8D6E63; border: none; padding: 0 20px;
  color: #FFFDF8; cursor: pointer; font-size: 1.1rem; transition: .2s;
}
.search-btn:hover { background: #6D4C41; }

/* CARRITO */
.header-actions { display: flex; align-items: center; }
.cart-btn {
  background: #3E2723; border: none; padding: 12px 20px; border-radius: 30px;
  color: #FFFDF8; cursor: pointer; font-size: 1.1rem; font-weight: bold;
  display: flex; align-items: center; gap: 8px; transition: .2s;
}
.cart-btn:hover { background: #8D6E63; }

/* NAV */
.nav-categories {
  display: flex; justify-content: center; gap: 10px;
  background: #FFFDF8; padding: 15px; border-bottom: 1px solid #EFEBE9;
  flex-wrap: wrap; position: sticky; top: 73px; z-index: 80;
}
.nav-btn {
  background: transparent; border: 1px solid #D7CCC8; color: #5D4037;
  padding: 8px 20px; border-radius: 30px; cursor: pointer; font-weight: 600;
  transition: .2s; font-size: 0.95rem;
}
.nav-btn:hover, .nav-btn.active { 
  background: #8D6E63; border-color: #8D6E63; color: #FFFDF8; 
}

/* HERO */
.hero {
  background: linear-gradient(rgba(62, 39, 35, 0.7), rgba(62, 39, 35, 0.7)), url('https://images.unsplash.com/photo-1556905055-8f358a7a47b2?w=1200');
  background-size: cover; background-position: center;
  padding: 80px 20px; text-align: center; color: #FFFDF8;
}
.hero h1 { font-size: 2.5rem; margin-bottom: 15px; font-weight: 800; }
.hero p { font-size: 1.2rem; margin-bottom: 25px; color: #D7CCC8; }
.hero-btn {
  background: #8D6E63; color: #FFFDF8; border: none; text-decoration: none;
  padding: 12px 30px; border-radius: 30px; font-size: 1.1rem;
  font-weight: bold; cursor: pointer; transition: .2s; display: inline-block;
}
.hero-btn:hover { background: #6D4C41; transform: scale(1.05); }

/* PRODUCTOS */
.section-title { text-align: center; margin: 50px 0 20px; font-size: 2rem; color: #3E2723; }
.products {
  display: grid; gap: 25px; padding: 0 40px 60px;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}
.card {
  background: #FFFDF8; border-radius: 16px; overflow: hidden;
  box-shadow: 0 6px 20px rgba(62, 39, 35, 0.06); transition: transform .3s;
  display: flex; flex-direction: column; border: 1px solid #EFEBE9;
}
.card:hover { transform: translateY(-8px); box-shadow: 0 12px 25px rgba(62, 39, 35, 0.12); }
.card img { width: 100%; height: 220px; object-fit: cover; background: #EFEBE9; }
.card-body { padding: 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card-body h3 { font-size: 1.1rem; color: #3E2723; line-height: 1.3; }
.card-body .cat { font-size: .8rem; color: #8D6E63; text-transform: uppercase; font-weight: 700; letter-spacing: 1px;}
.card-body .price { font-weight: 800; font-size: 1.3rem; color: #3E2723; margin-top: auto; }
.card-body button {
  background: #FFFDF8; color: #3E2723; border: 2px solid #3E2723;
  padding: 12px; border-radius: 8px; cursor: pointer; transition: .2s; 
  font-weight: 700; font-size: 1rem;
}
.card-body button:hover { background: #3E2723; color: #FFFDF8; }

/* CARRITO LATERAL */
.cart-panel {
  position: fixed; top: 0; right: -400px; width: 400px; height: 100%;
  background: #FFFDF8; box-shadow: -4px 0 25px rgba(62, 39, 35, 0.2);
  transition: right .3s; display: flex; flex-direction: column; z-index: 200;
}
.cart-panel.open { right: 0; }
.cart-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px; border-bottom: 1px solid #D7CCC8;
}
.cart-header h3 { color: #3E2723; font-size: 1.3rem; }
.cart-header button { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: #8D6E63; }
.cart-items { flex: 1; overflow-y: auto; padding: 20px; }
.cart-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 15px 0; border-bottom: 1px dashed #D7CCC8; gap: 10px;
}
.cart-item div { font-weight: 600; color: #3E2723; }
.cart-item small { color: #8D6E63; display: block; margin-top: 5px; font-weight: normal; }
.cart-item button { background: #BCAAA4; color: #FFFDF8; border: none; border-radius: 6px; padding: 6px 10px; cursor: pointer; transition: .2s; font-weight: bold;}
.cart-item button:hover { background: #8D6E63; }

/* CONTROLES DE CANTIDAD */
.qty-controls { display: flex; align-items: center; gap: 10px; margin-top: 5px; }
.qty-btn { 
  background: #EFEBE9 !important; color: #3E2723 !important; 
  border: 1px solid #D7CCC8 !important; border-radius: 4px !important;
  width: 28px; height: 28px; font-size: 1.1rem; display: flex; 
  align-items: center; justify-content: center; cursor: pointer; 
}
.qty-btn:hover { background: #D7CCC8 !important; }
.qty-num { font-weight: bold; font-size: 1rem; min-width: 20px; text-align: center; }

.cart-footer { padding: 20px; border-top: 1px solid #D7CCC8; background: #F5F0E6; }
.cart-footer p { font-size: 1.2rem; color: #3E2723; margin-bottom: 15px; }
.checkout-btn {
  width: 100%; background: #8D6E63; color: #FFFDF8;
  border: none; padding: 15px; border-radius: 8px; cursor: pointer; font-size: 1.1rem;
  font-weight: bold; transition: .2s;
}
.checkout-btn:hover { background: #3E2723; }

/* OVERLAY */
.overlay {
  position: fixed; inset: 0; background: rgba(62, 39, 35, 0.6);
  opacity: 0; pointer-events: none; transition: .3s; z-index: 150;
}
.overlay.show { opacity: 1; pointer-events: all; }

/* BOTÓN FLOTANTE WHATSAPP */
.whatsapp-float {
  position: fixed; bottom: 30px; right: 30px;
  background: #25D366; width: 60px; height: 60px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4); z-index: 300;
  transition: transform .3s; text-decoration: none;
}
.whatsapp-float:hover { transform: scale(1.1); }

/* FOOTER */
.footer { background: #3E2723; color: #D7CCC8; padding: 50px 20px 20px; border-top: 4px solid #8D6E63; }
.footer-content { display: flex; justify-content: space-around; flex-wrap: wrap; gap: 30px; max-width: 1000px; margin: 0 auto; }
.footer h4 { color: #FFFDF8; margin-bottom: 15px; font-size: 1.1rem; }
.footer a { color: #D7CCC8; text-decoration: none; transition: .2s; }
.footer a:hover { color: #FFFDF8; text-decoration: underline; }
.footer p { margin-bottom: 8px; }
.footer-bottom { text-align: center; margin-top: 40px; padding-top: 20px; border-top: 1px solid #5D4037; font-size: 0.9rem; color: #BCAAA4; }

/* MODALES LEGALES */
.modal {
  display: none; position: fixed; z-index: 500; left: 0; top: 0;
  width: 100%; height: 100%; background-color: rgba(62, 39, 35, 0.8);
  align-items: center; justify-content: center; padding: 20px;
}
.modal.show { display: flex; }
.modal-content {
  background-color: #FFFDF8; padding: 30px; border-radius: 12px;
  max-width: 600px; width: 100%; max-height: 80vh; overflow-y: auto;
  position: relative; box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}
.close-btn {
  position: absolute; top: 15px; right: 20px; font-size: 1.5rem;
  cursor: pointer; color: #8D6E63; font-weight: bold;
}
.close-btn:hover { color: #3E2723; }
.modal-content h2 { color: #3E2723; margin-bottom: 15px; border-bottom: 2px solid #D7CCC8; padding-bottom: 10px; }
.modal-content ul { margin-left: 20px; margin-bottom: 15px; line-height: 1.6; }
.modal-content p { line-height: 1.6; margin-bottom: 10px; color: #5D4037; }

/* ================= RESPONSIVE DESIGN ================= */
@media (max-width: 1024px) {
  .header { padding: 15px 20px; }
  .hero h1 { font-size: 2.2rem; }
  .products { padding: 0 25px 50px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
}

@media (max-width: 768px) {
  .header { flex-direction: column; align-items: stretch; gap: 15px; }
  .search-bar { max-width: 100%; }
  .cart-btn { justify-content: center; }
  .nav-categories { top: auto; position: static; padding: 10px; }
  .nav-btn { padding: 6px 15px; font-size: 0.85rem; flex: 1; text-align: center; }
  .hero { padding: 50px 20px; }
  .hero h1 { font-size: 1.8rem; }
  .hero p { font-size: 1rem; }
  .section-title { font-size: 1.6rem; margin: 30px 0 15px; }
  .products { padding: 0 15px 40px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 15px; }
  .card img { height: 160px; }
  .card-body { padding: 15px; }
  .card-body h3 { font-size: 0.95rem; }
  .card-body .price { font-size: 1.1rem; }
  .cart-panel { width: 100%; right: -100%; }
  .whatsapp-float { bottom: 20px; right: 20px; width: 50px; height: 50px; }
  .whatsapp-float svg { width: 28px; height: 28px; }
}

@media (max-width: 480px) {
  .logo { font-size: 1.3rem; text-align: center; }
  .hero h1 { font-size: 1.5rem; }
  .products { grid-template-columns: 1fr; } /* Una tarjeta por fila en celulares pequeños */
  .card img { height: 200px; }
  .footer-content { flex-direction: column; text-align: center; }
}