/* ============================================================
   DeliverApp — Estilos Públicos
   ============================================================ */

:root {
  --primary: #e63946;
  --primary-dark: #c1121f;
  --bg-light: #f8f9fa;
  --shadow-sm: 0 2px 8px rgba(0,0,0,.08);
  --shadow: 0 4px 16px rgba(0,0,0,.12);
  --radius: 12px;
  --transition: .2s ease;
}

* { box-sizing: border-box; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg-light);
  color: #212529;
}

/* ── Navbar ─────────────────────────────────────────────────── */
.navbar {
  background: var(--primary) !important;
  min-height: 56px;
}

/* ── Category nav ────────────────────────────────────────────── */
.cat-nav {
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.cat-nav::-webkit-scrollbar { display: none; }

.cat-btn {
  white-space: nowrap;
  border-radius: 20px;
  border: 2px solid #e0e0e0;
  color: #555;
  background: #fff;
  padding: 6px 16px;
  font-size: .85rem;
  transition: var(--transition);
}
.cat-btn:hover, .cat-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ── Section titles ─────────────────────────────────────────── */
.section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #333;
  padding-bottom: 8px;
  border-bottom: 2px solid #f0f0f0;
  margin-bottom: 16px;
}

/* ── Product card ────────────────────────────────────────────── */
.product-card {
  cursor: pointer;
  border-radius: var(--radius) !important;
  transition: transform var(--transition), box-shadow var(--transition);
  overflow: hidden;
}
.product-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow) !important;
}
.product-img {
  height: 160px;
  width: 100%;
  object-fit: cover;
}
.product-img-placeholder {
  height: 120px;
}
.product-desc {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: .8rem;
}
.add-btn {
  font-size: .78rem;
  padding: 4px 12px;
  white-space: nowrap;
}

/* ── Cart overlay ────────────────────────────────────────────── */
.cart-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 1040;
  animation: fadeIn .2s ease;
}
.cart-overlay.show { display: block; }

/* ── Cart sidebar ────────────────────────────────────────────── */
.cart-sidebar {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 380px;
  max-width: 95vw;
  background: #fff;
  z-index: 1050;
  display: flex;
  flex-direction: column;
  transform: translateX(110%);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  box-shadow: -4px 0 20px rgba(0,0,0,.15);
}
.cart-sidebar.open {
  transform: translateX(0);
}
.cart-body {
  flex: 1;
  overflow-y: auto;
}

/* ── Cart item ───────────────────────────────────────────────── */
.cart-item {
  border-bottom: 1px solid #f0f0f0;
  padding: 12px 0;
}
.cart-item:last-child { border-bottom: none; }
.qty-btn {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 1.5px solid #ddd;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: .75rem;
  transition: var(--transition);
}
.qty-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* ── Checkout ────────────────────────────────────────────────── */
.delivery-opt-card {
  cursor: pointer;
  transition: var(--transition);
  border: 2px solid #e0e0e0 !important;
}
.delivery-opt-card.selected {
  border-color: var(--primary) !important;
  background: #fff5f5;
}

.payment-opt {
  cursor: pointer;
  transition: var(--transition);
  border: 2px solid #e0e0e0 !important;
}
.payment-opt.selected {
  border-color: var(--primary) !important;
  background: #fff5f5;
}

/* ── Endereços salvos (checkout) ─────────────────────────────── */
.saved-addr-card {
  cursor: pointer;
  transition: var(--transition);
  border: 2px solid #e0e0e0 !important;
}
.saved-addr-card.selected {
  border-color: var(--primary) !important;
  background: #fff5f5;
}
.saved-addr-card:hover {
  border-color: var(--primary) !important;
}

/* ── Order confirmed ─────────────────────────────────────────── */
.check-circle {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Tracking timeline ───────────────────────────────────────── */
.status-timeline {
  display: flex;
  justify-content: space-between;
  position: relative;
  padding: 0 8px;
}
.status-timeline::before {
  content: '';
  position: absolute;
  top: 14px;
  left: 8%; right: 8%;
  height: 3px;
  background: #e0e0e0;
  z-index: 0;
}
.tl-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  z-index: 1;
  flex: 1;
}
.tl-icon {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .7rem;
  color: #999;
  transition: var(--transition);
}
.tl-label {
  font-size: .65rem;
  color: #999;
  text-align: center;
}
.tl-step.done .tl-icon  { background: var(--primary); color: #fff; }
.tl-step.done .tl-label { color: var(--primary); font-weight: 600; }
.tl-step.active .tl-icon {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(230,57,70,.25);
  transform: scale(1.15);
}

/* ── Utility ─────────────────────────────────────────────────── */
.cursor-pointer { cursor: pointer; }

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 576px) {
  .cart-sidebar { width: 100vw; }
  .product-img  { height: 130px; }
}
