/* ==========================================================================
   DESIGN SYSTEM SaaS & EDITORIAL B2B — Menú Digital QR + Pedidos WhatsApp
   Optimizado para velocidad extrema (<0.35s LCP) en España y Latinoamérica
   ========================================================================== */
:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-dark: #0f172a;
  --wa-green: #16a34a;
  --wa-green-dark: #15803d;
  --wa-bright: #25d366;
  --wa-soft: #dcfce7;
  --accent-amber: #ea580c;
  --danger-soft: #fef2f2;
  --danger: #dc2626;
  --text: #0f172a;
  --text-muted: #475569;
  --border: #e2e8f0;
  --radius: 16px;
  --shadow-sm: 0 2px 10px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 16px 40px rgba(15, 23, 42, 0.10);
  --max-w: 1120px;
  --read-w: 780px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 16.5px;
}

a { color: var(--wa-green-dark); }
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 20px; }
.reading-col { max-width: var(--read-w); margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 66px;
  gap: 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}
.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #16a34a, #059669);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 0.95rem;
}
.nav-links { display: flex; align-items: center; gap: 20px; }
.nav-links a { text-decoration: none; color: var(--text-muted); font-weight: 600; font-size: 0.93rem; }
.nav-links a:hover { color: var(--wa-green-dark); }
.btn-top {
  background: var(--wa-green);
  color: #fff !important;
  padding: 9px 16px;
  border-radius: 999px;
  font-weight: 700 !important;
  font-size: 0.88rem !important;
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.25);
}
@media (max-width: 760px) {
  .nav-links a:not(.btn-top) { display: none; }
}

/* Typography & Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--wa-soft);
  color: #166534;
  font-weight: 800;
  font-size: 0.8rem;
  padding: 5px 12px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 14px;
}
h1 {
  font-size: clamp(1.9rem, 3.8vw, 2.85rem);
  line-height: 1.14;
  letter-spacing: -0.03em;
  margin: 0 0 16px;
}
h2 {
  font-size: clamp(1.45rem, 2.6vw, 2rem);
  line-height: 1.22;
  letter-spacing: -0.02em;
  margin: 40px 0 14px;
}
h3 { font-size: 1.2rem; margin: 24px 0 8px; }
.lead { font-size: 1.12rem; color: var(--text-muted); margin: 0 0 24px; }

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--wa-green);
  color: #fff !important;
  text-decoration: none !important;
  font-weight: 800;
  font-size: 1.06rem;
  padding: 16px 28px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(22, 163, 74, 0.30);
  transition: transform 0.15s ease, background 0.15s ease;
  text-align: center;
}
.btn-primary:hover { background: var(--wa-green-dark); transform: translateY(-2px); }
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #0f172a;
  color: #fff !important;
  text-decoration: none !important;
  font-weight: 700;
  font-size: 0.98rem;
  padding: 14px 22px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
}
.btn-full { width: 100%; }

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 8px 24px rgba(22, 163, 74, 0.32); }
  50% { box-shadow: 0 12px 34px rgba(22, 163, 74, 0.58); }
}
.pulse { animation: pulseGlow 2.1s infinite; }

/* ==========================================================================
   FREE MEGA-VOLUME QR & WHATSAPP TOOL BOX (Home Hero)
   ========================================================================== */
.hero-tool-section {
  background: radial-gradient(circle at top right, #dcfce7 0%, #f8fafc 55%);
  padding: 42px 0 54px;
  border-bottom: 1px solid var(--border);
}
.tool-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  margin-top: 24px;
}
.tool-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: #f1f5f9;
  border-bottom: 1px solid var(--border);
}
@media (max-width: 680px) { .tool-tabs { grid-template-columns: 1fr; } }
.tool-tab {
  padding: 15px 14px;
  border: none;
  background: transparent;
  font-weight: 700;
  font-size: 0.94rem;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.15s;
}
.tool-tab.active {
  background: var(--surface);
  color: var(--wa-green-dark);
  border-bottom-color: var(--wa-green);
}
.tool-tab-pro { color: #b45309; }
.tool-body {
  display: grid;
  grid-template-columns: 1.25fr 0.85fr;
  gap: 28px;
  padding: 28px;
  align-items: start;
}
@media (max-width: 820px) { .tool-body { grid-template-columns: 1fr; padding: 20px; } }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 700; font-size: 0.9rem; margin-bottom: 6px; }
.form-control {
  width: 100%;
  padding: 13px 14px;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  font-size: 0.98rem;
  font-family: inherit;
}
.form-control:focus { outline: none; border-color: var(--wa-green); }

.qr-preview-panel {
  background: #f8fafc;
  border: 1.5px dashed #cbd5e1;
  border-radius: 16px;
  padding: 22px;
  text-align: center;
}
.qr-img-wrap {
  width: 190px;
  height: 190px;
  margin: 0 auto 14px;
  background: #fff;
  padding: 12px;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  display: grid;
  place-items: center;
}

