/* Aicoffi GO - alineado con order_app (Flutter) */
:root {
  --accent: #f59e0b;
  --accent-dark: #d97706;
  --accent-soft: rgba(245, 158, 11, 0.14);
  --bg: #f1f5f9;
  --bg-card: #ffffff;
  --text: #0f172a;
  --text-muted: #8490a3;
  --border: #e2e8f0;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  --safe-bottom: env(safe-area-inset-bottom, 0);
  --tab-inactive: #8490a3;
}

/* Modo oscuro */
html[data-theme="dark"] {
  --bg: #0f172a;
  --bg-card: #1e293b;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --border: #334155;
  --shadow: 0 1px 3px rgba(0,0,0,.35);
  --accent-soft: rgba(245, 158, 11, 0.22);
}
html[data-theme="dark"] .product-card .p-img-fallback,
html[data-theme="dark"] .cat-option.selected { background: rgba(245,158,11,.2); }
html[data-theme="dark"] .message-bubble.you { background: rgba(37,99,235,.35); color: #e2e8f0; }
html[data-theme="dark"] .offers-banner { background: linear-gradient(90deg, rgba(30,41,59,.9) 0%, rgba(51,65,85,.9) 100%); }

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  color: var(--text);
  background: var(--bg);
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overscroll-behavior: none;
}
body { min-height: 100%; min-height: 100dvh; }

/* App shell a pantalla completa (sin marco de móvil) */
.phone-viewport {
  min-height: 100%;
  min-height: 100dvh;
  display: block;
  padding: 0;
  background: var(--bg);
}
.phone-frame {
  width: 100%;
  max-width: 100%;
  min-height: 100%;
  min-height: 100dvh;
  height: auto;
  background: transparent;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  position: relative;
}
.phone-screen {
  width: 100%;
  min-height: 100%;
  min-height: 100dvh;
  height: 100%;
  background: var(--bg);
  border-radius: 0;
  overflow: hidden;
  overflow-y: auto;
  position: relative;
  -webkit-overflow-scrolling: touch;
}
.phone-screen::-webkit-scrollbar { width: 4px; }
.phone-screen::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.phone-screen-app {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100dvh;
  max-height: 100dvh;
  padding-top: env(safe-area-inset-top, 0);
}
.phone-screen-app .app-shell { flex: 1; overflow-y: auto; min-height: 0; -webkit-overflow-scrolling: touch; }
.phone-screen-app .bottom-nav {
  position: relative;
  flex-shrink: 0;
  border-radius: 0;
  padding-bottom: env(safe-area-inset-bottom, 0);
  min-height: calc(60px + env(safe-area-inset-bottom, 0));
  height: auto;
}

/* En escritorio: columna estrecha sin bisel */
@media (min-width: 600px) {
  body { background: #0f172a; }
  .phone-viewport {
    display: flex;
    align-items: stretch;
    justify-content: center;
    background: #0f172a;
    padding: 0;
  }
  .phone-frame {
    max-width: 430px;
    min-height: 100dvh;
    background: var(--bg);
    box-shadow: 0 0 0 1px rgba(255,255,255,0.06);
  }
}

/* Landing */
.page-landing .phone-screen { display: flex; flex-direction: column; padding: 0; overflow: hidden; height: 100dvh; max-height: 100dvh; }
.page-landing { display: block; min-height: 100dvh; padding: 0; }

/* Hero naranja */
.landing-hero {
  background: linear-gradient(155deg, #f9b233 0%, var(--accent) 40%, var(--accent-dark) 100%);
  flex: 0 0 42%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(28px + env(safe-area-inset-top, 0)) 28px 48px;
  border-radius: 0 0 40px 40px;
  position: relative;
  z-index: 1;
  box-shadow: 0 10px 32px rgba(217,119,6,.30);
}
.landing-hero-inner { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.landing-hero-icon { width: 76px; height: 76px; filter: drop-shadow(0 4px 14px rgba(0,0,0,.20)); }
.landing-hero-text { height: 28px; }
.landing-hero-tagline { font-size: 0.92rem; color: rgba(255,255,255,.93); font-weight: 600; line-height: 1.45; max-width: 240px; margin-top: 4px; }

/* Logo blanco sobre hero naranja */
.hero-logo-full { height: 100px; display: block; }
.login-hero .hero-logo-full { height: 70px; }

/* Logo color en header de la app (fondo blanco) */
.brand-logo-full { height: 28px; display: block; }

/* Cuerpo blanco */
.landing-body {
  flex: 1;
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  padding: 28px 24px calc(24px + env(safe-area-inset-bottom, 0));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
}

/* Features — lista estilo Mercadona */
.landing-features { display: flex; flex-direction: column; flex: 1; margin-bottom: 24px; }
.landing-feature { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--border); }
.landing-feature:last-child { border-bottom: none; }
.supplier-conflict-icon { font-size: 2rem; text-align: center; margin-bottom: 8px; }
.supplier-conflict-icon img { display: inline-block; width: 40px; height: 40px; object-fit: contain; }
.landing-feature-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--accent-soft);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; color: var(--accent);
}
.landing-feature-icon svg { width: 22px; height: 22px; display: block; }
.offers-banner { padding: 10px 0; background: var(--accent-soft); font-size: 0.85rem; overflow: hidden; cursor: pointer; color: var(--accent-dark); font-weight: 600; }
.list-card { display: flex; align-items: center; gap: 16px; padding: 16px; background: var(--bg-card); border-radius: var(--radius); box-shadow: none; border: 1px solid var(--border); cursor: pointer; }
.orders-list-card { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; background: var(--bg-card); border-radius: var(--radius); margin-bottom: 10px; box-shadow: none; cursor: pointer; border: 1px solid var(--border); }
.invoice-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; background: var(--bg-card); border-radius: var(--radius); border: 1px solid var(--border); cursor: pointer; }
.landing-feature-text { display: flex; flex-direction: column; gap: 2px; }
.landing-feature-title { font-size: 0.92rem; font-weight: 700; color: var(--text); }
.landing-feature-desc { font-size: 0.78rem; color: var(--text-muted); }

/* CTA grande */
.landing-cta {
  border-radius: 12px;
  padding: 16px 24px;
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: 0.2px;
  box-shadow: none;
  margin-bottom: 20px;
  background: var(--accent);
}

