:root {
  --primary-red: #cc0000;
  --text-black: #111111;
  --btn-bg: #ffffff;
  --btn-border: #111111;

  /* Layout tokens that shift at breakpoints */
  --header-space: 140px;
  --logo-width: 209px;
  --torn-height: 40px;
  --btn-width: 200px;
}

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

html {
  overflow-x: hidden;
  /* Stop iOS from auto-inflating text in landscape */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  background-color: #ffffff;
  font-family: "Open Sans", sans-serif;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow-x: hidden;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0.08);
}

.hero-section {
  position: relative;
  width: 100%;
  min-height: 75vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.site-header {
  width: 100%;
  padding: 20px 40px;
  display: flex;
  justify-content: center;
  background-color: transparent;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 10;
}

.site-logo {
  width: var(--logo-width);
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

/* Background layer inside hero-section using the true image */
.hero-bg-underlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("real_van_bg.jpg");
  background-size: cover;
  background-position: center;
  z-index: 0;
  /* Optional: add a slight dimming to match the Wix darkening if needed */
  background-color: rgba(0, 0, 0, 0.2);
  background-blend-mode: overlay;
}

.hero-content {
  position: relative;
  width: 100%;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--header-space) 1rem 4rem 1rem;
  z-index: 1;
}

/* Torn Edges */
.torn-edge {
  position: absolute;
  left: -5%;
  width: 110%; /* hide the side jaggedness by spilling over */
  height: var(--torn-height);
  z-index: 5;
  background-color: #ffffff;
  filter: url("#torn");
}

.torn-edge.top {
  top: calc(var(--torn-height) / -2);
}

.torn-edge.bottom {
  bottom: calc(var(--torn-height) / -2);
}

/* Typography */
h1 {
  font-family: "Montserrat", sans-serif;
  /* Scales from ~34px on small phones up to the original 80px on desktop */
  font-size: clamp(2.125rem, 9vw, 5rem);
  line-height: 1.1;
  font-weight: 700;
  color: #111111;
  margin-bottom: 0px;
  text-align: center;
  letter-spacing: normal;
  z-index: 2;
  overflow-wrap: break-word;
  text-wrap: balance;
}

.subtitle {
  color: #fff;
  font-size: clamp(1rem, 3.6vw, 1.5rem);
  line-height: 1.35;
  font-weight: 800;
  /* color: var(--text-black); */
  margin-bottom: 3rem;
  text-align: center;
  z-index: 2;
}

/* Grid Layout for Buttons */
.buttons-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(5, auto);
  gap: 12px 20px;
  grid-auto-flow: column;
  z-index: 2;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  justify-content: center;
}

.empty {
  visibility: hidden;
}

/* British Columbia page: staggered 3x3 layout, previously done with inline styles */
.buttons-grid--bc {
  grid-auto-flow: row;
  grid-template-columns: repeat(3, auto);
  grid-template-rows: repeat(3, auto);
  gap: 20px 40px;
  margin-top: 2rem;
}

.buttons-grid--bc .location-btn {
  width: auto;
  min-width: 250px;
}

.buttons-grid--bc .location-btn:nth-child(1) {
  grid-column: 1;
  grid-row: 1;
  min-width: 280px;
}
.buttons-grid--bc .location-btn:nth-child(2) {
  grid-column: 2;
  grid-row: 1;
}
.buttons-grid--bc .location-btn:nth-child(3) {
  grid-column: 3;
  grid-row: 2;
}
.buttons-grid--bc .location-btn:nth-child(4) {
  grid-column: 1;
  grid-row: 3;
  justify-self: center;
}
.buttons-grid--bc .location-btn:nth-child(5) {
  grid-column: 2;
  grid-row: 3;
}

/* Buttons */
.location-btn {
  background: var(--btn-bg);
  border: 2px solid var(--text-black);
  border-radius: 16px 0px 16px 0px;
  padding: 14px 20px;
  font-weight: 700;
  font-family: "Montserrat", sans-serif;
  font-size: 1rem;
  color: var(--text-black);
  cursor: pointer;
  position: relative;
  box-shadow: 4px 4px 0px var(--text-black);
  transition: all 0.2s ease;
  width: var(--btn-width);
  min-height: 48px; /* comfortable touch target */
  text-align: center;
  touch-action: manipulation;
}

/* Only apply the lift on devices that can actually hover, so the hover
   state does not stick to the last-tapped button on touch screens. */
@media (hover: hover) and (pointer: fine) {
  .location-btn:hover {
    background: var(--text-black);
    color: #ffffff;
    border-color: var(--text-black);
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0px var(--text-black);
  }
}

.location-btn:active {
  transform: translate(4px, 4px);
  box-shadow: 0px 0px 0px var(--text-black);
}

.location-btn:focus-visible {
  outline: 3px solid var(--primary-red);
  outline-offset: 3px;
}

