:root {
  --brand: #1e4f92;
  --brand-dark: #132f5c;
  --ink: #1a1a1a;
  --white: #ffffff;
  --cream: #f7f3ea;
  --gold: #c4a35a;
  --grey-border: #9d9d9d;
  --font-display: "Arial Black", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #fff;
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

button {
  font: inherit;
  border: 0;
  background: none;
  cursor: pointer;
  color: inherit;
}

[hidden] {
  display: none !important;
}

/* ---------- Page wrapper ---------- */

.device {
  width: 100%;
  max-width: 480px;
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
}

/* ---------- Ad container ---------- */

.ad {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--white);
  user-select: none;
  -webkit-user-select: none;
}

/* ---------- Loader ---------- */

.loader {
  position: absolute;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--white);
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.ad:not(.is-loading) .loader {
  opacity: 0;
  visibility: hidden;
}

.spinner {
  width: 42px;
  height: 42px;
  border: 4px solid rgba(30, 79, 146, 0.15);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- Close button ---------- */

.close-btn {
  position: absolute;
  top: max(10px, env(safe-area-inset-top));
  right: 10px;
  z-index: 40;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  border: 1.5px solid rgba(255, 255, 255, 0.85);
}

.close-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: #fff;
  stroke-width: 2.6;
  stroke-linecap: round;
}

/* ---------- Video ---------- */

.video-wrap {
  position: relative;
  flex: none;
  width: 100%;
  background: #000;
  overflow: hidden;
  line-height: 0;
  font-size: 0;
}

.video-wrap:not(.has-player-script) {
  aspect-ratio: 16 / 9;
}

.video-wrap.has-player-script {
  aspect-ratio: auto;
  height: auto;
}

.video-wrap.has-player-script>video,
.video-wrap.has-player-script .video-ui,
.video-wrap.has-player-script .progress {
  display: none !important;
}

.video-wrap>video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.player-slot {
  position: relative;
  z-index: 1;
  width: 100%;
  height: auto;
  line-height: 0;
  font-size: 0;
}

.player-slot>div {
  width: 100%;
  line-height: normal;
  font-size: initial;
}

.video-ui {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}

.countdown {
  padding: 3px 8px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  font-variant-numeric: tabular-nums;
}

.sound-btn {
  pointer-events: auto;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
}

.sound-btn svg {
  width: 16px;
  height: 16px;
  fill: #fff;
}

.sound-btn .icon-sound,
.sound-btn.is-unmuted .icon-muted {
  display: none;
}

.sound-btn.is-unmuted .icon-sound {
  display: block;
}

.progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.25);
}

.progress-bar {
  width: 0;
  height: 100%;
  background: var(--brand);
}

.play-overlay,
.replay-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.play-overlay svg,
.replay-overlay svg {
  width: 44px;
  height: 44px;
  padding: 8px;
  border-radius: 50%;
  background: var(--brand);
  fill: #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

/* Fallback slate when no video file is available */

.video-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--brand);
  overflow: hidden;
}

.fallback-stripes {
  position: absolute;
  inset: -50%;
  background: repeating-linear-gradient(90deg,
      var(--brand) 0 28px,
      var(--white) 28px 40px);
  opacity: 0.18;
  animation: stripes 6s linear infinite;
}

@keyframes stripes {
  to {
    transform: translateX(80px);
  }
}

.fallback-content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #fff;
}

.fallback-logo {
  font-family: var(--font-display);
  font-size: 32px;
  line-height: 1;
  letter-spacing: 3px;
  animation: pop 0.8s cubic-bezier(0.2, 1.6, 0.4, 1) both;
}

.fallback-tag {
  margin-top: 6px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  animation: fadeUp 0.6s 0.5s ease both;
}

