/* ============================================================
   LGL Delivery — Estilos Globais
   app.css — importado por todas as telas
   ============================================================ */

/* ── FONTES ─────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&display=swap');

/* ── VARIÁVEIS ──────────────────────────────────────────────── */
:root {
  /* Cores principais — Royal Blue #1240C4 */
  --blue:        #1240C4;
  --blue-dark:   #0A1E7A;   /* era #0D31A0 — mais rico, alinhado à landing */
  --blue-mid:    #3A6DD8;
  --blue-light:  #EEF3FF;   /* era #EEF2FC — levemente mais azulado */
  --blue-xlight: #F4F6FF;   /* era #F4F7FF */

  /* Texto */
  --text:        #0D1021;   /* era #0D1B3E — mais profundo, alinhado à landing */
  --text-mid:    #3A4A6E;   /* era #3D4F72 */
  --muted:       #7A8BB5;

  /* Superfícies */
  --white:       #FFFFFF;
  --bg:          #F7F8FC;   /* era #F7F9FF — alinhado à landing */
  --surface:     #FFFFFF;
  --border:      #E4EAF8;
  --border-mid:  #C8D4F0;

  /* Feedback */
  --green:       #16A34A;
  --green-light: #DCFCE7;
  --red:         #DC2626;
  --red-light:   #FEE2E2;
  --yellow:      #D97706;
  --yellow-light:#FEF3C7;

  /* Tipografia */
  --font:        'Outfit', sans-serif;

  /* Espaçamento */
  --pad:         24px;
  --radius-sm:   8px;
  --radius-md:   14px;
  --radius-lg:   20px;
  --radius-full: 999px;

  /* Sombras — RGB atualizado para #1240C4 = rgb(18,64,196) */
  --shadow-sm:   0 1px 4px rgba(18,64,196,0.10);   /* era 0.08 */
  --shadow-md:   0 4px 16px rgba(18,64,196,0.14);  /* era 0.12 */
  --shadow-lg:   0 8px 32px rgba(18,64,196,0.18);  /* era 0.16 */
}

/* ── RESET ──────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  height: 100%;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  height: 100%;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { font-family: var(--font); cursor: pointer; }
input, textarea, select { font-family: var(--font); }
img { display: block; max-width: 100%; }

/* ── LAYOUT BASE ────────────────────────────────────────────── */
.screen {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 430px;
  margin: 0 auto;
  background: var(--white);
  position: relative;
}