/* Help Widget */
.help-widget {
  position: fixed;
  bottom: 30px;
  right: 30px;
  /* Keep clear of the iOS home indicator / Android gesture bar */
  bottom: max(30px, env(safe-area-inset-bottom, 0px));
  right: max(30px, env(safe-area-inset-right, 0px));
  z-index: 100;
}

.help-btn {
  background: #eef3f5;
  color: #ffffff;
  border: none;
  border-radius: 40px;
  padding: 8px 24px 8px 8px; /* Extra padding on right, tight on left for the circle */
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: "Open Sans", sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.5px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  text-shadow: 0px 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  touch-action: manipulation;
}

@media (hover: hover) and (pointer: fine) {
  .help-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  }
}

.help-btn .icon-circle {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  background-color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.help-btn svg {
  width: 18px;
  height: 26px;
}

/* ---------------------------------------------------------------
   Responsive breakpoints
   --------------------------------------------------------------- */

/* Small laptops / large tablets: shrink the fixed button width so the
   three columns keep fitting before we reflow them. */
@media (max-width: 900px) {
  :root {
    --btn-width: 100%;
    --header-space: 120px;
    --logo-width: 180px;
  }

  .site-header {
    padding: 16px 20px;
  }

  /* The headline wraps at these widths, so it needs a gap above the subtitle */
  h1 {
    margin-bottom: 0.4rem;
  }

  .hero-content {
    padding-bottom: 6rem; /* room above the floating help button */
  }

  .buttons-grid {
    max-width: 700px;
    gap: 12px 16px;
  }

  .buttons-grid--bc {
    max-width: 700px;
    gap: 16px 20px;
  }

  .buttons-grid--bc .location-btn,
  .buttons-grid--bc .location-btn:nth-child(1) {
    min-width: 0;
    width: 100%;
  }
}

/* Tablets and large phones: two columns, flowing in reading order. */
@media (max-width: 760px) {
  :root {
    --header-space: 110px;
    --logo-width: 160px;
    --torn-height: 28px;
  }

  .hero-section {
    min-height: 0;
  }

  .subtitle {
    margin-bottom: 2rem;
  }

  .buttons-grid,
  .buttons-grid--bc {
    grid-auto-flow: row;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto;
    max-width: 480px;
    gap: 12px;
    margin-top: 0;
  }

  /* Layout spacers only make sense in the desktop column flow */
  .empty {
    display: none;
  }

  /* Drop the staggered placement; let the BC buttons flow normally */
  .buttons-grid--bc .location-btn:nth-child(n) {
    grid-column: auto;
    grid-row: auto;
    justify-self: stretch;
    min-width: 0;
    width: 100%;
  }

  .location-btn {
    width: 100%;
    padding: 12px 12px;
    font-size: 0.9375rem;
    box-shadow: 3px 3px 0px var(--text-black);
  }

  .location-btn:active {
    transform: translate(3px, 3px);
  }

  .help-widget {
    bottom: max(16px, env(safe-area-inset-bottom, 0px));
    right: max(16px, env(safe-area-inset-right, 0px));
  }

  .help-btn {
    font-size: 0.95rem;
    padding: 6px 18px 6px 6px;
    gap: 10px;
  }

  .help-btn .icon-circle {
    width: 34px;
    height: 34px;
  }
}

/* Phones: single column so long province names never get squeezed. */
@media (max-width: 430px) {
  :root {
    --header-space: 96px;
    --logo-width: 140px;
  }

  .site-header {
    padding: 12px 16px;
  }

  .hero-content {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  .buttons-grid,
  .buttons-grid--bc {
    grid-template-columns: minmax(0, 1fr);
    max-width: 340px;
    gap: 10px;
  }

  .location-btn {
    font-size: 1rem;
    padding: 13px 14px;
  }
}

/* Very small phones / large accessibility text */
@media (max-width: 340px) {
  :root {
    --logo-width: 120px;
    --header-space: 84px;
  }

  .help-btn {
    font-size: 0.85rem;
  }
}

/* Short landscape phones: reclaim vertical space */
@media (max-height: 520px) and (orientation: landscape) {
  :root {
    --header-space: 84px;
  }

  .subtitle {
    margin-bottom: 1.25rem;
  }

  .hero-content {
    padding-top: var(--header-space);
    padding-bottom: 2.5rem;
  }
}

/* Animations */
.animate-drop {
  color: #fff;
  opacity: 0;
  animation: dropDown 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.animate-drop-delay {
  opacity: 0;
  animation: dropDown 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  animation-delay: 0.3s;
}

.animate-pop {
  opacity: 0;
  transform: scale(0.9) translateY(20px);
  animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  animation-delay: calc(var(--delay) * 0.1s + 0.5s);
}

.animate-slide-up {
  opacity: 0;
  animation: slideUp 0.6s ease-out forwards;
  animation-delay: 1.5s;
}

@keyframes dropDown {
  from {
    opacity: 0;
    transform: translateY(-40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes popIn {
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .animate-drop,
  .animate-drop-delay,
  .animate-pop,
  .animate-slide-up {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .location-btn,
  .help-btn {
    transition: none;
  }
}
