/* TortaPatrol Design System */
:root {
  --tp-red: #C62828;
  --tp-orange: #E64A19;
  --tp-yellow: #F9A825;
  --tp-green: #2E7D32;
  --tp-live: #00C853;
  --tp-offline: #9E9E9E;
  --tp-white: #FAFAFA;
  --tp-dark: #212121;
  --tp-gradient: linear-gradient(135deg, var(--tp-red) 0%, var(--tp-orange) 100%);
  --tp-radius: 14px;
  --tp-shadow: 0 4px 16px rgba(0,0,0,0.12);
  --tp-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--tp-font);
  color: var(--tp-dark);
  background: var(--tp-white);
  -webkit-text-size-adjust: 100%;
}

body { font-size: 16px; line-height: 1.5; }

a { color: var(--tp-red); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

input, select, textarea, button {
  font-family: inherit;
  font-size: 16px; /* prevents mobile zoom */
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 999px;
  border: none;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translateY(-2px); text-decoration: none; }
.btn-primary { background: var(--tp-white); color: var(--tp-red); box-shadow: var(--tp-shadow); }
.btn-solid-red { background: var(--tp-red); color: #fff; }
.btn-solid-green { background: var(--tp-green); color: #fff; }
.btn-outline { background: transparent; border: 2px solid currentColor; color: inherit; }
.btn-block { width: 100%; }
.btn-lg { padding: 20px 32px; font-size: 18px; }

/* Header / Nav */
.tp-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: #fff;
  border-bottom: 1px solid #eee;
  position: sticky;
  top: 0;
  z-index: 100;
}
.tp-nav .brand { font-weight: 900; font-size: 20px; color: var(--tp-red); display: flex; align-items: center; gap: 6px; }
.tp-nav ul { list-style: none; display: flex; gap: 20px; margin: 0; padding: 0; }
.tp-nav a { color: var(--tp-dark); font-weight: 600; font-size: 14px; }
.tp-nav-links { display: flex; align-items: center; gap: 20px; }
@media (max-width: 700px) {
  .tp-nav ul { display: none; }
}

/* Hero */
.tp-hero {
  background: var(--tp-gradient);
  color: #fff;
  padding: 60px 20px 70px;
  text-align: center;
}
.tp-hero h1 {
  font-size: clamp(32px, 8vw, 56px);
  font-weight: 900;
  margin: 0 0 12px;
  letter-spacing: -0.5px;
}
.tp-hero p.tagline { font-size: clamp(18px, 4vw, 24px); font-weight: 600; margin: 0 0 6px; }
.tp-hero p.subtag { font-size: 15px; opacity: 0.9; margin: 0 0 30px; }

.tp-search {
  display: flex;
  gap: 10px;
  max-width: 560px;
  margin: 0 auto 20px;
  flex-wrap: wrap;
}
.tp-search input {
  flex: 1;
  min-width: 200px;
  padding: 16px 20px;
  border-radius: 999px;
  border: none;
  font-size: 16px;
}
.tp-search button {
  white-space: nowrap;
}

.live-counter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.15);
  padding: 10px 20px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
}

/* Live pulse */
@keyframes tp-pulse {
  0% { box-shadow: 0 0 0 0 rgba(0,200,83,0.7); }
  70% { box-shadow: 0 0 0 10px rgba(0,200,83,0); }
  100% { box-shadow: 0 0 0 0 rgba(0,200,83,0); }
}
.pulse-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--tp-live);
  animation: tp-pulse 1.8s infinite;
  display: inline-block;
}
.status-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.status-dot.live { background: var(--tp-live); animation: tp-pulse 1.8s infinite; }
.status-dot.offline { background: var(--tp-offline); }

