/* ============================================================
   CATÁLOGO CSS — Hortifruti (mobile-first)
   ============================================================ */
:root {
  --green:  #2d6a4f;
  --green2: #40916c;
  --lime:   #74c69d;
  --lime2:  #d8f3dc;
  --cream:  #f0faf4;
  --dark:   #1b1b1b;
  --gray:   #6b7280;
  --border: #d4edda;
  --red:    #ef4444;
  --hdr-h:  58px;
  --ftr-h:  68px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
body   { font-family: 'Nunito', sans-serif; background: var(--cream); color: var(--dark); }
a      { color: inherit; text-decoration: none; }

/* ── HEADER ── */
.header {
  position: fixed; top: 0; left: 0; right: 0; height: var(--hdr-h);
  background: var(--green); color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px; z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,.2);
}
.header-brand { display: flex; align-items: center; gap: 10px; }
.header-icon  { font-size: 24px; }
.header-name  { font-size: 17px; font-weight: 900; }
.header-sub   { font-size: 10px; opacity: .7; }
.header-right { display: flex; align-items: center; gap: 10px; }
.header-link  { font-size: 13px; font-weight: 700; color: rgba(255,255,255,.85); }
.cart-btn {
  display: flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.18); border: 1.5px solid rgba(255,255,255,.3);
  padding: 7px 13px; border-radius: 999px;
  font-size: 14px; font-weight: 800; cursor: pointer;
}
.cart-badge {
  background: #facc15; color: var(--dark);
  border-radius: 999px; padding: 1px 6px; font-size: 12px; font-weight: 900;
}

/* ── MAIN ── */
.main-wrap {
  margin-top: var(--hdr-h);
  padding-bottom: calc(var(--ftr-h) + 16px);
}

/* ── CAT STRIP ── */
.cat-strip {
  position: sticky; top: var(--hdr-h); z-index: 80;
  background: #fff; border-bottom: 1.5px solid var(--border);
  display: flex; overflow-x: auto; gap: 8px; padding: 10px 12px;
  scrollbar-width: none;
}
.cat-strip::-webkit-scrollbar { display: none; }
.cat-chip {
  flex-shrink: 0; white-space: nowrap;
  padding: 7px 14px; border-radius: 999px;
  border: 2px solid var(--border); background: #fff;
  font-family: inherit; font-size: 13px; font-weight: 700;
  cursor: pointer; transition: all .18s;
}
.cat-chip.active { background: var(--green); border-color: var(--green); color: #fff; }

/* ── OLÁ BAR ── */
.ola-bar {
  background: var(--lime2); border-bottom: 1px solid var(--border);
  padding: 10px 14px; font-size: 13px; color: var(--green);
}

/* ── CAT SECTION ── */
.cat-section { padding: 14px 12px 0; }
.cat-title {
  font-size: 13px; font-weight: 900; text-transform: uppercase;
  letter-spacing: .1em; color: var(--green2); margin-bottom: 10px;
}

/* ── PROD GRID ── */
.prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(155px,1fr)); gap: 10px; margin-bottom: 20px; }

.prod-card {
  background: #fff; border-radius: 14px; border: 2px solid var(--border);
  overflow: hidden; display: flex; flex-direction: column; transition: border-color .18s;
}
.prod-card.in-cart { border-color: var(--green2); }