@keyframes pop {
  from {
    transform: scale(0.3);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes fadeUp {
  from {
    transform: translateY(10px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* ---------- Key visual ---------- */

.kv {
  position: relative;
  flex: none;
  width: 100%;
  aspect-ratio: 2 / 1;
  cursor: pointer;
  overflow: hidden;
  display: block;
  line-height: 0;
}

.kv-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.kv-art {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  gap: 4%;
  padding: 0 5%;
  background:
    radial-gradient(circle at 18% 50%, rgba(255, 255, 255, 0.18), transparent 55%),
    linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: var(--white);
}

.kv-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
}

.kv-title {
  font-family: var(--font-display);
  font-size: clamp(17px, 6.4vw, 26px);
  line-height: 0.98;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.2);
  animation: fadeUp 0.6s 0.4s ease both;
}

.kv-sub {
  font-size: clamp(10px, 3.1vw, 13px);
  font-weight: 600;
  opacity: 0.95;
  animation: fadeUp 0.6s 0.55s ease both;
}

.kv-pill {
  margin-top: 2px;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--white);
  color: var(--brand);
  font-size: clamp(9px, 2.8vw, 11px);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  animation: fadeUp 0.6s 0.7s ease both, nudge 2.4s 1.6s ease-in-out infinite;
}

@keyframes nudge {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(2px);
  }
}

/* ---------- Store locator ---------- */

.locator {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: linear-gradient(160deg, #0f2a5c 0%, #1a3f80 40%, #0c1f4a 100%);
}

/* ── Store panel ABOVE the map ── */

.store-panel {
  flex: none;
  min-height: 76px;
  padding: 35px 35px 35px 35px;
  background: transparent;
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.store-panel::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(196, 163, 90, 0.5), transparent);
}

.store-label {
  color: var(--gold);
  font-size: 12px;
  font-weight: 1000;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: 3px;
}

.store-name {
  color: var(--white);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.store-panel.is-default .store-name {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

.store-address {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 11px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.store-address:empty {
  display: none;
}

.store-meta {
  margin-top: 3px;
  display: flex;
  flex-wrap: wrap;
  gap: 0 10px;
  color: var(--gold);
  font-size: 10.5px;
  font-weight: 700;
}

.store-meta span:empty {
  display: none;
}

/* ── Map (flex 1) ── */

.map {
  position: relative;
  isolation: isolate;
  flex: 1;
  min-height: 100px;
  background: #0d1e3d;
  border-top: 1.5px solid rgba(196, 163, 90, 0.35);
  border-bottom: 1.5px solid rgba(196, 163, 90, 0.35);
}

.map iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* Google Maps-like look on top of the OpenStreetMap tiles */
.map-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
  font-family: Roboto, Arial, sans-serif;
  background: #f5f3ef;
}

.map-canvas .leaflet-tile-pane {
  filter: saturate(0.65) brightness(1.05) contrast(0.92);
}

.map-canvas .leaflet-control-attribution {
  padding: 0 4px;
  background: rgba(255, 255, 255, 0.7);
  color: #444;
  font-size: 8px;
  line-height: 1.4;
}

.map-canvas .leaflet-control-attribution a {
  color: #444;
}

.map-canvas .leaflet-bar {
  border: 0;
  border-radius: 2px;
  box-shadow: rgba(0, 0, 0, 0.3) 0 1px 4px -1px;
}

.map-canvas .leaflet-bar a {
  width: 26px;
  height: 26px;
  line-height: 26px;
  border-bottom: 1px solid #e6e6e6;
  color: #666;
  font-size: 16px;
  font-weight: 400;
}

.map-canvas .leaflet-bar a:last-child {
  border-bottom: 0;
}

.map-canvas .leaflet-bar a:hover {
  color: #333;
  background: #fff;
}

.map-canvas .leaflet-bottom.leaflet-right .leaflet-control-zoom {
  margin: 0 6px 12px 0;
}

.store-pin {
  background: none;
  border: 0;
}

/* Teardrop pin */
.store-pin span {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50% 50% 50% 0;
  background: var(--brand);
  border: 2px solid var(--white);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.35);
  transform: rotate(-45deg);
}

.store-pin span::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 34%;
  height: 34%;
  border-radius: 50%;
  background: var(--white);
  transform: translate(-50%, -50%);
}

.store-pin.is-active span {
  background: var(--gold);
  border-color: var(--white);
  border-width: 2.5px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.5);
}

.map-status {
  position: absolute;
  inset: 0;
  z-index: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #eef0f2;
  color: #555;
  font-size: 11px;
  font-weight: 600;
  transition: opacity 0.4s ease;
}

.map-status.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.pin-pulse {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 0 rgba(30, 79, 146, 0.5);
  animation: pulse 1.4s ease-out infinite;
}

@keyframes pulse {
  to {
    box-shadow: 0 0 0 16px rgba(30, 79, 146, 0);
  }
}

/* ── CTA buttons BELOW the map ── */

.cta-group {
  flex: none;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px 20px;
  background: transparent;
}

.cta {
  flex: 0 1 180px;
  width: 100%;
  max-width: 190px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  white-space: nowrap;
  box-sizing: border-box;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.12s ease, background 0.15s ease;
}

.cta svg {
  flex: none;
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.cta:active {
  transform: scale(0.96);
  filter: brightness(0.9);
}

/* Visit Store — shimmering gold fill */
.cta-primary {
  background: linear-gradient(135deg, #c4a35a 0%, #e5c97e 50%, #c4a35a 100%);
  color: #0b1a38;
  box-shadow: 0 2px 10px rgba(196, 163, 90, 0.45);
  border: 1px solid rgba(229, 201, 126, 0.6);
}

/* Call Now — gold outline & subtle tint */
.cta-secondary {
  background: rgba(196, 163, 90, 0.12);
  color: #f0d590;
  border: 1.5px solid #c4a35a;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.cta-secondary:hover {
  background: rgba(196, 163, 90, 0.22);
}

/* ---------- Closed (preview only) ---------- */

.closed-screen {
  position: absolute;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: #f4f4f4;
  color: #555;
  font-size: 14px;
}

.closed-screen button {
  padding: 8px 18px;
  border-radius: 4px;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
}

/* ---------- Small / short phones ---------- */

@media (max-height: 640px) {
  .store-panel {
    min-height: 68px;
    padding: 25px 25px 25px 25px;
  }

  .cta-group {
    padding-top: 8px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
    gap: 10px;
  }

  .cta {
    height: 34px;
    font-size: 11.5px;
  }
}

@media (max-height: 520px) {
  .kv {
    aspect-ratio: 2.3 / 1;
  }

  .store-panel {
    min-height: 54px;
    padding: 6px 10px 4px;
  }

  .store-label {
    font-size: 12px;
    margin-bottom: 2px;
  }

  .store-name {
    font-size: 12px;
  }

  .store-address {
    font-size: 10px;
    margin-top: 2px;
  }

  .store-meta {
    font-size: 9.5px;
    margin-top: 2px;
  }

  .map {
    min-height: 50px;
  }

  .cta-group {
    padding-top: 5px;
    padding-bottom: calc(5px + env(safe-area-inset-bottom));
    gap: 8px;
  }

  .cta {
    height: 28px;
    font-size: 10px;
    padding: 0 8px;
    gap: 5px;
  }

  .cta svg {
    width: 12px;
    height: 12px;
  }
}