/* Sections */
section.tp-section { padding: 60px 20px; }
section.tp-section.alt { background: #fff5f0; }
section.tp-section.dark { background: var(--tp-dark); color: #fff; }
h2.section-title { font-size: clamp(24px, 5vw, 34px); font-weight: 900; text-align: center; margin: 0 0 40px; }

/* How it works */
.steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; max-width: 900px; margin: 0 auto; }
@media (max-width: 700px) { .steps-grid { grid-template-columns: 1fr; } }
.step-card { text-align: center; padding: 20px; }
.step-card .emoji { font-size: 40px; margin-bottom: 12px; }
.step-card h3 { font-size: 18px; margin: 0 0 8px; }
.step-card p { font-size: 14px; color: #555; margin: 0; }

/* Cuisine tiles */
.cuisine-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; max-width: 1000px; margin: 0 auto; }
@media (max-width: 900px) { .cuisine-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 500px) { .cuisine-grid { grid-template-columns: repeat(3, 1fr); } }
.cuisine-tile {
  background: #fff;
  border-radius: var(--tp-radius);
  padding: 18px 8px;
  text-align: center;
  box-shadow: var(--tp-shadow);
  font-weight: 700;
  font-size: 13px;
  color: var(--tp-dark);
}
.cuisine-tile .emoji { font-size: 28px; display: block; margin-bottom: 6px; }

/* Truck cards */
.truck-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 900px) { .truck-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .truck-grid { grid-template-columns: 1fr; } }
.truck-card {
  background: #fff;
  border-radius: var(--tp-radius);
  overflow: hidden;
  box-shadow: var(--tp-shadow);
  display: flex;
  flex-direction: column;
}
.truck-card .photo {
  height: 140px;
  background: var(--tp-gradient);
}
.truck-card .body { padding: 16px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.truck-card .name-row { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 16px; }
.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
}
.badge-verified { background: #E8F5E9; color: var(--tp-green); }
.badge-unverified { background: #F5F5F5; color: #757575; }
.tag { display: inline-block; font-size: 11px; background: #FFF3E0; color: var(--tp-orange); padding: 3px 10px; border-radius: 999px; margin: 2px 4px 2px 0; }

/* For-trucks dark section */
.dark-cta { text-align: center; }
.dark-cta h2 { font-size: clamp(24px, 5vw, 36px); font-weight: 900; }
.dark-cta p { opacity: 0.85; margin-bottom: 24px; }

/* Footer */
footer.tp-footer { background: var(--tp-dark); color: #ccc; padding: 40px 20px; text-align: center; font-size: 13px; }
footer.tp-footer a { color: #fff; margin: 0 10px; }
footer.tp-footer .copyright { margin-top: 16px; opacity: 0.6; }

/* Install prompt */
.install-prompt {
  background: #FFF8E1;
  border: 1px solid var(--tp-yellow);
  border-radius: var(--tp-radius);
  padding: 16px 20px;
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
}

/* Map page */
#tp-map { position: fixed; top: 56px; left: 0; right: 0; bottom: 0; z-index: 1; }
.filter-drawer {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: #fff;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
  padding: 16px 20px 24px;
  z-index: 200;
  transform: translateY(calc(100% - 50px));
  transition: transform 0.25s ease;
  max-height: 70vh;
  overflow-y: auto;
}
.filter-drawer.open { transform: translateY(0); }
.filter-drawer .handle { width: 40px; height: 5px; background: #ddd; border-radius: 3px; margin: 0 auto 12px; cursor: pointer; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.chip {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid #ddd;
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.chip.active { background: var(--tp-red); color: #fff; border-color: var(--tp-red); }
.my-location-btn {
  position: fixed;
  right: 16px;
  bottom: 90px;
  z-index: 150;
  background: #fff;
  border-radius: 50%;
  width: 52px;
  height: 52px;
  box-shadow: var(--tp-shadow);
  border: none;
  font-size: 20px;
  cursor: pointer;
}

/* Forms */
.form-card { background: #fff; border-radius: var(--tp-radius); box-shadow: var(--tp-shadow); padding: 30px; max-width: 520px; margin: 0 auto; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-weight: 700; font-size: 14px; margin-bottom: 6px; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #ddd;
  border-radius: 10px;
}
.form-steps { display: flex; gap: 6px; margin-bottom: 20px; }
.form-steps .dot { flex: 1; height: 4px; border-radius: 2px; background: #eee; }
.form-steps .dot.active { background: var(--tp-red); }

/* Dashboard Go Live */
.go-live-panel {
  border-radius: 20px;
  padding: 30px;
  text-align: center;
  color: #fff;
}
.go-live-panel.offline { background: var(--tp-offline); }
.go-live-panel.live { background: var(--tp-live); animation: tp-pulse 2s infinite; }
.go-live-btn {
  width: 100%;
  min-height: 80px;
  font-size: 22px;
  font-weight: 900;
  border-radius: 16px;
  border: none;
  cursor: pointer;
  margin-top: 16px;
}
.go-live-btn.go { background: var(--tp-green); color: #fff; }
.go-live-btn.stop { background: var(--tp-red); color: #fff; }

.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin: 20px 0; }
.stat-box { background: #fff; border-radius: var(--tp-radius); box-shadow: var(--tp-shadow); padding: 18px; text-align: center; }
.stat-box .num { font-size: 28px; font-weight: 900; color: var(--tp-red); }
.stat-box .label { font-size: 12px; color: #777; }

/* Claim banner */
.claim-banner { background: var(--tp-orange); color: #fff; padding: 20px; border-radius: var(--tp-radius); text-align: center; margin: 20px 0; }
.tell-truck-banner { background: #E8F5E9; border: 2px solid var(--tp-green); border-radius: var(--tp-radius); padding: 20px; margin: 20px 0; }

/* Tables */
table.tp-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--tp-radius); overflow: hidden; }
table.tp-table th, table.tp-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid #eee; font-size: 14px; }
table.tp-table th { background: #fafafa; font-weight: 700; }

.comp-table td.yes { color: var(--tp-green); font-weight: 700; }
.comp-table td.no { color: var(--tp-red); font-weight: 700; }

/* Utility */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.small { font-size: 13px; color: #777; }
