/* ===== ESTILOS GENERALES ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f5f5f5;
  color: #333;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.navbar {
  flex-shrink: 0;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  flex: 1;
  width: 100%;
}

footer {
  flex-shrink: 0;
}

/* ===== NAVBAR ===== */
.navbar {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 15px 0;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 24px;
  font-weight: bold;
}

.nav-links {
  display: flex;
  gap: 15px;
  align-items: center;
}

.search {
  padding: 8px 15px;
  border: none;
  border-radius: 20px;
  width: 300px;
  font-size: 14px;
}

.btn-carrito {
  background-color: rgba(255,255,255,0.2);
  color: white;
  padding: 10px 20px;
  text-decoration: none;
  border-radius: 20px;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 5px;
}

.btn-carrito:hover {
  background-color: rgba(255,255,255,0.3);
  transform: scale(1.05);
}

#carrito-count {
  background-color: #ff6b6b;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: bold;
  font-size: 12px;
}

/* ===== SECCIONES ===== */
.categorias-section {
  margin: 30px 0;
}

.categorias-section h2,
.productos-section h2 {
  font-size: 28px;
  margin-bottom: 20px;
  color: #667eea;
  text-align: center;
}

.categorias-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
  margin-bottom: 30px;
}

.categoria-btn {
  background: white;
  border: 2px solid #ddd;
  padding: 15px;
  text-align: center;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 14px;
  font-weight: 600;
}

.categoria-btn:hover,
.categoria-btn.active {
  border-color: #667eea;
  background-color: #f0f1ff;
  color: #667eea;
}

/* ===== PRODUCTOS ===== */
.productos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
}

.producto-card {
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: all 0.3s;
  position: relative;
}

.producto-card.descuento {
  border: 2px solid #e74c3c;
}

.descuento-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #e74c3c;
  color: white;
  padding: 6px 10px;
  border-radius: 6px;
  font-weight: bold;
  font-size: 0.8em;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.producto-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.producto-imagen {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 60px;
  color: white;
  overflow: hidden;
}

.producto-imagen img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #f0f1ff;
}

