/* css/style.css */

:root {
  --primary:       #e65100;
  --primary-light: #ff8f00;
  --bg:            #fff8ee;
  --bg-body:       #f5f0ea;
  --bg-white:      #ffffff;
  --text:          #4e342e;
  --text-light:    #8d6e63;
  --text-muted:    #a1887f;
  --border:        #f0e8e0;
  --border-warm:   #ffcc80;
  --success:       #4caf50;
  --success-bg:    #f1f8e9;
  --success-border:#a5d6a7;
  --wa-green:      #25d366;
  --disabled-bg:   #e0e0e0;
  --disabled-text: #bdbdbd;
  --radius:        14px;
  --radius-sm:     10px;
  --radius-xs:     8px;
  --shadow:        0 2px 10px rgba(0,0,0,0.08);
  --shadow-btn:    0 4px 14px rgba(230,81,0,0.35);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg-body);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── HEADER ── */
.header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  padding: 16px 18px 14px;
  color: white;
  position: sticky;
  top: 0;
  z-index: 10;
}
.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.header-logo {
  font-size: 1.3rem;
  font-weight: 900;
  letter-spacing: -0.5px;
}
.header-logo span { opacity: 0.85; font-weight: 400; }
.header-sub { font-size: 0.7rem; opacity: 0.88; margin-top: 3px; }
.header-badge {
  background: rgba(255,255,255,0.25);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 0.68rem;
  font-weight: 600;
}
.header-back {
  display: flex;
  align-items: center;
  gap: 10px;
}
.back-btn {
  width: 32px;
  height: 32px;
  background: rgba(255,255,255,0.2);
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: white;
  text-decoration: none;
  flex-shrink: 0;
}
.header-title { font-size: 0.95rem; font-weight: 800; }
.header-seller { font-size: 0.68rem; opacity: 0.85; margin-top: 2px; }

/* ── SEARCH BAR (home) ── */
.search-bar {
  background: rgba(255,255,255,0.95);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ── MAIN CONTENT ── */
.main { padding: 16px; max-width: 480px; margin: 0 auto; }

/* ── SECTION LABEL ── */
.section-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 12px;
}

/* ── SELLER CARD (home) ── */
.seller-card {
  background: var(--bg-white);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.seller-header {
  background: linear-gradient(90deg, var(--bg) 0%, #fff3e0 100%);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #ffe0b2;
}
.seller-avatar {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg);
}
.seller-avatar svg, .seller-avatar img { width: 100%; height: 100%; }
.seller-name { font-weight: 800; font-size: 1rem; color: var(--text); }
.seller-apt  { font-size: 0.7rem; color: var(--text-muted); margin-top: 2px; }
.seller-desc { font-size: 0.75rem; color: #6d4c41; margin-top: 4px; line-height: 1.4; }

/* ── PRODUCT ITEM (home) ── */
.product-item {
  padding: 13px 16px;
  border-bottom: 1px solid #fafafa;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
}
.product-item:last-child { border-bottom: none; }
.product-item:active { background: var(--bg); }
.product-left { flex: 1; }
.product-name { font-weight: 700; font-size: 0.9rem; color: var(--text); }
.product-meta { font-size: 0.7rem; color: var(--text-muted); margin-top: 3px; }
.product-tags { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.tag {
  background: #fff3e0;
  color: var(--primary);
  border-radius: 20px;
  padding: 2px 8px;
  font-size: 0.63rem;
  font-weight: 600;
}
.product-price { font-size: 0.8rem; font-weight: 700; color: var(--primary); margin-top: 3px; }
.product-arrow { color: var(--primary); font-size: 1.2rem; margin-left: 10px; flex-shrink: 0; }

/* ── STEPS INDICATOR ── */
.steps {
  background: var(--bg);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid #ffe0b2;
}
.step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--disabled-text);
}
.step.active { color: var(--primary); }
.step.done   { color: var(--success); }
.step-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--disabled-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--disabled-text);
}
.step.active .step-dot { background: var(--primary);  color: white; }
.step.done   .step-dot { background: var(--success);  color: white; }
.step-line { flex: 0.3; height: 2px; background: var(--disabled-bg); margin-bottom: 14px; }
.step-line.done { background: var(--success); }

/* ── SELLER MINI CARD (product pages) ── */
.seller-mini {
  background: var(--bg-white);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.seller-mini-avatar {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg);
}
.seller-mini-name { font-weight: 700; font-size: 0.85rem; color: var(--text); }
.seller-mini-apt  { font-size: 0.68rem; color: var(--text-muted); margin-top: 1px; }

/* ── FORM ELEMENTS ── */
.form-group { margin-bottom: 16px; }

.form-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  color: #6d4c41;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 7px;
}

.error-msg {
  display: none;
  font-size: 0.7rem;
  color: #c62828;
  margin-top: 5px;
}

/* Radio options */
.radio-group { display: flex; flex-direction: column; gap: 8px; }

.radio-opt {
  background: var(--bg-white);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.radio-opt:has(input:checked) { border-color: var(--primary); background: var(--bg); }
.radio-opt input[type="radio"] { display: none; }
.radio-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #ccc;
  flex-shrink: 0;
  margin-right: 10px;
  transition: all 0.15s;
  position: relative;
}
.radio-opt:has(input:checked) .radio-dot {
  border-color: var(--primary);
  background: var(--primary);
}
.radio-opt:has(input:checked) .radio-dot::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 6px;
  height: 6px;
  background: white;
  border-radius: 50%;
}
.radio-opt-left { display: flex; align-items: center; }
.radio-opt-name { font-size: 0.85rem; font-weight: 600; color: var(--text); }
.radio-opt-price { font-size: 0.78rem; color: var(--primary); font-weight: 700; }

