:root {
  --brand: #e52525;
  --brand-dark: #c41c1c;
  --ink: #171717;
  --muted: #595959;
  --line: #ddd;
  --page: #f4f4f4;
  --whatsapp: #128c4b;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--page);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, Helvetica, sans-serif;
  color: var(--ink);
  line-height: 1.4;
}

[hidden] { display: none !important; }

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

.card {
  display: flex;
  flex-direction: column;
  max-width: 430px;
  min-height: calc(100vh - 36px);
  min-height: calc(100dvh - 36px);
  margin: 18px auto;
  background: #fff;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .10);
}

.hero {
  padding: 20px 20px 10px;
  text-align: center;
  border-bottom: 5px solid var(--brand);
}

.logo {
  display: block;
  width: 235px;
  max-width: 80%;
  height: auto;
  margin: 0 auto;
}

.title { font-size: 23px; font-weight: 800; margin: 4px 0; }
.subtitle { font-size: 14px; color: var(--muted); margin: 0 0 16px; }

.content { flex: 1; padding: 20px; }

.nearest {
  width: 100%;
  min-height: 52px;
  padding: 16px;
  border: 0;
  border-radius: 14px;
  background: var(--brand);
  color: #fff;
  font: inherit;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color .15s ease;
}
.nearest:hover { background: var(--brand-dark); }
.nearest:active { transform: translateY(1px); }
.nearest:disabled { opacity: .75; cursor: progress; }

.note {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin: 11px 0 22px;
}

.branch {
  margin: 12px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  scroll-margin: 16px;
}
.branch h2 { margin: 0 0 6px; font-size: 18px; }
.branch .address { margin: 0 0 13px; color: var(--muted); font-size: 13px; }

.nearest-branch {
  border: 2px solid var(--brand);
  box-shadow: 0 5px 18px rgba(229, 37, 37, .15);
}

.nearest-badge {
  width: fit-content;
  margin: 8px 0;
  padding: 6px 10px;
  border-radius: 20px;
  background: var(--brand);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.distance {
  margin: 8px 0 12px;
  color: #444;
  font-size: 13px;
  font-weight: 700;
}

.contact-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin: 10px 0;
  font-size: 14px;
}
.contact-row a {
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  padding: 6px 0;
}
.contact-row a:hover { text-decoration: underline; }

.contact-row .whatsapp {
  margin-left: auto;
  padding: 9px 12px;
  border-radius: 8px;
  background: var(--whatsapp);
  color: #fff;
  font-size: 13px;
}
.contact-row .whatsapp:hover { text-decoration: none; filter: brightness(1.1); }

.btn {
  display: inline-block;
  margin-top: 5px;
  padding: 12px 16px;
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
}
.btn:hover { background: #333; }

.footer {
  padding: 5px 20px 25px;
  text-align: center;
  color: #767676;
  font-size: 12px;
}

@media (max-width: 466px) {
  .card {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    border-radius: 0;
    box-shadow: none;
  }
  .content { padding: 16px; }
  .footer { padding-bottom: calc(25px + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