.producto-info {
  padding: 15px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.producto-info h3 {
  font-size: 18px;
  margin-bottom: 2px;
  color: #333;
}

.producto-info p {
  font-size: 13px;
  color: #666;
  margin-bottom: 10px;
}

.producto-precio {
  font-size: 24px;
  color: #667eea;
  font-weight: bold;
  margin: 0 0 10px 0;
}

.producto-stock {
  font-size: 12px;
  color: #666;
  margin-bottom: 10px;
}

.producto-acciones {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
  width: 100%;
}

.cantidad-control-mobile {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #f8f9fa;
  padding: 8px 12px;
  border-radius: 6px;
  width: 100%;
}

.btn-cantidad-mobile {
  background: #667eea;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 10px 16px;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-cantidad-mobile:hover {
  background: #5568d3;
  transform: scale(1.1);
}

.btn-cantidad-mobile:active {
  transform: scale(0.95);
}

.cantidad-display-mobile {
  font-weight: bold;
  font-size: 16px;
  min-width: 35px;
  text-align: center;
  color: #333;
}

.btn-cantidad {
  background: #667eea;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 10px 16px;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-cantidad:hover {
  background: #5568d3;
  transform: scale(1.1);
}

.btn-cantidad:active {
  transform: scale(0.95);
}

.cantidad-display {
  font-weight: bold;
  font-size: 16px;
  min-width: 35px;
  text-align: center;
  color: #333;
}

/* ===== BOTONES ===== */
.btn,
.btn-primary {
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s;
}

.btn {
  background-color: #667eea;
  color: white;
}

.btn:hover {
  background-color: #5568d3;
}

.btn-primary {
  background-color: #667eea;
  color: white;
  width: 100%;
  padding: 15px;
  font-size: 16px;
}

.btn-primary:hover {
  background-color: #5568d3;
}

.btn-pequeno {
  padding: 8px 15px;
  background-color: #667eea;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
}

.btn-agregar {
  background-color: #10b981;
  color: white;
  width: 100%;
}

.btn-agregar:hover {
  background-color: #059669;
}

/* ===== CARRITO ===== */
.carrito-section {
  background: white;
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.carrito-section h2 {
  font-size: 28px;
  margin-bottom: 20px;
  color: #667eea;
}

.carrito-vacio {
  text-align: center;
  padding: 40px 20px;
  color: #666;
}

.carrito-vacio p {
  font-size: 18px;
  margin-bottom: 20px;
}

.carrito-items-container {
  margin-bottom: 20px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.carrito-item-card {
  background: white;
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 15px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  align-items: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  text-align: center;
}

.item-producto {
  text-align: center;
}

.item-producto h3 {
  font-size: 16px;
  color: #333;
  margin-bottom: 8px;
}

.item-precio {
  font-size: 14px;
  color: #667eea;
  font-weight: bold;
}

.item-cantidad {
  display: flex;
  justify-content: center;
}

.cantidad-control {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #f8f9fa;
  padding: 8px 12px;
  border-radius: 6px;
}
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.item-subtotal p {
  margin: 4px 0;
  font-size: 13px;
}

.subtotal-valor {
  font-weight: bold;
  color: #667eea;
  font-size: 16px !important;
}

.item-accion {
  grid-column: 1 / -1;
}

.btn-eliminar {
  background-color: #ff6b6b;
  color: white;
  padding: 10px 15px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  width: 100%;
  font-weight: 600;
}

.btn-eliminar:hover {
  background-color: #ff5252;
}

/* ===== RESUMEN ===== */
.carrito-resumen {
  background-color: #f0f1ff;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.resumen-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #ddd;
}

.resumen-item:last-child {
  border-bottom: none;
}

.resumen-item.total {
  font-size: 18px;
  font-weight: bold;
  color: #667eea;
  border-top: 2px solid #667eea;
  border-bottom: none;
  margin-top: 15px;
  padding-top: 15px;
}

.input-cupon {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  width: 150px;
  margin-right: 8px;
}

/* ===== FORMULARIO PEDIDO ===== */
.formulario-pedido {
  background-color: white;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  border: 1px solid #eee;
}

.formulario-pedido h3 {
  font-size: 18px;
  margin-bottom: 15px;
  color: #333;
}

.formulario-pedido input {
  width: 100%;
  padding: 12px;
  margin-bottom: 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

/* ===== FOOTER ===== */
footer {
  background-color: #333;
  color: white;
  text-align: center;
  padding: 20px;
  margin-top: 40px;
  flex-shrink: 0;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .nav-links {
    flex-wrap: wrap;
    justify-content: center;
  }

  .search {
    width: 100%;
    order: 3;
  }

  .productos-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }

  .carrito-item-card {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .item-subtotal {
    text-align: left;
  }

  .item-accion {
    grid-column: 1;
  }

  .btn-cantidad {
    font-size: 18px;
    padding: 10px 14px;
    min-width: 40px;
    min-height: 40px;
  }

  .cantidad-display {
    font-size: 16px;
    min-width: 35px;
  }

  .formulario-pedido input {
    font-size: 16px;
  }

  .btn-cantidad-mobile {
    font-size: 20px;
    padding: 12px 18px;
  }

  .cantidad-display-mobile {
    font-size: 18px;
    min-width: 40px;
  }

  .producto-acciones {
    flex-direction: column;
    gap: 12px;
  }

  .cantidad-control-mobile {
    width: 100%;
  }

  .btn-agregar {
    width: 100%;
    font-size: 16px;
    padding: 14px !important;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 10px;
  }

  .navbar .container {
    flex-direction: column;
    gap: 10px;
  }

  .productos-grid {
    grid-template-columns: 1fr;
  }

  .carrito-resumen {
    padding: 15px;
  }
}
