@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* === BODY === */
body {
  
  overflow-y: auto;
  -webkit-overflow-scrolling: touch; /* Habilita el scroll inercial en iOS */
  position: relative;
  min-height: 100vh;
}

/* === APP CONTAINER === */
.app-container {
  max-width: 500px;
  margin: 0 auto;
  background: rgb(255, 255, 255);
  min-height: 100vh;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  border-radius: 16px;
  overflow: visible; /* ← clave: no cortar el overflow */
  position: relative;
}

/* === PRODUCTOS === */
.products-grid {
  padding: 12px 16px 80px;
  display: grid;
  gap: 16px;
  -webkit-overflow-scrolling: touch;
  overflow-y: auto;
  height: auto;
  max-height: none;
}
/* === HEADER MEJORADO === */
.app-header {
  background: #47A992;
  color: white;
  padding: 24px 20px 16px;
  text-align: center;
  border-bottom: none;
  position: relative;
}

.app-header h1 {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.app-header p {
  font-size: 0.9rem;
  opacity: 0.9;
  margin-top: 4px;
}

/* === BÚSQUEDA CON ICONO === */
.search-box {
  padding: 15px;
  position: relative;
}

.search-box input {
  width: 100%;
  padding: 14px 16px 14px 45px;
  border: 1px solid #ddd;
  border-radius: 14px;
  font-size: 1rem;
  outline: none;
  transition: all 0.3s ease;
}

.search-box input:focus {
  border-color: #47A992;

}

.search-box::before {
  content: "";
  position: absolute;
  left: 32px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
  color: #E8FFD7;
}

/* === CATEGORÍAS CON SCROLL SUAVE === */
.categories {
  display: flex;
  overflow-x: auto;
  gap: 12px;
  padding: 12px 16px;
  background: #f1f3f5;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.categories::-webkit-scrollbar {
  display: none;
}

.cat-btn {
  background: #47A992;
  border: none;
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  color: #ffffff;
}

.cat-btn.active {
  background: #EF9651;
  color: white;
  font-weight: 600;
}

.cat-btn:hover {
  background: #47A992;
  color: white;
}

/* === PRODUCTOS CON SOMBRAS MEJORADAS === */
.products-grid {
  padding: 12px 16px 80px;
  display: grid;
  gap: 16px;
}

.product-card {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid #f0f0f0;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.product-card img {
  width: 100%;
  height: 190px;
  object-fit: cover;
  border-bottom: 1px solid #eee;
}

.product-card h3 {
    background: #f7f7fa;
  padding: 12px 16px 6px;
  font-size: 1.1rem;
  font-weight: 600;
  color: #1a1a1a;
}

.price {
  color: #93DA97;
  font-weight: 700;
  font-size: 1.25rem;
  padding: 0 16px 6px;
}

.desc {

  padding: 0 16px 10px;
  color: #666;
  font-size: 0.9rem;
  line-height: 1.4;
}

.btn-wsp {
  background: #EF9651;
  color: #ffffff;
  border: none;
  width: 100%;
  padding: 13px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border-top: 1px solid #E8FFD7;
  border-radius: 0 0 16px 16px;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-wsp:hover {
  background: #47A992;
}

.btn-wsp::before {
  content: "🛒";
}

/* === CARRITO FLOTANTE MEJORADO === */
.cart-icon {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #EF9651;
  color: white;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  box-shadow: 0 6px 16px rgba(37, 211, 102, 0.4);
  cursor: pointer;
  z-index: 100;
  animation: pulse 2s infinite;
  touch-action: manipulation;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(225, 227, 226, 0.7); }
  70% { box-shadow: 0 0 0 10px rgba(37, 211, 102, 0); }
  100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

#cartCount {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #e74c3c;
  color: white;
  font-size: 0.75rem;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

/* === PANEL DEL CARRITO CON SCROLL === */
.cart-panel {
  position: fixed;
  bottom: 0;
  right: 15px;
  width: calc(100% - 30px);
  max-width: 470px;
  height: 75vh;
  background: white;
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.2);
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  z-index: 101;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.cart-panel.open {
  transform: translateY(0);
}

.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 16px;
  background: #47A992;
  color: white;
  font-weight: 600;
  font-size: 1.1rem;
}

.cart-header button {
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
}

.cart-items {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  background: #fafafa;
  -webkit-overflow-scrolling: touch;
}

.cart-item {
  
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1.2px dashed #601515;
  font-size: 0.95rem;
}

.cart-item strong {
  
  font-size: 1.2rem;
}

.cart-item button {
  background: #cc1c08;
  color: rgb(217, 216, 216);
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
/* NUEVO: Estilos para controles de cantidad */
.quantity-controls {
  
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.quantity-controls button {
  background: #E1AA36;
  color: white;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quantity-controls button:hover {
  background: #47A992;
}

.quantity-controls span {
  font-weight: 600;
}

.cart-footer {
  padding: 16px;
  background: white;
  border-top: 1px solid #eee;
}

.btn-wsp-full {
  background: #7ADAA5;
  color: white;
  border: none;
  width: 100%;
  padding: 15px;
  font-size: 1.05rem;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-wsp-full::before {
  content: "💬";
}

.btn-wsp-full:hover {
  background: #58a96d;
}

/* === MENÚ DEL CLIENTE === */
.client-actions {
  padding: 12px 16px;
  text-align: center;
  position: relative;
  z-index: 90; /* Menor que el carrito, pero visible */
}

.btn-client {
  background: #47A992;
  color: white;
  border: none;
  padding: 12px 20px;
  font-size: 0.95rem;
  border-radius: 22px;
  cursor: pointer;

  max-width: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 500;
  z-index: 90;

  touch-action: manipulation; /* Permite toque en iOS */
}

.client-menu {
  position: fixed;
  bottom: 0;
  left: 15px;
  width: calc(100% - 30px);
  max-width: 470px;
  background: white;
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.2);
  transform: translateY(100%);
  transition: transform 0.4s ease;
  z-index: 110; /* Mayor que otros elementos */
  overflow: hidden;
  display: none; /* Empieza oculto */
}

.client-menu.open {
  display: block;
  transform: translateY(0);
}

.client-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px;
  background: #47A992;
  color: white;
  font-weight: 600;
}

.client-form {
  padding: 20px;
}

.client-form input,
.client-form textarea {
  width: 100%;
  padding: 14px;
  margin: 10px 0;
  border: 1px solid #ddd;
  border-radius: 10px;
  font-size: 1rem;
  transition: border 0.2s;
}

.client-form input:focus,
.client-form textarea:focus {
  border-color: #E1AA36;
  outline: none;
}

.client-form textarea {
  height: 80px;
  resize: vertical;
}
.tabbar{position:sticky; bottom:0; z-index:40; background:#47A992;}
.tabbar .inner{display:flex; justify-content:space-around; align-items:center; padding:10px 6px}
.tab{display:flex; flex-direction:column; align-items:center; gap:6px; font-size:12px; padding:6px 10px; border-radius:14px}
.tab.active{font-weight:800}
.footer{background:#E1AA36; padding:24px; text-align:center; color:#e5e7eb; border-top:1px solid #eee}
.form input, .form select, .form textarea{width:100%; padding:12px 14px; border:1px solid #e5e7eb; border-radius:14px; background:#fff}
.form .row{display:grid; grid-template-columns:1fr 1fr; gap:12px}
.table{width:100%; border-collapse:collapse; background:#fff; border-radius:14px; overflow:hidden; box-shadow:var(--shadow)}
.table th,.table td{padding:10px 12px; border-bottom:1px solid #f0f0f0; text-align:left}
.alert{background:#ecfccb; padding:12px; border-left:4px solid #47A992; border-radius:10px; margin:10px 0}
.err{background:#fee2e2; border-left:4px solid #ef4444}
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
/* === FOOTER === */


.app-footer {
  text-align: center;
  padding: 16px;
  font-size: 0.8rem;
  color: #888;
  background: #f8f9fa;
  border-top: 1px solid #eee;
}

/* === BOTONES DE USUARIO === */
.client-actions {
  padding: 12px 16px;
  text-align: center;
}


.btn-client::before {
  content: "👤";
}

.call-btn {
  display: block;
  text-align: center;
  margin: 12px 16px;
  padding: 14px;
  background: #0077B6;
  color: white;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.call-btn::before {
  content: "📞";
}

/* === MODAL OVERLAY === */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 100;
  display: none;
  backdrop-filter: blur(2px);
}

.overlay.active {
  display: block;
}

/* === RESPONSIVE === */
@media (max-width: 520px) {
  .app-container {
    border-radius: 0;
    max-width: 100%;
    height: 100vh;
  }
  .cart-panel,
  .client-menu {
    width: 100%;
    left: 0;
    right: 0;
    margin: 0;
    border-radius: 16px 16px 0 0;
  }
}
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #47A992;
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 1rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  z-index: 200;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
}