/* ==========================================================================
   MEAT DELI CHILE - VERSIÓN MÓVIL DEDICADA (FONDO BLANCO GOURMET)
   Ultra Liviana • Alto Contraste • Cero Saturación
   ========================================================================== */

:root {
  --m-bg: #f8fafc;
  --m-surface: #ffffff;
  --m-card: #ffffff;
  --m-border: #e2e8f0;
  --m-red: #C72429;
  --m-gold: #b45309;
  --m-green: #15803d;
  --m-text-main: #0f172a;
  --m-text-muted: #64748b;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Montserrat', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-sans);
  background: var(--m-bg);
  color: var(--m-text-main);
  padding-bottom: 76px; /* Espacio para barra inferior */
  overflow-x: hidden;
}

/* ==========================================================================
   HEADER MÓVIL (BLANCO BRILLANTE & SIN MORADO EN EL LOGO)
   ========================================================================== */
.m-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #ffffff;
  border-bottom: 1px solid var(--m-border);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.m-brand,
.m-brand:visited,
.m-brand:hover,
.m-brand:active {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none !important;
  color: #0f172a !important;
}

.m-logo-img {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid #e2e8f0;
}

.m-logo-text {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 900;
  line-height: 1;
  color: #0f172a !important; /* Nunca morado */
}

.m-logo-text span {
  color: var(--m-red) !important;
}

.m-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.m-btn-icon {
  background: #f1f5f9;
  border: 1px solid var(--m-border);
  color: #0f172a;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
  cursor: pointer;
}

/* ==========================================================================
   BARRA DE INFORMACIÓN COMERCIAL B2B
   ========================================================================== */
.m-promo-strip {
  background: #f1f5f9;
  border-bottom: 1px solid var(--m-border);
  padding: 8px 16px;
  font-size: 0.75rem;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.m-promo-strip strong {
  color: #0f172a;
}

/* ==========================================================================
   HERO GOURMET MÓVIL LLAMATIVO
   ========================================================================== */
.m-hero-wrap {
  padding: 14px 16px 6px 16px;
}

.m-hero-card {
  background: linear-gradient(145deg, #0f172a 0%, #1e293b 60%, #450a0a 100%);
  border-radius: 20px;
  padding: 20px 18px;
  color: #ffffff;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.2);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
}

.m-hero-card::before {
  content: '';
  position: absolute;
  top: -50px;
  right: -50px;
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, rgba(199, 36, 41, 0.4) 0%, transparent 70%);
  pointer-events: none;
}

.m-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(245, 200, 66, 0.18);
  border: 1px solid #F5C842;
  color: #F5C842;
  font-size: 0.72rem;
  font-weight: 900;
  padding: 4px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.m-hero-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 900;
  line-height: 1.25;
  margin-bottom: 8px;
  color: #ffffff;
}

.m-hero-title span {
  color: #F5C842;
}

.m-hero-subtitle {
  font-size: 0.84rem;
  color: #cbd5e1;
  line-height: 1.5;
  margin-bottom: 14px;
  font-weight: 500;
}

.m-hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.m-hero-pill {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #f1f5f9;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 5px 9px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.m-hero-pill.green {
  background: rgba(37, 211, 102, 0.15);
  border-color: rgba(37, 211, 102, 0.4);
  color: #86efac;
}

.m-hero-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 0.76rem;
  color: #94a3b8;
}

.m-hero-cta-btn {
  background: var(--m-red);
  color: #ffffff;
  font-weight: 900;
  font-size: 0.78rem;
  padding: 6px 14px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(199, 36, 41, 0.4);
}

/* ==========================================================================
   BUSCADOR MÓVIL
   ========================================================================== */
.m-search-wrap {
  padding: 12px 16px;
  background: #ffffff;
  border-bottom: 1px solid var(--m-border);
}

.m-search-input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  color: #0f172a;
  font-size: 0.9rem;
  outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%2364748b' viewBox='0 0 24 24'%3E%3Cpath d='M10 2a8 8 0 0 1 6.32 12.906l5.387 5.387a1 1 0 0 1-1.414 1.414l-5.387-5.387A8 8 0 1 1 10 2zm0 2a6 6 0 1 0 0 12 6 6 0 0 0 0-12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 12px center;
  background-size: 16px;
}