.prod-img-wrap { aspect-ratio: 1; overflow: hidden; background: var(--lime2); position: relative; }
.prod-img { width: 100%; height: 100%; object-fit: cover; }
.prod-img-ph { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 42px; }
.prod-destaque { position: absolute; top: 8px; right: 8px; background: #facc15; color: var(--dark); border-radius: 999px; padding: 2px 8px; font-size: 11px; font-weight: 800; }
.prod-inCart   { position: absolute; top: 8px; left: 8px; background: var(--green); color: #fff; border-radius: 999px; width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 900; }

.prod-info { padding: 10px 11px 11px; flex: 1; display: flex; flex-direction: column; gap: 3px; }
.prod-cat-lbl { font-size: 10px; font-weight: 800; color: var(--green2); text-transform: uppercase; letter-spacing: .06em; }
.prod-nome    { font-size: 14px; font-weight: 800; line-height: 1.25; }
.prod-desc    { font-size: 11px; color: var(--gray); line-height: 1.3; }
.prod-preco   { display: flex; align-items: baseline; gap: 3px; margin: 2px 0 6px; }
.preco-val    { font-size: 16px; font-weight: 900; color: var(--green); }
.preco-unit   { font-size: 11px; color: var(--gray); font-weight: 600; }

.prod-action { margin-top: auto; }
.btn-add {
  width: 100%; padding: 9px; border-radius: 10px;
  background: var(--green); color: #fff; border: none;
  font-family: inherit; font-size: 14px; font-weight: 800;
  cursor: pointer; transition: background .15s;
}
.btn-add:active { background: #1a4731; }

.qty-ctrl {
  display: flex; border-radius: 10px; overflow: hidden; border: 2px solid var(--lime);
}
.qty-btn {
  flex: 1; padding: 9px 0; border: none; font-size: 20px; font-weight: 900;
  cursor: pointer; background: var(--lime2); font-family: inherit;
  display: flex; align-items: center; justify-content: center;
  transition: background .12s;
}
.qty-btn:active { background: #b7e4c7; }
.qty-val { flex: 1.2; text-align: center; font-size: 14px; font-weight: 900; background: #f0fdf4; padding: 9px 0; border-left: 1.5px solid var(--lime); border-right: 1.5px solid var(--lime); }

/* ── DRAWER ── */
.drawer-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 190; display: none; }
.drawer-overlay.open { display: block; }
.drawer {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: #fff; border-radius: 22px 22px 0 0;
  max-height: 84vh; display: flex; flex-direction: column;
  transform: translateY(100%); transition: transform .3s cubic-bezier(.4,0,.2,1);
  z-index: 191; box-shadow: 0 -4px 32px rgba(0,0,0,.15);
}
.drawer.open { transform: translateY(0); }
.drawer-handle { width: 40px; height: 4px; background: #d1d5db; border-radius: 99px; margin: 12px auto 0; }
.drawer-head   { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px 12px; border-bottom: 1px solid var(--border); }
.drawer-head h2{ font-size: 18px; font-weight: 900; }
.drawer-close  { background: #f3f4f6; border: none; border-radius: 999px; width: 32px; height: 32px; font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.drawer-body   { overflow-y: auto; flex: 1; padding: 10px 14px; }
.drawer-foot   { padding: 14px 16px; border-top: 2px solid var(--border); background: #fff; }
.drawer-total  { display: flex; justify-content: space-between; font-size: 15px; margin-bottom: 12px; }
.drawer-total strong { font-size: 22px; font-weight: 900; color: var(--green); }

/* CART ITEMS */
.cart-item { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid #f3f4f6; }
.cart-item:last-child { border-bottom: none; }
.ci-icon { width: 42px; height: 42px; border-radius: 9px; background: var(--lime2); display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.ci-img  { width: 42px; height: 42px; border-radius: 9px; object-fit: cover; border: 1.5px solid var(--border); flex-shrink: 0; }
.ci-info { flex: 1; min-width: 0; }
.ci-nome { font-size: 14px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ci-qty  { font-size: 12px; color: var(--gray); }
.ci-right{ display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }
.ci-total{ font-size: 14px; font-weight: 900; color: var(--green); }
.ci-del  { background: #fee2e2; border: none; border-radius: 7px; width: 28px; height: 28px; font-size: 14px; cursor: pointer; display: flex; align-items: center; justify-content: center; }

.empty-cart { text-align: center; padding: 40px 20px; color: var(--gray); }
.empty-icon { font-size: 44px; margin-bottom: 8px; }

/* ── FOOTER ── */
.footer {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: #fff; border-top: 1.5px solid var(--border);
  height: var(--ftr-h); display: flex; align-items: center;
  justify-content: center; padding: 0 14px;
}
.footer-btn {
  width: 100%; max-width: 500px;
  display: flex; justify-content: space-between; align-items: center;
  background: var(--green); color: #fff;
  padding: 14px 20px; border-radius: 14px; border: none;
  font-family: inherit; font-size: 15px; font-weight: 800;
  cursor: pointer;
}

/* ── FORMS ── */
.form-group       { margin-bottom: 14px; }
.form-group label { display: block; font-size: 12px; font-weight: 700; color: var(--green); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 5px; }
.form-control {
  width: 100%; padding: 10px 13px;
  border: 2px solid var(--border); border-radius: 9px;
  font-family: inherit; font-size: 15px;
  transition: border-color .18s;
}
.form-control:focus { outline: none; border-color: var(--lime); }
.form-control-lg   { padding: 13px 15px; font-size: 16px; border-radius: 11px; }
.optional { color: var(--gray); font-weight: 400; text-transform: none; letter-spacing: 0; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px; border-radius: 10px; border: none;
  font-family: inherit; font-size: 15px; font-weight: 800;
  cursor: pointer; text-decoration: none; transition: all .18s;
}
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: #1a4731; }
.btn-ghost   { background: #f3f4f6; color: var(--dark); }
.btn-block   { width: 100%; }
.btn-lg      { padding: 14px; font-size: 16px; }

/* ── ALERTS ── */
.alert        { padding: 10px 14px; border-radius: 8px; font-size: 14px; margin-bottom: 14px; }
.alert-danger { background: #fee2e2; color: var(--red); }

/* ── IDENTIFICAÇÃO ── */
body.ident-page { display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; min-height: 100vh; background: var(--cream); }
.ident-card  { background: #fff; border: 1.5px solid var(--border); border-radius: 18px; padding: 36px 28px; width: 100%; max-width: 420px; box-shadow: 0 8px 32px rgba(45,106,79,.1); }
.ident-logo  { font-size: 44px; text-align: center; margin-bottom: 6px; }
.ident-store { text-align: center; font-size: 24px; font-weight: 900; }
.ident-sub   { text-align: center; color: var(--green2); font-weight: 700; margin-bottom: 6px; }
.ident-msg   { text-align: center; color: var(--gray); font-size: 14px; margin-bottom: 24px; }

/* ── STATUS PAGE ── */
.status-page { padding: 16px 14px; max-width: 520px; margin: 0 auto; }
.status-hero {
  border-radius: 16px; padding: 28px; text-align: center; margin-bottom: 20px;
  background: var(--lime2); border: 2px solid var(--border);
}
.status-hero.status-pronto    { background: #dcfce7; border-color: #86efac; }
.status-hero.status-separando { background: #dbeafe; border-color: #93c5fd; }
.status-hero.status-cancelado { background: #fee2e2; border-color: #fca5a5; }
.status-icon     { font-size: 52px; margin-bottom: 8px; }
.status-label    { font-size: 20px; font-weight: 900; text-transform: capitalize; }
.status-pedido-num { font-size: 14px; font-weight: 700; color: var(--green); margin-top: 4px; }
.status-data     { font-size: 12px; color: var(--gray); margin-top: 4px; }

/* TIMELINE */
.timeline { display: flex; align-items: center; justify-content: center; margin: 0 auto 20px; max-width: 400px; }
.tl-step  { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.tl-dot   { width: 36px; height: 36px; border-radius: 999px; background: #e5e7eb; display: flex; align-items: center; justify-content: center; font-size: 16px; transition: background .3s; }
.tl-step.done .tl-dot { background: var(--green); color: #fff; }
.tl-label { font-size: 10px; font-weight: 700; color: var(--gray); white-space: nowrap; }
.tl-step.done .tl-label { color: var(--green); }
.tl-line  { flex: 1; height: 3px; background: #e5e7eb; margin: 0 4px; margin-bottom: 22px; }
.tl-line.done { background: var(--green); }

/* STATUS ITEMS */
.status-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid #f3f4f6; }
.status-item:last-child { border-bottom: none; }
.si-icon { font-size: 22px; flex-shrink: 0; }
.si-info { flex: 1; }
.si-nome { font-size: 14px; font-weight: 700; }
.si-qty  { font-size: 12px; color: var(--gray); }
.si-obs  { font-size: 12px; color: #a16207; }
.si-status { font-size: 20px; flex-shrink: 0; }
.item-separado { opacity: 1; }
.item-falta    { opacity: .65; }

.total-row { display: flex; justify-content: space-between; align-items: center; font-size: 15px; background: #fff; border: 1.5px solid var(--border); border-radius: 10px; padding: 14px 16px; }
.total-row strong { font-size: 20px; font-weight: 900; color: var(--green); }

/* ── CARD ── */
.card { background: #fff; border: 1.5px solid var(--border); border-radius: 12px; padding: 18px; }
.card-title { font-size: 14px; font-weight: 800; color: var(--green); margin-bottom: 12px; }

/* ── TOAST ── */
.toast {
  position: fixed; bottom: calc(var(--ftr-h) + 12px); left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: var(--dark); color: #fff;
  padding: 10px 20px; border-radius: 99px;
  font-size: 14px; font-weight: 700;
  opacity: 0; transition: all .3s; z-index: 999; pointer-events: none; white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
