/* ==========================================================================
   EL AMIR - WEB APP MOBILE-FIRST
   - En Desktop (> 768px): Muestra ÚNICAMENTE la tarjeta centrada con el Código QR y la URL local.
   - En Smartphone (<= 768px): Muestra la Web App nativa a pantalla completa (100%).
   ========================================================================== */

:root {
  /* Paleta de Colores Lujosa & Gastronómica */
  --bg-app: #0d0e12;
  --bg-card: #15171e;
  --bg-card-elevated: #1b1e28;
  --bg-sheet: #13151b;
  --bg-input: #101217;

  /* Oro y Acentos */
  --gold-primary: #d4af37;
  --gold-light: #f3cd65;
  --gold-bright: #ffe699;
  --gold-dark: #997815;
  --gold-gradient: linear-gradient(135deg, #f7d57f 0%, #d4af37 50%, #aa820a 100%);
  --gold-glow: rgba(212, 175, 55, 0.22);
  --gold-border: rgba(212, 175, 55, 0.25);

  /* Texto */
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-gold: #f5d77f;

  /* Estados */
  --color-success: #22c55e;
  --color-danger: #ef4444;
  --color-whatsapp: #25d366;
  --color-whatsapp-dark: #128c7e;

  /* Tipografía */
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-serif: 'Cinzel', Georgia, serif;

  /* Radios & Sombras */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 30px;
  --radius-full: 9999px;

  --shadow-card: 0 8px 24px -6px rgba(0, 0, 0, 0.7);
  --shadow-glow: 0 0 20px var(--gold-glow);
  --shadow-sheet: 0 -12px 40px rgba(0, 0, 0, 0.85);

  --bottom-nav-height: 64px;
  --app-max-width: 480px;
}

/* Reset y Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

input, textarea, select {
  user-select: auto;
}

html {
  font-size: 16px;
  background-color: #06070a;
  color: var(--text-primary);
  height: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: #06070a;
  color: var(--text-primary);
  min-height: 100%;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  background-image: 
    radial-gradient(circle at 50% 25%, rgba(212, 175, 55, 0.08) 0%, transparent 60%),
    radial-gradient(circle at 85% 85%, rgba(37, 211, 102, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 15% 75%, rgba(212, 175, 55, 0.05) 0%, transparent 50%);
}

body.modal-open {
  overflow: hidden;
  touch-action: none;
}

/* ==========================================================================
   VISTA DESKTOP (> 768px): MUESTRA EXCLUSIVAMENTE LA TARJETA DEL CÓDIGO QR
   ========================================================================== */
.desktop-qr-screen {
  display: flex;
  min-height: 100vh;
  width: 100%;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.5rem;
}

.desktop-qr-card {
  width: 100%;
  max-width: 440px;
  background: rgba(21, 23, 30, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-xl);
  padding: 2.5rem 2rem;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9), 0 0 35px rgba(212, 175, 55, 0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.35rem;
  position: relative;
  overflow: hidden;
}

.desktop-qr-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gold-gradient);
}

.qr-brand-logo {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-full);
  border: 2px solid var(--gold-primary);
  background: #000;
  box-shadow: 0 0 16px rgba(212, 175, 55, 0.35);
  object-fit: cover;
}

.companion-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid var(--gold-border);
  color: var(--gold-bright);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
}

.companion-title {
  font-family: var(--font-serif);
  font-size: 1.85rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--text-primary);
}

.companion-title span {
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.companion-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.55;
  max-width: 340px;
}

/* Caja de Código QR */
.qr-scanner-card {
  background: #000;
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  box-shadow: inset 0 0 20px rgba(212, 175, 55, 0.12), 0 10px 25px rgba(0, 0, 0, 0.8);
}

.qr-code-wrapper {
  background: #fff;
  padding: 10px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
}

.qr-code-wrapper svg, .qr-code-wrapper img {
  width: 200px;
  height: 200px;
  display: block;
}

.qr-card-text {
  font-size: 0.82rem;
  color: var(--gold-light);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Bloque con la URL Local */
.local-url-badge {
  background: rgba(0, 0, 0, 0.6);
  border: 1px dashed var(--gold-border);
  border-radius: var(--radius-md);
  padding: 0.65rem 1rem;
  font-family: monospace;
  font-size: 0.95rem;
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.local-url-badge .pulse-green {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 8px #4ade80;
  flex-shrink: 0;
}

.companion-btn-group {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.btn-copy-link {
  width: 100%;
  background: var(--gold-gradient);
  color: #0b0c10;
  border: none;
  border-radius: var(--radius-full);
  padding: 0.9rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.35);
  min-height: 48px;
}

.btn-copy-link:active {
  transform: scale(0.97);
}

/* ==========================================================================
   VISTA SMARTPHONE: WEB APP NATIVA
   ========================================================================== */
.mobile-app-root {
  width: 100%;
  min-height: 100vh;
  background-color: var(--bg-app);
  display: flex;
  flex-direction: column;
  position: relative;
}

.mobile-app-content {
  flex: 1;
  padding-bottom: 180px;
}

/* CONTROL DE VISIBILIDAD RESPONSIVE SEGÚN DISPOSITIVO */
@media (min-width: 769px) {
  /* En desktop: OCULTAR totalmente la app y mostrar SÓLO la tarjeta QR */
  .mobile-app-root,
  .floating-cart-bar-shell,
  .mobile-bottom-nav,
  .bottom-sheet-dialog,
  .bottom-sheet-backdrop,
  .cart-drawer-sheet,
  .cart-drawer-backdrop,
  .checkout-modal-dialog,
  .checkout-modal-backdrop,
  .summary-modal-dialog,
  .summary-modal-backdrop,
  .success-screen-overlay {
    display: none !important;
  }

  .desktop-qr-screen {
    display: flex !important;
  }
}

@media (max-width: 768px) {
  /* En smartphone / móvil: OCULTAR el QR y mostrar la Web App móvil completa */
  .desktop-qr-screen {
    display: none !important;
  }

  .mobile-app-root {
    display: flex !important;
  }
}