/* ── HEADER AZUL ────────────────────────────────────────────── */
.app-header {
  background: linear-gradient(150deg, #0A2BA0 0%, #1240C4 48%, #1A52D0 100%);
  padding: 52px var(--pad) 28px;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.app-header::before {
  content: '';
  position: absolute;
  width: 260px; height: 260px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  top: -80px; right: -60px;
  pointer-events: none;
}

.app-header::after {
  content: '';
  position: absolute;
  width: 130px; height: 130px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
  bottom: -30px; left: 30px;
  pointer-events: none;
}

/* ── LOGO ───────────────────────────────────────────────────── */
.logo-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  position: relative;
  z-index: 1;
}

.logo-svg {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.logo-name {
  font-size: 15px;
  font-weight: 700;
  color: rgba(255,255,255,0.92);
  letter-spacing: 0.01em;
}

.logo-name span {
  color: rgba(255,255,255,0.55);
  font-weight: 400;
}

/* ── APP BAR (telas internas) ───────────────────────────────── */
.app-bar {
  background: linear-gradient(150deg, #0A2BA0 0%, #1240C4 48%, #1A52D0 100%);
  padding: 52px var(--pad) 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  flex-shrink: 0;
  z-index: 10;
}

.app-bar-back {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  border: none;
  display: flex; align-items: center; justify-content: center;
  color: white;
  flex-shrink: 0;
  transition: background 0.15s;
}

.app-bar-back:active { background: rgba(255,255,255,0.2); }

.app-bar-title {
  font-size: 17px;
  font-weight: 700;
  color: white;
  flex: 1;
}

.app-bar-action {
  position: relative;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  border: none;
  display: flex; align-items: center; justify-content: center;
  color: white;
  flex-shrink: 0;
  transition: background 0.15s;
}

.app-bar-action:active { background: rgba(255,255,255,0.2); }

.cart-badge {
  position: absolute;
  top: -2px; right: -2px;
  background: #EF4444;
  color: white;
  font-size: 10px;
  font-weight: 700;
  width: 18px; height: 18px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--blue);
}

/* ── BODY ───────────────────────────────────────────────────── */
.body {
  flex: 1;
  padding: var(--pad);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ── FOOTER FIXO ────────────────────────────────────────────── */
.footer {
  padding: 16px var(--pad);
  padding-bottom: max(16px, env(safe-area-inset-bottom));
  background: var(--white);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* ── BOTÕES ─────────────────────────────────────────────────── */
.btn {
  width: 100%;
  border: none;
  border-radius: var(--radius-md);
  padding: 17px var(--pad);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: opacity 0.2s, transform 0.1s;
  letter-spacing: 0.01em;
}

.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.btn-primary {
  background: linear-gradient(135deg, #1240C4 0%, #0A2BA0 100%);
  color: white;
  box-shadow: 0 4px 14px rgba(18,64,196,0.35);
}

.btn-primary:active { opacity: 0.9; }

.btn-secondary {
  background: var(--white);
  color: var(--blue);
  border: 2px solid var(--blue);
}

.btn-secondary:active { background: var(--blue-light); }

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 2px solid var(--border);
}

.btn-ghost:active { background: var(--bg); }

.btn-sm {
  width: auto;
  padding: 10px 16px;
  font-size: 13px;
  border-radius: var(--radius-sm);
}

/* ── CAMPOS ─────────────────────────────────────────────────── */
.field-group {
  margin-bottom: 16px;
}

.field-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 7px;
  display: block;
}

.field-input {
  width: 100%;
  background: var(--blue-xlight);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-family: var(--font);
  font-size: 15px;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  -webkit-appearance: none;
}

.field-input::placeholder { color: var(--muted); }

.field-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(18,64,196,0.1);
  background: var(--white);
}

.field-input.error {
  border-color: var(--red);
  box-shadow: 0 0 0 4px rgba(220,38,38,0.1);
}

/* ── DIVISOR ────────────────────────────────────────────────── */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
}

.divider-line { flex: 1; height: 1px; background: var(--border); }
.divider-text { font-size: 12px; color: var(--muted); font-weight: 500; }

/* ── SEÇÃO ──────────────────────────────────────────────────── */
.section {
  margin-bottom: 24px;
}

.section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-title-muted {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}

/* ── CARDS ──────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.card-blue {
  background: var(--blue-light);
  border: 2px solid var(--blue);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}

/* ── BADGES / PILLS ─────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
}

.badge-blue   { background: var(--blue-light); color: var(--blue); }
.badge-green  { background: var(--green-light); color: var(--green); }
.badge-red    { background: var(--red-light); color: var(--red); }
.badge-yellow { background: var(--yellow-light); color: var(--yellow); }

/* ── FEEDBACK ───────────────────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.5;
}

.alert-error  { background: var(--red-light); color: var(--red); }
.alert-info   { background: var(--blue-light); color: var(--blue); }
.alert-success{ background: var(--green-light); color: var(--green); }

/* ── SPINNER ────────────────────────────────────────────────── */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

.spinner-blue {
  border-color: var(--border);
  border-top-color: var(--blue);
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── LOADING OVERLAY ────────────────────────────────────────── */
.loading-overlay {
  position: fixed; inset: 0;
  background: rgba(255,255,255,0.88);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  z-index: 500;
}

.loading-overlay.show { display: flex; }

.loading-overlay .spinner-blue {
  width: 40px; height: 40px;
  border-width: 3px;
}

.loading-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

/* ── TOAST ──────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: var(--text);
  color: white;
  padding: 12px 20px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
  white-space: nowrap;
  z-index: 999;
  max-width: calc(100% - 48px);
  text-align: center;
}

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

/* ── BOTTOM SHEET ───────────────────────────────────────────── */
.sheet-overlay {
  position: fixed; inset: 0;
  background: rgba(13,16,33,0.6);   /* era rgba(13,27,62,0.55) — mais neutro */
  z-index: 400;
  display: none;
  align-items: flex-end;
}

.sheet-overlay.show { display: flex; }

.sheet {
  background: var(--white);
  border-radius: 24px 24px 0 0;
  padding: 20px var(--pad);
  padding-bottom: max(28px, env(safe-area-inset-bottom));
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease;
}

.sheet-handle {
  width: 40px; height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 0 auto 20px;
}

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

/* ── BOTTOM NAV ─────────────────────────────────────────────── */
.bottom-nav {
  display: flex;
  background: var(--white);
  border-top: 1px solid var(--border);
  padding-bottom: max(8px, env(safe-area-inset-bottom));
  flex-shrink: 0;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 4px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  transition: color 0.15s;
}

.nav-item.active { color: var(--blue); }
.nav-item svg { width: 22px; height: 22px; }

/* ── CHIP FILTRO ────────────────────────────────────────────── */
.chip {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--muted);
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}

.chip.active {
  background: var(--blue);
  color: white;
  border-color: var(--blue);
}

/* ── LINHA RESUMO ───────────────────────────────────────────── */
.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
}

.summary-row:last-child { border-bottom: none; }
.summary-row.total { font-weight: 700; font-size: 16px; }
.summary-row.total .summary-val { color: var(--blue); }
.summary-key { color: var(--text-mid); }
.summary-val { font-weight: 600; color: var(--text); }

/* ── UTILIDADES ─────────────────────────────────────────────── */
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8  { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

.text-center { text-align: center; }
.text-muted  { color: var(--muted); }
.text-blue   { color: var(--blue); }
.text-green  { color: var(--green); }
.text-red    { color: var(--red); }

.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center  { display: flex; align-items: center; justify-content: center; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }

.hidden { display: none !important; }
.spacer { flex: 1; }