/* Qty row */
.qty-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-white);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  border: 2px solid var(--primary);
}
.qty-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-xs);
  background: var(--primary);
  color: white;
  border: none;
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.qty-btn:active { opacity: 0.8; }
.qty-val {
  flex: 1;
  text-align: center;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text);
}
.qty-label { font-size: 0.72rem; color: var(--text-muted); }

/* Pill group (refeição / vinagrete) */
.pill-group { display: flex; gap: 8px; }
.pill {
  flex: 1;
  background: var(--bg-white);
  border: 2px solid var(--border);
  border-radius: 20px;
  padding: 9px;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.pill.selected { background: var(--primary); border-color: var(--primary); color: white; }

/* Date input */
.date-input {
  width: 100%;
  background: var(--bg-white);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  font-size: 0.9rem;
  color: var(--text);
  outline: none;
  font-family: inherit;
  -webkit-appearance: none;
}
.date-input:focus { border-color: var(--primary); }
.date-hint { font-size: 0.67rem; color: var(--text-muted); margin-top: 4px; }

/* Textarea */
.obs-input {
  width: 100%;
  background: var(--bg-white);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  font-size: 0.85rem;
  color: var(--text);
  outline: none;
  font-family: inherit;
  resize: none;
  min-height: 70px;
}
.obs-input:focus { border-color: var(--primary); }

/* ── PRICE PREVIEW ── */
.price-preview {
  background: linear-gradient(135deg, var(--bg) 0%, #fff3e0 100%);
  border-radius: var(--radius-sm);
  padding: 13px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1.5px solid var(--border-warm);
  margin-bottom: 16px;
}
.price-label { font-size: 0.75rem; color: var(--text-light); }
.price-desc  { font-size: 0.67rem; color: var(--text-muted); margin-top: 2px; }
.price-value { font-size: 1.4rem; font-weight: 900; color: var(--primary); }

/* ── BUTTONS ── */
.btn-primary {
  display: block;
  width: 100%;
  padding: 15px;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 800;
  text-align: center;
  cursor: pointer;
  box-shadow: var(--shadow-btn);
  -webkit-tap-highlight-color: transparent;
  min-height: 50px;
}
.btn-primary:active { opacity: 0.9; }

.btn-whatsapp {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 15px;
  background: var(--wa-green);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(37,211,102,0.35);
  text-decoration: none;
  min-height: 50px;
  transition: opacity 0.2s;
}
.btn-whatsapp:active { opacity: 0.9; }
.btn-whatsapp.btn-disabled {
  background: var(--disabled-bg);
  color: var(--disabled-text);
  box-shadow: none;
  cursor: not-allowed;
  pointer-events: none;
}

/* ── PIX SECTION ── */
.order-summary {
  background: var(--bg-white);
  border-radius: var(--radius-sm);
  padding: 13px 15px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.summary-title {
  font-size: 0.67rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 9px;
  letter-spacing: 1px;
}
.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid #fafafa;
  font-size: 0.8rem;
}
.summary-row:last-child { border: none; }
.summary-key { color: #6d4c41; }
.summary-val { color: var(--text); font-weight: 600; }
.summary-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  margin-top: 6px;
  border-top: 2px solid #fff3e0;
}
.summary-total-label { font-size: 0.82rem; font-weight: 700; color: #5d4037; }
.summary-total-val   { font-size: 1.4rem; font-weight: 900; color: var(--primary); }

.pix-key-card {
  background: var(--bg-white);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 12px;
  text-align: center;
  box-shadow: var(--shadow);
}
.pix-key-label {
  font-size: 0.67rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 1px;
  margin-bottom: 10px;
}
#qr-code {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}
#qr-code canvas, #qr-code img { border-radius: var(--radius-xs); }

.pix-key-row {
  background: var(--bg);
  border: 1.5px solid var(--border-warm);
  border-radius: var(--radius-xs);
  padding: 9px 12px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.btn-copiar {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s;
}
.pix-recebedor { font-size: 0.68rem; color: var(--text-muted); margin-top: 6px; }

.pix-alert {
  background: #fff3e0;
  border-left: 4px solid var(--primary-light);
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
  padding: 10px 12px;
  margin-bottom: 12px;
  font-size: 0.72rem;
  color: #6d4c41;
  line-height: 1.5;
}

/* Confirm checkbox */
.confirm-check {
  background: var(--bg-white);
  border-radius: var(--radius-sm);
  padding: 13px;
  margin-bottom: 14px;
  display: flex;
  align-items: flex-start;
  gap: 11px;
  box-shadow: var(--shadow);
  cursor: pointer;
  border: 2px solid var(--border);
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.confirm-check.checked { background: var(--success-bg); border-color: var(--success-border); }
.confirm-check input[type="checkbox"] { display: none; }
.custom-check {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  border: 2.5px solid #ccc;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  margin-top: 1px;
  transition: all 0.2s;
}
.confirm-check.checked .custom-check {
  background: var(--success);
  border-color: var(--success);
  color: white;
}
.confirm-text {
  font-size: 0.78rem;
  color: #5d4037;
  line-height: 1.45;
}
.confirm-text strong { color: var(--primary); }

/* ── FOOTER BAR ── */
.footer-bar {
  background: var(--bg-white);
  padding: 12px 16px;
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  margin-top: 20px;
}

/* ── FEIJOADA ALERT ── */
.order-closed-alert {
  display: none;
  background: #fff3e0;
  border: 1.5px solid var(--border-warm);
  border-radius: var(--radius-sm);
  padding: 14px;
  text-align: center;
  margin-bottom: 16px;
  font-size: 0.82rem;
  color: #6d4c41;
  line-height: 1.5;
}

/* ── UTILITIES ── */
.hidden { display: none !important; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