.m-search-input:focus {
  border-color: var(--m-red);
  background: #ffffff;
}

/* ==========================================================================
   SELECTOR DE CLIENTE (TABS COMPACTOS)
   ========================================================================== */
.m-client-tabs {
  display: flex;
  gap: 8px;
  padding: 12px 16px 4px 16px;
}

.m-client-tab {
  flex: 1;
  padding: 10px 8px;
  border-radius: 12px;
  border: 1.5px solid var(--m-border);
  background: #ffffff;
  color: var(--m-text-muted);
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0,0,0,0.02);
}

.m-client-tab.active {
  background: #fff1f2;
  border-color: var(--m-red);
  color: var(--m-red);
}

.m-client-tab.particular.active {
  background: #fefce8;
  border-color: #eab308;
  color: #854d0e;
}

/* ==========================================================================
   TARJETAS DE PRODUCTO MÓVIL (FONDO BLANCO & ALTO CONTRASTE)
   ========================================================================== */
.m-products-section {
  padding: 16px;
}

.m-section-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 900;
  color: #0f172a;
  margin-bottom: 14px;
}

.m-products-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.m-product-card {
  background: #ffffff;
  border: 1.5px solid var(--m-border);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.m-product-img-wrap {
  width: 100%;
  height: 240px;
  background: #ffffff;
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border-bottom: 1px solid #f1f5f9;
}

.m-product-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.m-product-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: #0f172a;
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 6px;
}

.m-product-body {
  padding: 18px 16px;
}

.m-product-name {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 900;
  color: #0f172a;
  line-height: 1.3;
  margin-bottom: 4px;
}

.m-product-pres {
  font-size: 0.8rem;
  color: var(--m-text-muted);
  margin-bottom: 14px;
}

.m-pricing-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.m-price-neto {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--m-red);
}

.m-price-sub {
  font-size: 0.74rem;
  color: var(--m-text-muted);
}

.m-price-gain {
  text-align: right;
}

.m-gain-pill {
  background: #dcfce7;
  color: #15803d;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 800;
}

.m-card-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.m-stepper {
  display: flex;
  align-items: center;
  background: #f1f5f9;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  height: 48px;
  overflow: hidden;
}

.m-step-btn {
  background: transparent;
  border: none;
  color: #0f172a;
  width: 38px;
  height: 100%;
  font-size: 1.3rem;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.m-step-input {
  width: 44px;
  height: 100%;
  text-align: center;
  font-weight: 900;
  font-size: 1.05rem;
  color: #0f172a;
  background: #ffffff;
  border: none;
  border-left: 1px solid #e2e8f0;
  border-right: 1px solid #e2e8f0;
  outline: none;
  -moz-appearance: textfield;
  padding: 0;
  font-family: inherit;
}

.m-step-input::-webkit-outer-spin-button,
.m-step-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.m-step-val {
  width: 32px;
  text-align: center;
  font-weight: 800;
  font-size: 1rem;
  color: #0f172a;
}

.m-btn-add {
  flex: 1;
  height: 48px;
  background: var(--m-red);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-weight: 900;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(199, 36, 41, 0.25);
}

.m-btn-spec {
  width: 100%;
  margin-top: 10px;
  padding: 10px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: #475569;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
}

/* ==========================================================================
   BARRA INFERIOR FIJA (APP BOTTOM BAR - BLANCA & NÍTIDA)
   ========================================================================== */
.m-bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: center;
  z-index: 1000;
  padding: 0 4px;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.06);
}

.m-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: transparent;
  border: none;
  color: #64748b;
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
  position: relative;
  height: 100%;
}

.m-nav-btn.active,
.m-nav-btn:active {
  color: var(--m-red);
}

.m-nav-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.m-nav-badge {
  position: absolute;
  top: 6px;
  right: calc(50% - 16px);
  background: var(--m-red);
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 900;
  padding: 1px 5px;
  border-radius: 999px;
}