.upsell-banner {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #fff;
  padding: 22px 26px;
  border-top: 3px solid var(--wa-bright);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.upsell-banner h3 { margin: 0 0 4px; color: #4ade80; font-size: 1.15rem; }
.upsell-banner p { margin: 0; color: #e2e8f0; font-size: 0.93rem; max-width: 640px; }

/* Commission Loss Calculator */
.calc-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 20px;
  padding: 30px;
  box-shadow: var(--shadow-sm);
  margin: 36px 0;
}
.calc-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 28px;
  align-items: center;
}
@media (max-width: 780px) { .calc-grid { grid-template-columns: 1fr; } }
.loss-box {
  background: var(--danger-soft);
  border: 1.5px solid #fecaca;
  border-radius: 16px;
  padding: 22px;
  text-align: center;
}
.loss-amount {
  font-size: 2.3rem;
  font-weight: 900;
  color: var(--danger);
  line-height: 1.1;
  margin: 8px 0;
}

/* ==========================================================================
   INTERACTIVE PHONE SIMULATOR (/demo/)
   ========================================================================== */
.demo-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 38px;
  align-items: start;
  margin: 26px 0 50px;
}
@media (max-width: 880px) {
  .demo-layout { grid-template-columns: 1fr; }
}
.phone-mockup {
  background: #0f172a;
  border-radius: 36px;
  padding: 12px;
  box-shadow: 0 24px 50px rgba(15, 23, 42, 0.25);
  max-width: 380px;
  margin: 0 auto;
  width: 100%;
}
.phone-screen {
  background: #f8fafc;
  border-radius: 26px;
  overflow: hidden;
  border: 1px solid #334155;
}
.menu-app-header {
  background: linear-gradient(135deg, #b91c1c, #ea580c);
  color: #fff;
  padding: 18px 16px;
}
.menu-item-row {
  background: #fff;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.menu-item-info strong { display: block; font-size: 0.94rem; }
.menu-item-info span { font-size: 0.82rem; color: var(--text-muted); }
.menu-price { font-weight: 800; color: var(--wa-green-dark); font-size: 0.95rem; }
.qty-controls { display: inline-flex; align-items: center; gap: 8px; }
.btn-qty {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1.5px solid var(--wa-green);
  background: var(--wa-soft);
  color: #166534;
  font-weight: 900;
  font-size: 1rem;
  cursor: pointer;
}
.wa-ticket-preview {
  background: #e7ffdb;
  border: 1px solid #bbf7d0;
  border-radius: 14px;
  padding: 16px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  color: #14532d;
  white-space: pre-line;
  box-shadow: var(--shadow-sm);
  margin: 16px 0;
}

/* Cards & Grids */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 20px;
  margin: 24px 0 42px;
}
.card-link {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.card-link:hover {
  transform: translateY(-3px);
  border-color: var(--wa-green);
  box-shadow: var(--shadow-lg);
}
.card-tag {
  font-size: 0.75rem;
  font-weight: 800;
  color: #166534;
  background: var(--wa-soft);
  padding: 3px 9px;
  border-radius: 6px;
  width: fit-content;
  margin-bottom: 10px;
}
.card-link h3 { margin: 0 0 8px; font-size: 1.1rem; }
.card-link p { margin: 0 0 14px; font-size: 0.92rem; color: var(--text-muted); }

/* Callouts & Tables */
.callout {
  background: var(--surface);
  border-left: 4px solid var(--wa-green);
  padding: 18px 22px;
  border-radius: 0 12px 12px 0;
  box-shadow: var(--shadow-sm);
  margin: 24px 0;
}
.cta-banner-article {
  background: linear-gradient(135deg, #0f172a 0%, #14532d 100%);
  color: #fff;
  padding: 28px;
  border-radius: var(--radius);
  margin: 34px 0;
}
.cta-banner-article h3 { color: #4ade80; margin-top: 0; }
.cta-banner-article p { color: #e2e8f0; margin-bottom: 18px; }

.table-wrap { overflow-x: auto; margin: 24px 0; }
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  font-size: 0.94rem;
}
th, td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--border); }
th { background: #0f172a; color: #fff; }

/* Sticky Mobile Bar */
.sticky-cta {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: rgba(255, 255, 255, 0.97);
  border-top: 1px solid var(--border);
  padding: 10px 16px;
  z-index: 95;
}
@media (max-width: 768px) {
  .has-sticky { padding-bottom: 76px; }
  .sticky-cta { display: block; }
}

/* Footer & Cookies */
.site-footer {
  background: #0f172a;
  color: #cbd5e1;
  padding: 44px 0 34px;
  margin-top: 56px;
  font-size: 0.88rem;
}
.site-footer a { color: #4ade80; }
.footer-links { display: flex; flex-wrap: wrap; gap: 18px; margin-bottom: 16px; }
.disclaimer { color: #94a3b8; font-size: 0.8rem; line-height: 1.55; }

.cookie-banner {
  position: fixed;
  bottom: 14px; left: 14px; right: 14px;
  max-width: 680px; margin: 0 auto;
  background: #1e293b; color: #f8fafc;
  padding: 16px 20px; border-radius: 14px;
  z-index: 999; box-shadow: 0 14px 34px rgba(0,0,0,0.35);
  font-size: 0.85rem;
}
.cookie-banner a { color: #4ade80; }
.cookie-inner { display: flex; flex-direction: column; gap: 12px; }
.cookie-inner p { margin: 0; }
.cookie-actions { display: flex; gap: 10px; justify-content: flex-end; }
.btn-ck-pri, .btn-ck-sec { padding: 8px 14px; border-radius: 8px; font-weight: 700; border: none; cursor: pointer; }
.btn-ck-pri { background: var(--wa-green); color: #fff; }
.btn-ck-sec { background: #334155; color: #e2e8f0; }