/* Selector de idioma */
.landing-lang-selector { display: flex; align-items: center; justify-content: center; gap: 12px; font-size: 0.88rem; color: var(--text-muted); font-weight: 600; }
.landing-lang-btns { display: flex; align-items: center; gap: 10px; }
.landing-lang-btn { width: 40px; height: 40px; padding: 0; border-radius: 50%; border: 2px solid var(--border); background: rgba(0,0,0,0.04); cursor: pointer; transition: border-color 0.2s, background 0.2s; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.landing-lang-btn .landing-flag-svg { width: 26px; height: 26px; border-radius: 50%; overflow: hidden; display: block; }
.landing-lang-btn .landing-flag-svg svg { width: 100%; height: 100%; object-fit: cover; }
.landing-lang-btn:active { opacity: 0.9; }
.landing-lang-btn.active { border-color: var(--accent); background: rgba(245,158,11,0.15); box-shadow: 0 0 0 1px var(--accent); }
html[data-theme="dark"] .landing-lang-btn { background: rgba(255,255,255,0.06); border-color: var(--border); }
html[data-theme="dark"] .landing-lang-btn.active { border-color: var(--accent); background: rgba(245,158,11,0.2); }
html[data-theme="dark"] .landing-feature-icon { background: rgba(245,158,11,0.12); }

.btn-primary { display: inline-block; padding: 14px 22px; font-size: 1rem; font-weight: 700; color: #fff; background: var(--accent); border: none; border-radius: var(--radius); text-decoration: none; text-align: center; cursor: pointer; box-shadow: none; }
.btn-primary:active { background: var(--accent-dark); opacity: 0.95; }
.btn-block { width: 100%; }
.btn-primary:active { opacity: 0.9; }

/* Login */
.page-login .phone-screen { display: flex; flex-direction: column; padding: 0; overflow: hidden; height: 100dvh; max-height: 100dvh; }
.page-login { display: block; min-height: 100dvh; padding: 0; }

/* Mini hero naranja — igual que landing pero más compacto */
.login-hero {
  background: linear-gradient(155deg, #f9b233 0%, var(--accent) 40%, var(--accent-dark) 100%);
  flex: 0 0 22%;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: calc(16px + env(safe-area-inset-top, 0)) 28px 30px;
  border-radius: 0 0 36px 36px;
  box-shadow: 0 8px 24px rgba(217,119,6,.28);
  position: relative;
  z-index: 1;
}
.login-hero .hero-logo-full { height: 40px; }

/* Cuerpo blanco */
.login-body {
  flex: 1;
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  padding: 28px 26px calc(24px + env(safe-area-inset-bottom, 0));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.login-heading { margin-bottom: 24px; }
.login-heading h1 { font-size: 1.4rem; font-weight: 800; margin-bottom: 5px; color: var(--text); }
.login-sub { font-size: 0.87rem; color: var(--text-muted); }

/* Formulario sin tarjeta */
.login-form-clean { display: flex; flex-direction: column; gap: 20px; margin-bottom: 20px; }

/* Acceso rápido — discreto, bordeado punteado */
.quick-access-mini { margin-bottom: -4px; }
.quick-select-mini {
  width: 100%; padding: 9px 12px;
  font-size: 0.82rem;
  border: 1.5px dashed var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text-muted);
  cursor: pointer;
}

/* Campos */
.login-field { display: flex; flex-direction: column; gap: 7px; }
.login-field label { font-size: 0.78rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.6px; }
.login-field input {
  width: 100%; padding: 13px 14px;
  font-size: 1rem;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.login-field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(245,158,11,.14); }

/* Toggle contraseña */
.login-pass-wrap { position: relative; }
.login-pass-wrap input { padding-right: 46px; }
.login-pass-toggle {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); opacity: 0.45; padding: 4px;
  display: flex; align-items: center;
}
.login-pass-toggle:hover { opacity: 0.85; }

/* Checkbox */
.login-session-hint { margin: -8px 0 0; font-size: 0.78rem; color: var(--text-muted); text-align: center; line-height: 1.4; }

/* Botón submit */
.login-submit { border-radius: 12px; padding: 16px; font-size: 1.02rem; font-weight: 700; box-shadow: none; background: var(--accent); }

/* Footer */
.login-footer { text-align: center; font-size: 0.9rem; margin-top: auto; padding-top: 16px; }
.login-footer a { color: var(--accent); text-decoration: none; font-weight: 600; }

/* Texto legal - inspirado Mercadona */
.login-legal { font-size: 0.75rem; color: var(--text-muted); text-align: center; line-height: 1.5; padding-top: 12px; }
.login-legal a { color: var(--text-muted); text-decoration: underline; }

/* Dark mode */
html[data-theme="dark"] .login-body { background: var(--bg-card); }
html[data-theme="dark"] .login-field input { background: var(--bg); }

/* Status Bar - oculto: usar barra nativa del sistema */
.status-bar { display: none !important; }

/* Push overlays (checkout) */
.push-overlay {
  position: absolute; inset: 0; z-index: 280;
  background: var(--bg); display: none; flex-direction: column;
  border-radius: 0; overflow: hidden;
  animation: stackIn 0.22s ease;
  padding-top: env(safe-area-inset-top, 0);
  pointer-events: none;
  visibility: hidden;
}
.push-overlay.open {
  display: flex;
  pointer-events: auto;
  visibility: visible;
}
.push-overlay[hidden] {
  display: none !important;
  pointer-events: none !important;
  visibility: hidden !important;
}
.push-overlay-header {
  flex-shrink: 0; display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; background: var(--bg-card); border-bottom: 1px solid var(--border);
}
.push-overlay-body { flex: 1; overflow-y: auto; padding: 16px; padding-bottom: calc(16px + env(safe-area-inset-bottom, 0)); -webkit-overflow-scrolling: touch; }
.phone-screen-app.overlay-open .bottom-nav { visibility: hidden; pointer-events: none; }
.cart-inline-error {
  margin-top: 12px; padding: 10px 12px; border-radius: 10px;
  background: #fef2f2; color: #b91c1c; font-size: 0.88rem; font-weight: 600;
}
html[data-theme="dark"] .cart-inline-error { background: rgba(185,28,28,.2); color: #fecaca; }
.checkout-success { text-align: center; padding: 24px 8px; }
.checkout-success .confirm-success-icon { font-size: 48px; margin-bottom: 12px; }
.checkout-success .confirm-success-title { font-size: 1.2rem; font-weight: 700; margin-bottom: 8px; }
.checkout-success .confirm-success-meta { font-size: 0.95rem; color: var(--text-muted); margin-bottom: 4px; }
.checkout-success .confirm-success-msg { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 20px; line-height: 1.4; }

/* Toast */
.app-toast {
  position: absolute; left: 16px; right: 16px; bottom: calc(72px + env(safe-area-inset-bottom, 0)); z-index: 400;
  background: #0f172a; color: #fff; padding: 12px 16px; border-radius: 12px;
  font-size: 0.9rem; font-weight: 600; text-align: center;
  opacity: 0; transform: translateY(12px); pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}
.app-toast.show { opacity: 1; transform: translateY(0); }
html[data-theme="dark"] .app-toast { background: #f1f5f9; color: #0f172a; }

/* Load more */
.orders-load-more-wrap { display: flex; justify-content: center; padding: 8px 0 16px; }
.btn-load-more {
  padding: 10px 20px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--bg-card); color: var(--text); font-weight: 600; font-size: 0.9rem; cursor: pointer;
}
.btn-load-more:active { opacity: 0.85; }

/* Preferencias */
.prefs-card {
  background: var(--bg-card); border-radius: var(--radius); box-shadow: var(--shadow);
  border: 1px solid var(--border); overflow: hidden;
}
.prefs-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px; border-bottom: 1px solid var(--border); font-size: 0.95rem; cursor: pointer;
}
.prefs-row:last-child { border-bottom: none; }
.prefs-row input { width: 20px; height: 20px; accent-color: var(--accent); }

/* App shell */
.app-shell { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.app-header { position: sticky; top: 0; z-index: 100; background: var(--bg-card); border-bottom: 1px solid var(--border); padding: 10px 12px; display: flex; align-items: center; justify-content: space-between; }
.app-header .brand { display: flex; align-items: center; gap: 6px; }
.app-header .brand img { height: 26px; }
.app-header .brand .logo-icon { width: 30px; height: 30px; }
.app-header .actions { display: flex; align-items: center; gap: 4px; }
.app-header .icon-btn { width: 40px; height: 40px; border: none; background: none; color: var(--accent); font-size: 1.1rem; cursor: pointer; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.app-header .icon-btn img { width: 26px; height: 26px; object-fit: contain; display: block; }
.app-header .icon-btn.badge::after { content: attr(data-badge); position: absolute; top: 4px; right: 4px; min-width: 18px; height: 18px; padding: 0 4px; font-size: 11px; font-weight: 700; color: #fff; background: #ef4444; border-radius: 9px; display: flex; align-items: center; justify-content: center; }
.app-header .icon-btn.badge.no-badge::after { display: none; }
.app-header .icon-btn { position: relative; }
.app-header .cart-header-btn .badge { position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px; font-size: 10px; font-weight: 700; color: #fff; background: #ef4444; border-radius: 9px; display: flex; align-items: center; justify-content: center; }
.header-supplier-btn { display: flex; align-items: center; gap: 6px; background: none; border: none; cursor: pointer; padding: 6px 8px; border-radius: 20px; max-width: 170px; }
.header-supplier-btn:active { background: var(--bg); }
.header-supplier-name { font-size: 0.78rem; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 115px; }
.header-supplier-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: block;
  color: var(--accent);
}
.header-supplier-icon.ui-icon svg,
.ui-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}
.cat-trigger-icon-img {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--text-muted);
  display: inline-flex;
}
.cat-trigger-icon-img svg { width: 100%; height: 100%; display: block; }
.profile-card .user-row .avatar.ui-avatar {
  color: var(--accent);
  background: var(--accent-soft);
  padding: 10px;
}
.profile-card .user-row .avatar.ui-avatar svg {
  width: 100%;
  height: 100%;
  display: block;
}
.profile-card .menu-item .menu-icon-svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  color: var(--accent);
}
.profile-card .menu-item .menu-icon-svg svg {
  width: 100%;
  height: 100%;
  display: block;
}
.profile-card .menu-item .menu-arrow-svg {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  flex-shrink: 0;
  display: inline-flex;
}
.profile-card .menu-item .menu-arrow-svg svg {
  width: 100%;
  height: 100%;
  display: block;
}
.supplier-conflict-icon.ui-icon-lg {
  width: 44px;
  height: 44px;
  margin: 0 auto 10px;
  color: var(--accent);
}
.supplier-conflict-icon.ui-icon-lg svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Bottom tab icons — outline / filled */
.bottom-nav .nav-item .nav-icon-svg {
  width: 24px;
  height: 24px;
  display: block;
  margin-bottom: 2px;
  color: var(--tab-inactive);
  position: relative;
}
.bottom-nav .nav-item .nav-ico {
  display: block;
  width: 24px;
  height: 24px;
}
.bottom-nav .nav-item .nav-ico svg {
  width: 100%;
  height: 100%;
  display: block;
}
.bottom-nav .nav-item .nav-ico-fill { display: none; }
.bottom-nav .nav-item .nav-ico-outline { display: block; }
.bottom-nav .nav-item.active { color: var(--accent); font-weight: 700; }
.bottom-nav .nav-item.active .nav-icon-svg { color: var(--accent); }
.bottom-nav .nav-item.active .nav-ico-outline { display: none; }
.bottom-nav .nav-item.active .nav-ico-fill { display: block; }

/* Fila búsqueda + categorías (una sola línea) */
.search-cat-row { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--bg-card); border-bottom: 1px solid var(--border); }
.search-input-wrap { flex: 1; position: relative; }
.search-input-wrap::before { content: '🔍'; position: absolute; left: 10px; top: 50%; transform: translateY(-50%); font-size: 0.9rem; z-index: 1; opacity: 0.65; pointer-events: none; }
.search-cat-row .cat-trigger { flex-shrink: 0; }
/* Search bar - estilo profesional */
.search-bar { padding: 8px 16px; background: var(--bg-card); border-bottom: 1px solid var(--border); position: relative; }
.search-bar input {
  width: 100%;
  padding: 9px 14px 9px 42px;
  font-size: 0.95rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  height: 38px;
  box-sizing: border-box;
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search-bar input::placeholder { color: #94a3b8; }
.search-bar input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px rgba(245,158,11,0.15); }
.search-bar::before { content: '🔍'; position: absolute; left: 24px; top: 50%; transform: translateY(-50%); font-size: 1rem; z-index: 1; opacity: 0.7; }
html[data-theme="dark"] .search-bar input { background: var(--bg-card); border-color: #475569; }
html[data-theme="dark"] .search-bar input::placeholder { color: #94a3b8; }
.search-input-wrap input { width: 100%; padding: 9px 12px 9px 34px; font-size: 0.88rem; border: 1px solid #cbd5e1; border-radius: 8px; background: #fff; height: 36px; box-sizing: border-box; color: var(--text); transition: border-color 0.2s, box-shadow 0.2s; }
.search-input-wrap input::placeholder { color: #94a3b8; }
.search-input-wrap input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px rgba(245,158,11,0.15); }
html[data-theme="dark"] .search-input-wrap input { background: var(--bg-card); border-color: #475569; }

/* Categories trigger */
.provider-pill {
  flex:1;
  min-width:0;
  font-size:0.8rem;
  font-weight:600;
  color:var(--text);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.cat-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  flex-shrink:0;
  min-width:100px;
  max-width:130px;
}
.cat-trigger:active { opacity: 0.9; }
.cat-trigger-icon { font-size: 1.1rem; }
.cat-trigger-icon-img { width: 16px; height: 16px; object-fit: contain; flex-shrink: 0; opacity: 0.75; }
.cat-trigger-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cat-trigger-arrow {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  display: inline-flex;
  flex-shrink: 0;
}
.cat-trigger-arrow svg { width: 100%; height: 100%; display: block; }
.categories-sheet { display: flex; flex-direction: column; max-height: 45vh; }
.categories-sheet .modal-head { padding: 14px 20px; }
.categories-sheet .categories-list { padding: 8px 20px 20px; overflow-y: auto; flex: 1; min-height: 0; -webkit-overflow-scrolling: touch; }
.cat-option { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--bg-card); border-radius: var(--radius); margin-bottom: 6px; border: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.cat-option:last-child { margin-bottom: 0; }
.cat-option:active { background: var(--bg); }
.cat-option.selected { border-color: var(--accent); background: #fffbeb; }
.cat-option-icon { font-size: 1.25rem; width: 32px; text-align: center; flex-shrink: 0; }
.cat-option-label { flex: 1; font-weight: 600; font-size: 0.95rem; }
.cat-option-check { color: var(--accent); font-size: 1.2rem; }

/* Content area */
.app-content { flex: 1; overflow-y: auto; padding: 16px; min-height: 0; -webkit-overflow-scrolling: touch; }
.app-panel { display: none; }
.app-panel.active { display: block; }
.btn-primary.is-muted { opacity: 0.65; }
#panelCart { padding-bottom: 88px; }
.cart-confirm-bar {
  position: sticky;
  bottom: 0;
  z-index: 20;
  margin: 16px -16px -16px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0));
  background: linear-gradient(180deg, rgba(241,245,249,0) 0%, var(--bg) 28%);
}
html[data-theme="dark"] .cart-confirm-bar {
  background: linear-gradient(180deg, rgba(15,23,42,0) 0%, var(--bg) 28%);
}
.cart-confirm-bar .btn-primary { width: 100%; margin-top: 0; }

/* Product grid */
.product-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.product-card { background: var(--bg-card); border-radius: var(--radius); box-shadow: none; overflow: hidden; cursor: pointer; }
.p-unit-chip.active, .modal-sheet .p-unit-chip.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.cfb-inner { background: var(--accent); border-radius: 14px; padding: 11px 14px; display: flex; align-items: center; gap: 10px; pointer-events: all; box-shadow: 0 4px 16px rgba(245,158,11,.28); }
.cfb-btn { background: #0f172a; color: #fff; border: none; border-radius: 10px; padding: 9px 13px; font-size: 0.79rem; font-weight: 700; cursor: pointer; white-space: nowrap; flex-shrink: 0; }
.landing-feature-icon { background: var(--accent-soft); }
.modal-sheet .btn-add, .modal-btn-round, .modal-btn-plus-full, .qty-input-accept { background: var(--accent); }
.order-detail-modify, .btn-invoice-pdf { background: var(--accent); }
.product-card .p-img { height: 90px; background: #f8fafc; position: relative; overflow: hidden; }
.product-card .p-img img { width: 100%; height: 100%; object-fit: cover; }
.product-card .p-img-fallback { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; font-size: 2rem; background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%); }
.product-card .p-body { padding: 10px; }
.product-card .p-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 0.7rem; font-weight: 600; color: var(--text-muted); margin-bottom: 4px; }
.product-card .p-tag-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.product-card .p-name-wrap { font-size: 0.85rem; font-weight: 600; line-height: 1.25; margin-bottom: 4px; min-height: 2.5em; overflow: hidden; }
.product-card .p-name-wrap.marquee .p-marquee-track { display: inline-flex; white-space: nowrap; animation: marquee 10s linear infinite; }
.product-card .p-name-wrap.marquee .p-marquee-track span { padding-right: 1.5em; }
.product-card .p-name-wrap:not(.marquee) .p-name-inner { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-card .p-price { font-size: 0.95rem; font-weight: 700; color: var(--accent); margin-bottom: 0; }
.product-card .p-price.p-price-small { font-size: 0.85rem; }
.product-card .p-stock { display:none; }
.product-card .p-unit-picker,
.modal-sheet .p-unit-picker { display:flex; flex-wrap:wrap; gap:4px; margin:4px 0 8px; }
.product-card .p-unit-chip,
.modal-sheet .p-unit-chip {
  border-radius:999px;
  border:1px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  font-size:0.7rem;
  padding:2px 8px;
  cursor:pointer;
}
.product-card .p-unit-chip.active,
.modal-sheet .p-unit-chip.active {
  background:#f97316;
  border-color:#ea580c;
  color:#fff;
}
.product-card .p-unit-picker-single,
.modal-sheet .p-unit-picker-single {
  font-size:0.75rem;
  color:var(--text-muted);
  margin-bottom:8px;
}
.product-card .p-actions { display: flex; align-items: center; gap: 6px; }
.product-card .p-actions.p-actions-in-cart { justify-content: stretch; }
.product-card .p-add-wrap { flex: 1; position: relative; }
.product-card .p-add { width: 100%; padding: 6px 8px; font-size: 0.8rem; font-weight: 600; color: #fff; background: var(--accent); border: none; border-radius: var(--radius-sm); cursor: pointer; }
.product-card .p-add:active { opacity: 0.9; }

/* Stepper estilo Mercadona */
.product-card .p-stepper-merc { display: flex; align-items: center; width: 100%; gap: 5px; }
/* qty=1: papelera + botón + ancho */
.product-card .p-stepper-one { gap: 5px; }
.product-card .p-btn-trash { width: 34px; height: 34px; flex-shrink: 0; border: 1.5px solid var(--border); background: var(--bg); color: var(--text-muted); border-radius: 9px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background 0.15s, border-color 0.15s; }
.product-card .p-btn-trash:active { background: #fee2e2; border-color: #fca5a5; color: #ef4444; }
.product-card .p-btn-plus-full { flex: 1; height: 34px; background: var(--accent); color: #fff; border: none; border-radius: 9px; font-size: 1.3rem; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; line-height: 1; }
.product-card .p-btn-plus-full:active { opacity: 0.85; }
/* qty>1: botones redondos naranjas + número clicable */
.product-card .p-btn-round { width: 34px; height: 34px; flex-shrink: 0; background: var(--accent); color: #fff; border: none; border-radius: 50%; font-size: 1.1rem; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; line-height: 1; }
.product-card .p-btn-round:active { opacity: 0.85; }
.product-card .p-qty-clickable { flex: 1; height: 34px; background: none; border: none; border-bottom: 2px solid var(--accent); font-size: 1rem; font-weight: 800; color: var(--text); cursor: pointer; text-align: center; padding: 0; margin: 0 2px; transition: opacity 0.1s; }
.product-card .p-qty-clickable:active { opacity: 0.6; }

/* Modal cantidad exacta */
.qty-input-sheet { border-radius: 24px 24px 0 0; padding: 0 0 env(safe-area-inset-bottom, 0); text-align: center; }
.qty-input-sheet .handle { width: 40px; height: 4px; background: var(--border); border-radius: 2px; margin: 14px auto 20px; }
.qty-input-product { font-size: 0.95rem; font-weight: 700; color: var(--text); padding: 0 24px; margin-bottom: 4px; }
.qty-input-hint { font-size: 0.8rem; color: var(--text-muted); margin: 0 0 16px; }
.qty-input-field { font-size: 2.4rem; font-weight: 800; text-align: center; width: 140px; border: none; border-bottom: 2.5px solid var(--accent); background: none; color: var(--text); outline: none; padding: 4px 0 6px; margin-bottom: 28px; -moz-appearance: textfield; }
.qty-input-field::-webkit-inner-spin-button, .qty-input-field::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.qty-input-actions { display: flex; gap: 10px; padding: 0 20px 24px; }
.qty-input-cancel { flex: 1; padding: 14px; background: var(--bg); border: 1.5px solid var(--border); border-radius: 12px; font-size: 0.95rem; font-weight: 600; cursor: pointer; color: var(--text-muted); }
.qty-input-accept { flex: 1; padding: 14px; background: var(--accent); border: none; border-radius: 12px; font-size: 0.95rem; font-weight: 700; cursor: pointer; color: #fff; }

/* Cart panel */
.cart-list { padding: 16px 0; }
.cart-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.cart-item .ci-thumb { flex-shrink: 0; width: 56px; height: 56px; border-radius: var(--radius-sm); overflow: hidden; background: var(--bg); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.cart-item .ci-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-item .ci-thumb-fallback { font-size: 1.5rem; display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.cart-item .ci-info { flex: 1; min-width: 0; }
.cart-item .ci-name-wrap { font-size: 0.95rem; font-weight: 500; margin-bottom: 8px; overflow: hidden; }
.cart-item .ci-name-wrap.marquee .ci-marquee-track { display: inline-flex; white-space: nowrap; animation: marquee 10s linear infinite; }
.cart-item .ci-name-wrap.marquee .ci-marquee-track span { padding-right: 2em; }
.cart-item .ci-name-wrap:not(.marquee) .ci-name-inner { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes marquee { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }
.cart-item .ci-row { display: flex; align-items: center; }
.cart-item .ci-price { font-weight: 700; color: var(--accent); flex-shrink: 0; font-size: 0.9rem; }

/* Stepper carrito estilo Mercadona */
.cart-item .ci-stepper-merc { display: flex; align-items: center; gap: 6px; width: 100%; }
.cart-item .ci-stepper-one { gap: 6px; }
.cart-item .ci-price-one { flex: 1; font-size: 0.95rem; }
.cart-item .ci-btn-trash { width: 32px; height: 32px; flex-shrink: 0; border: 1.5px solid var(--border); background: var(--bg); color: var(--text-muted); border-radius: 8px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.cart-item .ci-btn-trash:active { background: #fee2e2; border-color: #fca5a5; color: #ef4444; }
.cart-item .ci-btn-plus { flex: 0 0 52px; height: 32px; background: var(--accent); color: #fff; border: none; border-radius: 10px; font-size: 1.3rem; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.cart-item .ci-btn-plus:active { opacity: 0.85; }
.cart-item .ci-btn-round { width: 30px; height: 30px; flex-shrink: 0; background: var(--accent); color: #fff; border: none; border-radius: 50%; font-size: 1rem; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.cart-item .ci-btn-round:active { opacity: 0.85; }
.cart-item .ci-qty-click { height: 30px; min-width: 28px; background: none; border: none; border-bottom: 2px solid var(--accent); font-size: 0.95rem; font-weight: 800; color: var(--text); cursor: pointer; text-align: center; padding: 0 2px; }
.cart-item .ci-qty-click:active { opacity: 0.6; }
.cart-item .ci-note-wrap { margin-top: 7px; cursor: pointer; }
.cart-item .ci-note-empty { display: inline-block; font-size: 0.73rem; color: var(--text-muted); border: 1px dashed var(--border); border-radius: 6px; padding: 3px 8px; transition: background 0.15s; }
.cart-item .ci-note-empty:hover { background: var(--bg); }
.cart-item .ci-note-filled { display: flex; align-items: flex-start; gap: 5px; font-size: 0.73rem; color: var(--text-muted); background: var(--bg); border-radius: 6px; padding: 4px 8px; }
.cart-item .ci-note-filled span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-obs-section { margin-top: 18px; }
.note-obs-label { display: block; font-size: 0.78rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 6px; }
.note-modal-field { display: block; width: 100%; box-sizing: border-box; border: 1.5px solid var(--border); border-radius: 10px; padding: 11px 12px; font-size: 0.9rem; background: var(--bg); color: var(--text); resize: none; margin: 0 0 14px; font-family: inherit; line-height: 1.4; }
.note-modal-field:focus { outline: none; border-color: var(--accent); }
.note-obs-cancel { display: block; width: 100%; background: none; border: none; color: var(--text-muted); font-size: 0.88rem; padding: 10px 0 4px; cursor: pointer; text-align: center; }
.supplier-conflict-sheet { padding-bottom: 8px; }
.supplier-conflict-body { padding: 4px 20px 20px; text-align: center; }
.supplier-conflict-icon { font-size: 2.2rem; margin-bottom: 10px; }
.supplier-conflict-title { font-size: 1.05rem; font-weight: 700; margin: 0 0 8px; }
.supplier-conflict-msg { font-size: 0.85rem; color: var(--text-muted); margin: 0 0 20px; line-height: 1.5; }
.btn-supplier-empty { display: block; width: 100%; padding: 13px; margin-top: 10px; font-size: 0.95rem; font-weight: 600; color: var(--text); background: var(--bg); border: 1.5px solid var(--border); border-radius: var(--radius); cursor: pointer; box-sizing: border-box; }
.cart-empty { text-align: center; padding: 48px 24px; color: var(--text-muted); font-size: 1rem; }
.cart-summary { padding: 16px; background: var(--bg); border-radius: var(--radius); margin-top: 16px; }
.cart-summary .row { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 0.85rem; }
.cart-summary .row.total { font-size: 1.1rem; font-weight: 700; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.cart-order-note { margin: 14px 0 4px; }
.cart-order-note label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.cart-order-note .confirm-textarea { min-height: 64px; width: 100%; }
.order-detail-notes {
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--text);
  white-space: pre-wrap;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: var(--radius-sm);
}
.cart-address-card { display: flex; align-items: center; gap: 10px; padding: 11px 14px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; }
.cart-address-card:active { opacity: 0.8; }
.cart-address-icon { font-size: 1.1rem; flex-shrink: 0; }
.cart-address-body { flex: 1; min-width: 0; }
.cart-address-label { font-size: 0.72rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 2px; }
.cart-address-value { font-size: 0.85rem; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cart-address-arrow { font-size: 0.9rem; color: var(--text-muted); flex-shrink: 0; }
.cart-address-add { display: flex; align-items: center; gap: 8px; padding: 11px 14px; border: 1.5px dashed var(--border); border-radius: var(--radius); cursor: pointer; font-size: 0.88rem; color: var(--accent); font-weight: 600; }
.cart-address-add:active { opacity: 0.7; }
.cart-editing-banner { padding: 12px 16px; margin-bottom: 12px; background: #dbeafe; color: #1d4ed8; border-radius: var(--radius-sm); font-size: 0.85rem; font-weight: 500; }
.cart-cancel-edit { margin-left: 8px; padding: 4px 10px; font-size: 0.8rem; background: transparent; border: 1px solid #1d4ed8; color: #1d4ed8; border-radius: 6px; cursor: pointer; font-weight: 600; }
.cart-info { margin-top: 16px; padding: 12px; background: #fef3c7; border-radius: var(--radius-sm); font-size: 0.8rem; color: #92400e; }
.cart-info p { margin-bottom: 4px; }
.cart-info p:last-child { margin-bottom: 0; }

/* Stack pages (push navigation within a tab) */
.stack-view { display: none; animation: stackIn 0.22s ease; }
.stack-view.active { display: block; }
@keyframes stackIn { from { opacity: 0.6; transform: translateX(12px); } to { opacity: 1; transform: translateX(0); } }
.stack-page-header { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.stack-page-header.with-back { margin-bottom: 14px; }
.stack-page-title { font-size: 1.35rem; font-weight: 700; margin: 0; flex: 1; min-width: 0; line-height: 1.25; }
.stack-page-body { padding-bottom: 8px; }
#panelOrders .orders-list { padding-bottom: 8px; }
#panelOrders .orders-pagination { margin-top: 4px; }
#panelOrders .tracking-body { padding: 4px 0 12px; }
#panelProfile .invoices-list .invoice-card { background: var(--bg-card); }
#panelProfile .stack-page-body .order-detail-items { max-height: none; }
#panelOrders .stack-page-body .order-detail-items { max-height: none; }
#panelOrders .order-detail-actions { margin-top: 20px; }

/* Orders panel */
.order-list { padding: 0; }
.order-item { padding: 16px; background: var(--bg-card); border-radius: var(--radius); margin-bottom: 12px; box-shadow: var(--shadow); cursor: pointer; }
.order-item .oi-num { font-weight: 700; font-size: 1rem; margin-bottom: 4px; }
.order-item .oi-date { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 4px; }
.order-item .oi-status { display: inline-block; padding: 4px 8px; font-size: 0.75rem; font-weight: 600; border-radius: 6px; }
.order-item .oi-status.Recibido { background: #dbeafe; color: #1d4ed8; }
.order-item .oi-status.Confirmado { background: #cffafe; color: #0891b2; }
.order-item .oi-status.Preparando { background: #fef3c7; color: #d97706; }
.order-item .oi-status.Enviado { background: #d1fae5; color: #059669; }
.order-item .oi-status.Facturado { background: #e5e7eb; color: #4b5563; }
.order-item .oi-total { font-weight: 700; margin-top: 8px; color: var(--accent); }
.cart-empty, .orders-empty { text-align: center; padding: 48px 24px; color: var(--text-muted); }

/* Lists panel (estilo Mercadona) */
.lists-header { margin-bottom: 20px; }
.lists-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 12px; }
.lists-search-wrap { position: relative; }
.lists-search-wrap::before { content: '🔍'; position: absolute; left: 18px; top: 50%; transform: translateY(-50%); font-size: 1rem; z-index: 1; opacity: 0.7; }
.lists-search { width: 100%; padding: 12px 14px 12px 44px; font-size: 0.95rem; border: 1px solid #cbd5e1; border-radius: 8px; background: #fff; margin-bottom: 16px; height: 44px; box-sizing: border-box; color: var(--text); transition: border-color 0.2s, box-shadow 0.2s; }
.lists-search::placeholder { color: #94a3b8; }
.lists-search:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px rgba(245,158,11,0.15); }
html[data-theme="dark"] .lists-search { background: var(--bg-card); border-color: #475569; }
.lists-content { display: flex; flex-direction: column; gap: 12px; }
.list-card { display: flex; align-items: center; gap: 16px; padding: 16px; background: var(--bg-card); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--border); cursor: pointer; }
.list-card:active { opacity: 0.9; }
.list-card-icon { width: 48px; height: 48px; border-radius: var(--radius-sm); background: var(--accent-soft); display: flex; align-items: center; justify-content: center; font-size: 1.5rem; flex-shrink: 0; color: var(--accent); }
.list-card { box-shadow: none !important; }
.orders-list-card { box-shadow: none !important; }
.offers-banner { background: var(--accent-soft) !important; color: var(--accent-dark); font-weight: 600; }
.list-card-create .list-card-icon { background: #d1fae5; color: #059669; font-size: 1.5rem; font-weight: 700; }
.list-card-info { flex: 1; min-width: 0; }
.list-card-title { font-weight: 700; font-size: 1rem; margin-bottom: 4px; }
.list-card-desc { font-size: 0.85rem; color: var(--text-muted); }
.list-card-create .list-card-title { color: #059669; }
.list-card .arrow { color: var(--text-muted); font-size: 1.2rem; }

/* List detail view */
.lists-detail { padding: 4px 16px 16px; }
.lists-detail-header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.lists-back-btn { width: 36px; height: 36px; border: 1px solid var(--border); background: var(--bg); border-radius: var(--radius-sm); font-size: 1rem; cursor: pointer; color: var(--text); flex-shrink: 0; }
.lists-detail-icon { font-size: 1.2rem; flex-shrink: 0; }
.lists-detail-title { font-size: 1.1rem; font-weight: 700; flex: 1; min-width: 0; }
.lists-detail-search-wrap { margin-bottom: 6px; position: relative; }
.lists-detail-search-wrap::before { content: '🔍'; position: absolute; left: 18px; top: 50%; transform: translateY(-50%); font-size: 1rem; z-index: 1; opacity: 0.7; }
.lists-detail-search-wrap .lists-search { padding: 12px 14px 12px 44px; height: 44px; border-radius: 8px; margin-bottom: 0; }
.list-items-section { margin-bottom: 12px; }
.list-items-title, .list-products-title { font-size: 0.85rem; font-weight: 700; color: var(--text-muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px; }
.list-items-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.list-items-grid .product-card { margin: 0; }
/* Listas: viñetas mismo ancho que Inicio - break out del padding de lists-detail */
.list-products-section { margin-left: -16px; margin-right: -16px; }
.list-products-section .list-products-title { padding-left: 16px; padding-right: 16px; }
.list-products-section .product-grid { margin: 0; }

/* Profile / Cuenta panel */
.profile-card { padding: 20px; background: var(--bg-card); border-radius: 20px; box-shadow: none; margin-bottom: 16px; border: none; }
.profile-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 12px; }
.profile-card .user-row { display: flex; align-items: center; gap: 12px; margin-bottom: 0; }
.profile-card .user-row .avatar { width: 50px; height: 50px; background: var(--accent-soft); color: var(--accent); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.25rem; overflow: hidden; }
.profile-card .user-row .avatar img { width: 28px; height: 28px; object-fit: contain; }
.profile-card .user-row .name { font-weight: 700; font-size: 0.95rem; }
.profile-card .menu-item { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--bg); font-size: 0.95rem; cursor: pointer; color: var(--text); }
.profile-card .menu-item:last-child { border-bottom: none; }
.profile-card .menu-item:active { opacity: 0.75; }
.profile-card .menu-item .menu-icon { width: 20px; height: 20px; object-fit: contain; flex-shrink: 0; }
.profile-card .menu-item .menu-icon-svg { width: 20px; height: 20px; flex-shrink: 0; color: var(--accent); }
.profile-card .menu-item .menu-icon-svg svg { width: 100%; height: 100%; display: block; }
.profile-card .menu-item .menu-label { flex: 1; text-align: center; font-weight: 500; }
.profile-card .menu-item .arrow { color: var(--text-muted); width: 14px; height: 14px; object-fit: contain; flex-shrink: 0; }
.btn-logout { width: calc(100% - 0px); padding: 14px; margin-top: 8px; font-size: 1rem; font-weight: 700; color: var(--text); background: var(--bg-card); border: none; border-radius: 20px; cursor: pointer; }

/* Bottom tab bar — estilo order_app */
.bottom-nav {
  min-height: 60px;
  height: auto;
  padding-bottom: env(safe-area-inset-bottom, 0);
  background: var(--bg-card);
  border-top: 1px solid var(--bg);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 200;
  flex-shrink: 0;
}
body:not(:has(.phone-viewport)) .bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; }
.bottom-nav .nav-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 6px 2px; font-size: 0.72rem; color: var(--tab-inactive); text-decoration: none; cursor: pointer; font-weight: 500; }
.bottom-nav .nav-item .badge { position: absolute; top: 2px; right: 50%; margin-right: -20px; min-width: 18px; height: 18px; padding: 0 4px; font-size: 10px; font-weight: 700; color: #fff; background: #ef4444; border-radius: 9px; display: flex; align-items: center; justify-content: center; }
.bottom-nav .nav-item { position: relative; }

/* Banner flotante del carrito - estilo Mercadona */
.cart-float-bar { position: absolute; bottom: 60px; left: 12px; right: 12px; z-index: 150; pointer-events: none; }
body:not(:has(.phone-viewport)) .cart-float-bar { position: fixed; bottom: 60px; left: 12px; right: 12px; }
.cfb-inner { background: var(--accent); border-radius: 14px; padding: 11px 14px; display: flex; align-items: center; gap: 10px; pointer-events: all; box-shadow: 0 4px 20px rgba(0,0,0,0.22); }
.cfb-icon { flex-shrink: 0; width: 22px; height: 22px; object-fit: contain; filter: brightness(0); }
.cfb-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.cfb-units { font-size: 0.88rem; font-weight: 700; color: #000; }
.cfb-approx { font-size: 0.72rem; color: rgba(0,0,0,0.65); }
.cfb-btn { background: #000; color: #fff; border: none; border-radius: 10px; padding: 9px 13px; font-size: 0.79rem; font-weight: 700; cursor: pointer; white-space: nowrap; flex-shrink: 0; }
.cfb-btn:active { opacity: 0.8; }

/* Modal — cubre toda la pantalla real */
.phone-screen { position: relative; }
.phone-screen .modal-backdrop {
  position: absolute; inset: 0; background: rgba(0,0,0,.5); z-index: 300;
  display: none; align-items: flex-end; border-radius: 0; overflow: hidden;
  pointer-events: none; visibility: hidden;
}
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 300;
  display: none; align-items: flex-end;
  pointer-events: none; visibility: hidden;
}
.modal-backdrop.open {
  display: flex;
  pointer-events: auto;
  visibility: visible;
}
.modal-sheet {
  width: 100%; max-height: 85dvh; background: var(--bg-card);
  border-radius: 24px 24px 0 0; overflow: hidden; animation: slideUp 0.3s ease;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.modal-sheet .handle { width: 40px; height: 4px; background: var(--border); border-radius: 2px; margin: 12px auto; }
.modal-sheet .content { padding: 0 20px 24px; overflow-y: auto; max-height: calc(85dvh - 40px); }
.modal-sheet .p-img-lg { height: 140px; background: #f8fafc; margin: 0 -20px 16px; overflow: hidden; }
.modal-sheet .p-img-lg img { width: 100%; height: 100%; object-fit: cover; }
.modal-sheet .p-name-lg { font-size: 1.2rem; font-weight: 700; margin-bottom: 8px; }
.modal-sheet .p-price-lg { font-size: 1.25rem; font-weight: 700; color: var(--accent); margin-bottom: 16px; }

/* Detalle de producto (sheet inferior) — distinto del visor zoom */
.product-detail-sheet {
  max-height: 88dvh;
}
.product-detail-sheet .p-img-lg {
  height: 180px;
  background: #f1f5f9;
  margin: 0 -20px 14px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.product-detail-sheet .p-img-lg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.product-detail-sheet .p-img-fallback-lg {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 180px;
  font-size: 3.2rem;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
}

/* Visor fullscreen con pinch-zoom */
.image-zoom-overlay {
  position: absolute;
  inset: 0;
  z-index: 360;
  background: #0b1220;
  display: none;
  flex-direction: column;
  touch-action: none;
}
.image-zoom-overlay.open {
  display: flex;
}
.image-zoom-overlay[hidden] {
  display: none !important;
}
.image-zoom-close {
  position: absolute;
  top: calc(10px + env(safe-area-inset-top, 0));
  right: 12px;
  z-index: 3;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.14);
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
}
.image-zoom-hint {
  position: absolute;
  top: calc(16px + env(safe-area-inset-top, 0));
  left: 16px;
  right: 60px;
  z-index: 2;
  color: rgba(255,255,255,0.72);
  font-size: 0.78rem;
  font-weight: 600;
  pointer-events: none;
  transition: opacity 0.4s;
}
.image-zoom-hint.hide { opacity: 0; }
.image-zoom-stage {
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
  cursor: grab;
}
.image-zoom-stage:active { cursor: grabbing; }
.image-zoom-stage img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  transform-origin: center center;
  will-change: transform;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}
.image-zoom-footer {
  flex-shrink: 0;
  background: var(--bg-card);
  border-radius: 18px 18px 0 0;
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0));
  box-shadow: 0 -8px 24px rgba(0,0,0,0.25);
}
.image-zoom-footer .p-name-lg {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}
.image-zoom-footer .p-price-lg {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 12px;
}
.image-zoom-footer .btn-add {
  width: 100%;
  padding: 16px;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
}
.image-zoom-footer .btn-add:active { opacity: 0.9; }
.image-zoom-footer .modal-actions-in-cart { margin-top: 12px; }
.product-card .p-img { cursor: zoom-in; }

/* Zoom de imagen de producto (legacy sheet classes kept harmless) */
.product-zoom-sheet {
  max-height: 92dvh;
}
.modal-sheet .stepper { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.modal-sheet .stepper button { width: 44px; height: 44px; border: 1px solid var(--border); background: var(--bg); border-radius: var(--radius); font-size: 1.25rem; cursor: pointer; }
.modal-sheet .stepper .qty { font-size: 1.25rem; font-weight: 700; min-width: 32px; text-align: center; }
.modal-sheet .btn-add { width: 100%; padding: 16px; font-size: 1rem; font-weight: 700; color: #fff; background: var(--accent); border: none; border-radius: var(--radius); cursor: pointer; }
.modal-actions-in-cart { margin-top: 14px; }

/* Stepper modal estilo Mercadona */
.modal-stepper-merc { display: flex; align-items: center; gap: 8px; width: 100%; }
.modal-stepper-one { gap: 8px; }
.modal-btn-trash { width: 44px; height: 44px; flex-shrink: 0; border: 1.5px solid var(--border); background: var(--bg); color: var(--text-muted); border-radius: 12px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.modal-btn-trash:active { background: #fee2e2; border-color: #fca5a5; color: #ef4444; }
.modal-btn-plus-full { flex: 1; height: 44px; background: var(--accent); color: #fff; border: none; border-radius: 12px; font-size: 1.5rem; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.modal-btn-plus-full:active { opacity: 0.85; }
.modal-btn-round { width: 44px; height: 44px; flex-shrink: 0; background: var(--accent); color: #fff; border: none; border-radius: 50%; font-size: 1.3rem; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.modal-btn-round:active { opacity: 0.85; }
.modal-qty-clickable { flex: 1; height: 44px; background: none; border: none; border-bottom: 2.5px solid var(--accent); font-size: 1.4rem; font-weight: 800; color: var(--text); cursor: pointer; text-align: center; padding: 0; }
.modal-qty-clickable:active { opacity: 0.6; }

/* Modal head - título e icono cerrar (como escritorio) */
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--border); flex-shrink: 0; gap: 16px; }
.modal-title { margin: 0; font-size: 1.125rem; font-weight: 700; flex: 1; min-width: 0; }
.modal-close { width: 40px; height: 40px; flex-shrink: 0; border: 1px solid var(--border); background: var(--bg); border-radius: var(--radius-sm); font-size: 1.1rem; cursor: pointer; color: var(--text-muted); display: flex; align-items: center; justify-content: center; }

/* Modal confirmar pedido */
.confirm-order-sheet { display: flex; flex-direction: column; max-height: 90vh; }
.confirm-order-sheet .confirm-order-body { padding: 20px; overflow-y: auto; flex: 1; }
.confirm-order-sheet .confirm-field { margin-bottom: 16px; }
.confirm-order-sheet .confirm-field label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }
.confirm-order-sheet .confirm-input { width: 100%; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--bg); color: var(--text); font-size: 0.95rem; box-sizing: border-box; }
.confirm-field { margin-bottom: 16px; }
.confirm-field label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }
.confirm-input { width: 100%; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--bg); color: var(--text); font-size: 0.95rem; box-sizing: border-box; font-family: inherit; }
.confirm-textarea { resize: vertical; min-height: 72px; }
.confirm-summary { max-height: 240px; overflow-y: auto; margin-bottom: 12px; padding: 12px; background: var(--bg-card); border-radius: var(--radius-sm); border: 1px solid var(--border); }
.confirm-summary-item { display: flex; justify-content: space-between; gap: 8px; padding: 8px 0; font-size: 0.9rem; border-bottom: 1px solid var(--border); }
.confirm-summary-item:last-child { border-bottom: none; }
.confirm-summary-notes {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}
.confirm-summary-notes-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}
.confirm-summary-notes-text {
  font-size: 0.9rem;
  line-height: 1.4;
  color: var(--text);
  white-space: pre-wrap;
}
.confirm-summary-total { font-size: 1.1rem; font-weight: 700; color: var(--accent); margin-bottom: 16px; }
.confirm-actions { display: flex; gap: 10px; align-items: center; }
.confirm-order-back { width: 44px; height: 44px; border: 1px solid var(--border); background: var(--bg-card); border-radius: var(--radius-sm); font-size: 1.2rem; cursor: pointer; color: var(--text); }
.confirm-order-sheet .confirm-textarea { resize: vertical; min-height: 72px; }
.confirm-order-sheet .confirm-summary { max-height: 180px; overflow-y: auto; margin-bottom: 12px; padding: 12px; background: var(--bg); border-radius: var(--radius-sm); }
.confirm-order-sheet .confirm-summary-item { display: flex; justify-content: space-between; padding: 6px 0; font-size: 0.9rem; }
.confirm-order-sheet .confirm-summary-total { font-size: 1.1rem; font-weight: 700; padding: 12px 0; border-top: 1px solid var(--border); margin-bottom: 16px; color: var(--accent); }
.confirm-order-sheet .confirm-actions { display: flex; gap: 12px; align-items: center; }
.confirm-order-sheet .confirm-order-back { width: 40px; height: 40px; border: 1px solid var(--border); background: var(--bg); border-radius: var(--radius-sm); font-size: 1.2rem; cursor: pointer; color: var(--text); }
.confirm-order-sheet .confirm-success-icon { font-size: 48px; text-align: center; margin-bottom: 12px; }
.confirm-order-sheet .confirm-success-title { font-size: 1.2rem; font-weight: 700; margin-bottom: 8px; text-align: center; }
.confirm-order-sheet .confirm-success-meta { font-size: 0.95rem; color: var(--text-muted); margin-bottom: 4px; text-align: center; }
.confirm-order-sheet .confirm-success-msg { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 20px; text-align: center; line-height: 1.4; }

/* Modal Mis pedidos */
.orders-sheet { display: flex; flex-direction: column; max-height: 90vh; }
.orders-sheet .confirm-order-body { padding: 16px 20px; }
.orders-list { flex: 1; overflow-y: auto; padding-bottom: 12px; }
.orders-list-card { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; background: var(--bg-card); border-radius: var(--radius); margin-bottom: 10px; box-shadow: var(--shadow); cursor: pointer; border: 1px solid var(--border); }
.orders-list-card:active { opacity: 0.9; }
.orders-list-card-left { flex: 1; min-width: 0; }
.orders-list-card-num { font-weight: 700; font-size: 1rem; margin-bottom: 4px; }
.orders-list-card-meta { font-size: 0.85rem; color: var(--text-muted); }
.orders-list-card-status { flex-shrink: 0; padding: 4px 10px; font-size: 0.75rem; font-weight: 600; border-radius: 20px; margin-left: 12px; }
.orders-list-card-status.Recibido { background: #dbeafe; color: #1d4ed8; }
.orders-list-card-status.Confirmado { background: #cffafe; color: #0891b2; }
.orders-list-card-status.Preparando { background: #fef3c7; color: #d97706; }
.orders-list-card-status.Enviado { background: #d1fae5; color: #059669; }
.orders-list-card-status.Facturado { background: #e5e7eb; color: #4b5563; }
.orders-pagination { display: flex; justify-content: center; gap: 8px; padding: 16px 0; flex-shrink: 0; }
.orders-pagination button { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border); background: var(--bg); font-size: 0.9rem; font-weight: 600; cursor: pointer; color: var(--text); }
.orders-pagination button.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Modal detalle pedido */
.order-detail-sheet { display: flex; flex-direction: column; max-height: 90vh; }
.order-detail-sheet .confirm-order-body { padding: 16px 20px; }
.order-detail-section { margin-bottom: 20px; }
.order-detail-label { font-size: 0.7rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 8px; }
.order-detail-status { display: inline-block; padding: 4px 10px; font-size: 0.85rem; font-weight: 600; border-radius: 20px; }
.order-detail-status.Recibido { background: #dbeafe; color: #1d4ed8; }
.order-detail-status.Confirmado { background: #cffafe; color: #0891b2; }
.order-detail-status.Preparando { background: #fef3c7; color: #d97706; }
.order-detail-status.Enviado { background: #d1fae5; color: #059669; }
.order-detail-status.Facturado { background: #e5e7eb; color: #4b5563; }
.order-detail-items { background: var(--bg); border-radius: var(--radius-sm); padding: 12px; max-height: 200px; overflow-y: auto; }
.order-detail-item { display: flex; justify-content: space-between; padding: 8px 0; font-size: 0.9rem; }
.order-detail-item:not(:last-child) { border-bottom: 1px solid var(--border); }
.order-detail-total { font-size: 1.1rem; font-weight: 700; padding-top: 12px; margin-top: 12px; border-top: 1px solid var(--border); color: var(--accent); }
/* Botones como escritorio: Volver y Seguimiento secundarios, Modificar primario con flex:1 */
.order-detail-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; align-items: center; }
.order-detail-back, .order-detail-tracking, .order-detail-pdf { padding: 10px 16px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--bg); color: var(--text); font-size: 0.9rem; font-weight: 600; cursor: pointer; flex-shrink: 0; }
.order-detail-modify { flex: 1; min-width: 120px; padding: 10px 16px; border-radius: var(--radius-sm); border: none; background: var(--accent); color: #fff; font-size: 0.9rem; font-weight: 600; cursor: pointer; }
.order-detail-invoice-info { font-size: 0.9rem; color: var(--text-muted); }

/* Modal Notificaciones */
.notifications-sheet { display: flex; flex-direction: column; max-height: 90vh; }
.notifications-sheet .confirm-order-body { padding: 16px 20px; overflow-y: auto; }
.notifications-list { display: flex; flex-direction: column; gap: 12px; }
.notification-card { display: flex; gap: 12px; padding: 14px 16px; background: var(--bg); border-radius: var(--radius); border: 1px solid var(--border); }
.notification-card.unread { background: #fffbeb; border-color: rgba(245,158,11,0.3); }
.notification-icon { width: 40px; height: 40px; border-radius: var(--radius-sm); background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%); display: flex; align-items: center; justify-content: center; font-size: 1.25rem; flex-shrink: 0; }
.notification-content { flex: 1; min-width: 0; }
.notification-title { font-weight: 700; font-size: 0.95rem; margin-bottom: 4px; }
.notification-text { font-size: 0.85rem; color: var(--text-muted); line-height: 1.4; margin-bottom: 4px; }
.notification-meta { font-size: 0.75rem; color: var(--text-muted); opacity: 0.9; }

/* Modal Facturas */
.invoices-sheet { display: flex; flex-direction: column; max-height: 90vh; }
.invoices-sheet .confirm-order-body { padding: 16px 20px; overflow-y: auto; }
/* Búsqueda facturas - estilo profesional */
.invoices-search-wrap { position: relative; margin-bottom: 16px; }
.invoices-search-wrap::before { content: '🔍'; position: absolute; left: 18px; top: 50%; transform: translateY(-50%); font-size: 1rem; z-index: 1; opacity: 0.7; }
.invoices-search { width: 100%; padding: 12px 14px 12px 44px; font-size: 0.95rem; border: 1px solid #cbd5e1; border-radius: 8px; background: #fff; height: 44px; box-sizing: border-box; color: var(--text); transition: border-color 0.2s, box-shadow 0.2s; }
.invoices-search::placeholder { color: #94a3b8; }
.invoices-search:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px rgba(245,158,11,0.15); }
html[data-theme="dark"] .invoices-search { background: var(--bg-card); border-color: #475569; }
.invoices-list { display: flex; flex-direction: column; gap: 12px; }
.invoice-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; background: var(--bg); border-radius: var(--radius); border: 1px solid var(--border); cursor: pointer; }
.invoice-card:active { opacity: 0.9; }
.invoice-card-info { flex: 1; min-width: 0; }
.invoice-card-num { font-weight: 700; font-size: 1rem; margin-bottom: 4px; }
.invoice-card-meta { font-size: 0.85rem; color: var(--text-muted); }
.invoice-card-total { font-size: 0.9rem; font-weight: 600; color: var(--accent); margin-top: 4px; }
.invoice-card-pdf { padding: 6px 10px; min-width: 44px; border-radius: var(--radius-sm); border: 1px solid var(--accent); background: transparent; color: var(--accent); font-size: 0.75rem; font-weight: 600; cursor: pointer; flex-shrink: 0; }
.invoice-card-pdf:active { opacity: 0.9; }
.invoices-empty { text-align: center; padding: 32px 16px; color: var(--text-muted); font-size: 0.95rem; }

/* Modal detalle factura */
.invoice-detail-meta { font-size: 0.9rem; color: var(--text-muted); line-height: 1.5; white-space: pre-line; }
.btn-invoice-pdf { flex: 1; min-width: 120px; border: none; background: var(--accent); color: #fff !important; }

/* Suppliers modal */
.suppliers-sheet { display:flex;flex-direction:column;max-height:70vh; }
.suppliers-body { padding:16px 20px 20px; display:flex;flex-direction:column;gap:12px; }
.suppliers-search-wrap { position:relative; }
.suppliers-search-wrap::before { content:'🔍'; position:absolute; left:16px; top:50%; transform:translateY(-50%); font-size:0.95rem; opacity:0.7; }
.suppliers-search {
  width:100%; padding:10px 12px 10px 40px;
  border-radius:8px; border:1px solid var(--border);
  background:var(--bg); font-size:0.9rem; color:var(--text);
}
.suppliers-list { max-height:260px; overflow-y:auto; display:flex;flex-direction:column;gap:8px; }
.supplier-item {
  padding:10px 12px; border-radius:10px; border:1px solid var(--border);
  background:var(--bg-card); display:flex;align-items:center;justify-content:space-between;gap:8px;
}
.supplier-name { font-size:0.9rem; font-weight:600; }
.supplier-category {
  padding:4px 10px; border-radius:999px; border:1px solid var(--border);
  font-size:0.7rem; font-weight:600; color:var(--text-muted); background:var(--bg);
}

/* Modal Seguimiento (como escritorio) - botón cerrar abajo */
.tracking-sheet { display: flex; flex-direction: column; max-height: 90vh; }
.tracking-body { flex: 1; overflow-y: auto; padding: 20px; }
.tracking-footer { flex-shrink: 0; padding: 16px 20px; border-top: 1px solid var(--border); }
.tracking-step { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: var(--radius); margin-bottom: 8px; border: 1px solid var(--border); background: var(--bg); }
.tracking-step.past { opacity: 0.85; background: rgba(0,0,0,.04); }
.tracking-step.current { background: rgba(37,99,235,.12); border-color: rgba(37,99,235,.35); }
.tracking-step.future { opacity: 0.5; }
.tracking-step-icon { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 700; flex-shrink: 0; }
.tracking-step.past .tracking-step-icon { background: rgba(16,185,129,.25); color: #059669; }
.tracking-step.current .tracking-step-icon { background: #2563eb; color: #fff; }
.tracking-step.future .tracking-step-icon { background: var(--border); color: var(--text-muted); }
.tracking-step-content { flex: 1; min-width: 0; }
.tracking-step-label { font-weight: 700; font-size: 0.9rem; }
.tracking-step.past .tracking-step-label { color: var(--text-muted); }
.tracking-step.current .tracking-step-label { color: var(--text); }
.tracking-step.future .tracking-step-label { color: var(--text-muted); }
.tracking-step-date { font-size: 0.75rem; color: var(--text-muted); font-weight: 600; margin-top: 4px; }
.tracking-step-date { font-size: 0.75rem; color: var(--text-muted); font-weight: 600; margin-top: 4px; }

/* Modal Contactar (como escritorio) */
.contact-form { margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.contact-tickets-section { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.contact-tickets-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: var(--bg); font-weight: 700; font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.5px; cursor: pointer; user-select: none; }
.contact-tickets-header:active { opacity: 0.9; }
.contact-tickets-title { color: var(--text); }
.contact-tickets-chevron { color: var(--text-muted); font-size: 0.8rem; }
.contact-tickets-list { padding: 8px; max-height: 200px; overflow-y: auto; }
.contact-tickets-section.collapsed .contact-tickets-list { display: none; }
.message-ticket-item { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; background: var(--bg-card); border-radius: var(--radius); margin-bottom: 10px; border: 1px solid var(--border); cursor: pointer; }
.message-ticket-to { font-size: 0.85rem; color: var(--text-muted); }
.message-ticket-item:active { opacity: 0.9; }
.message-ticket-item:last-child { margin-bottom: 0; }
.message-ticket-subject { font-weight: 700; font-size: 1rem; }
.message-ticket-meta { font-size: 0.85rem; color: var(--text-muted); }
.message-ticket-reply { font-size: 0.8rem; color: var(--accent); }
.message-thread-meta { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 16px; }
.message-thread-content { margin-bottom: 20px; }
.message-bubble { padding: 12px 14px; border-radius: var(--radius); margin-bottom: 12px; max-width: 90%; }
.message-bubble.you { background: #dbeafe; color: #1d4ed8; align-self: flex-start; }
.message-bubble.them { background: var(--bg); border: 1px solid var(--border); align-self: flex-end; margin-left: auto; }
.message-bubble-label { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; margin-bottom: 6px; color: inherit; opacity: 0.9; }
.message-bubble-text { font-size: 0.95rem; line-height: 1.4; }
.message-bubble-date { font-size: 0.75rem; margin-top: 8px; opacity: 0.8; }

/* Páginas legales */
.page-legal .phone-screen { display: flex; flex-direction: column; height: 100dvh; max-height: 100dvh; }
.page-legal { display: block; min-height: 100dvh; padding: 0; }
.legal-header {
  flex-shrink: 0;
  height: calc(52px + env(safe-area-inset-top, 0));
  padding-top: env(safe-area-inset-top, 0);
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 16px;
  padding-right: 16px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}
.legal-back {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: none; cursor: pointer;
  color: var(--accent); flex-shrink: 0;
}
.legal-header-title { font-size: 0.95rem; font-weight: 700; color: var(--text); }
.legal-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 20px 40px;
  background: var(--bg-card);
}
.legal-body h1 { font-size: 1.1rem; font-weight: 800; margin-bottom: 16px; color: var(--text); letter-spacing: -0.2px; }
.legal-body h2 { font-size: 0.82rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.6px; color: var(--text); margin: 22px 0 10px; }
.legal-body p { font-size: 0.88rem; color: var(--text); line-height: 1.6; margin-bottom: 10px; }
.legal-body ul { margin: 0 0 10px 0; padding-left: 18px; }
.legal-body li { font-size: 0.88rem; color: var(--text); line-height: 1.6; margin-bottom: 6px; }
.legal-body a { color: var(--accent); text-decoration: underline; }
.legal-updated { font-size: 0.78rem; color: var(--text-muted); margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--border); }

/* Offers banner - marquee desplazable */
.offers-banner { padding: 10px 0; background: linear-gradient(90deg, #fef3c7 0%, #fde68a 100%); font-size: 0.85rem; overflow: hidden; cursor: pointer; }
.offers-marquee { overflow: hidden; }
.offers-track { display: inline-block; padding-left: 100%; white-space: nowrap; animation: marquee 25s linear infinite; }
@keyframes marquee { 0% { transform: translateX(0); } 100% { transform: translateX(-33.333%); } }

/* Home: habituales + ofertas */
.home-entry-row { margin-bottom: 14px; }
.home-entry-card {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
  text-align: left;
}
.home-entry-card:active { background: var(--bg); }
.home-entry-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.home-entry-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.home-entry-title { font-size: 0.95rem; font-weight: 700; }
.home-entry-sub { font-size: 0.78rem; color: var(--text-muted); }
.home-offers-section { margin-bottom: 18px; }
.home-section-head { margin: 4px 2px 10px; }
.home-section-head h3 { font-size: 1rem; font-weight: 700; color: var(--text); margin: 0; }
.home-section-head p { font-size: 0.8rem; color: var(--text-muted); margin: 4px 0 0; }
.catalog-section-head { margin-top: 6px; }
#panelCart .stack-page-header { margin: 0 0 12px; padding: 4px 0 8px; }

/* Badge de descuento sobre la imagen */
.product-card .p-img { position: relative; }
.offer-badge {
  position: absolute;
  top: 7px;
  right: 7px;
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 3px 7px;
  border-radius: 999px;
  letter-spacing: 0.3px;
  box-shadow: 0 2px 6px rgba(239,68,68,0.35);
  pointer-events: none;
}

/* Texto de descuento en panel Ofertas (sin precios) */
.p-discount-label {
  font-size: 0.9rem;
  font-weight: 800;
  color: #ef4444;
  margin-bottom: 4px;
  letter-spacing: -0.2px;
}
.p-offer-expiry {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.offer-dot { background: #ef4444; }

/* Indicador de oferta en tarjetas del catálogo (mismo estilo que offer-badge, clickable) */
.offer-indicator {
  position: absolute;
  top: 7px;
  right: 7px;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 3px 7px;
  border-radius: 999px;
  border: 3px solid #0f172a;
  cursor: pointer;
  letter-spacing: 0.3px;
  box-shadow: 0 2px 6px rgba(239,68,68,0.35);
  line-height: 1.4;
  white-space: nowrap;
}
.offer-indicator:active { opacity: 0.82; }