/* ==========================================================================
   MODAL / BOTTOM SHEET DE CARRITO MÓVIL
   ========================================================================== */
.m-modal-sheet {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2000;
  display: none;
  align-items: flex-end;
}

.m-modal-sheet.open {
  display: flex;
}

.m-sheet-content {
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  border-radius: 24px 24px 0 0;
  width: 100%;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 0.25s ease-out;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.m-sheet-header {
  padding: 16px 20px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.m-sheet-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 900;
  color: #0f172a;
}

.m-sheet-close {
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 1.6rem;
  cursor: pointer;
}

.m-sheet-body {
  padding: 18px 20px;
  overflow-y: auto;
  flex: 1;
}

.m-cart-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #f1f5f9;
}

.m-cart-thumb {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  background: #fff;
  padding: 2px;
  border: 1px solid #e2e8f0;
  object-fit: contain;
}

.m-cart-details {
  flex: 1;
}

.m-cart-name {
  font-size: 0.88rem;
  font-weight: 800;
  color: #0f172a;
}

.m-cart-unit-price {
  font-size: 0.75rem;
  color: #64748b;
}

.m-cart-total-price {
  font-weight: 900;
  color: var(--m-red);
  font-size: 0.95rem;
}

.m-sheet-footer {
  padding: 16px 20px 24px 20px;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
}

.m-summary-line {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  margin-bottom: 6px;
  color: #475569;
}

.m-summary-total {
  font-size: 1.2rem;
  font-weight: 900;
  color: #0f172a;
  border-top: 1px dashed #cbd5e1;
  padding-top: 8px;
  margin-top: 8px;
}

.m-btn-checkout {
  width: 100%;
  padding: 14px;
  background: #25D366;
  color: #ffffff;
  border: none;
  border-radius: 12px;
  font-weight: 900;
  font-size: 1rem;
  margin-top: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.3);
}

/* Ocultar cualquier botón flotante antiguo en móvil */
#btn-whatsapp-floating,
.whatsapp-float-btn,
.whatsapp-float-tooltip {
  display: none !important;
}

/* ==========================================================================
   COMPONENTES 21ST.DEV & MEJORAS DE EXPERIENCIA MÓVIL (MEAT DELI)
   ========================================================================== */

/* 1. Dynamic Toast (Estilo Sonner / Dynamic Island) */
.m-toast {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #ffffff;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.35), 0 2px 6px rgba(0,0,0,0.2);
  opacity: 0;
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.m-toast.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

/* 2. Floating Quick Cart Dock (21st.dev Floating Dock) */
.m-floating-cart-dock {
  position: fixed;
  bottom: 74px;
  left: 16px;
  right: 16px;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.4), 0 2px 8px rgba(0,0,0,0.2);
  z-index: 990;
  transform: translateY(120px);
  opacity: 0;
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.m-floating-cart-dock.visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.m-dock-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.m-dock-badge {
  background: var(--m-red);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 900;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(199, 36, 41, 0.4);
}

.m-dock-text-title {
  font-size: 0.82rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.2;
}

.m-dock-text-sub {
  font-size: 0.72rem;
  color: #94a3b8;
  font-weight: 600;
}

.m-dock-btn {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: #052e16;
  border: none;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 900;
  padding: 8px 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.35);
  animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
}

/* 3. Carrusel de Chips de Categorías (Horizontal Scroll Pills) */
.m-category-chips-wrap {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 16px 12px 16px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.m-category-chips-wrap::-webkit-scrollbar {
  display: none;
}

.m-category-chip {
  flex-shrink: 0;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 0.78rem;
  font-weight: 800;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.m-category-chip.active {
  background: #0f172a;
  border-color: #0f172a;
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.2);
}

/* Micro-interacciones táctiles */
.m-btn-add:active,
.m-dock-btn:active,
.m-category-chip:active,
.m-client-tab:active {
  transform: scale(0.96);
  transition: transform 0.1s ease;
}
