:root {
  --brand: #e31e24;
  --brand-dark: #a60e14;
  --sparx-blue: #3b82c4;
  --sparx-blue-light: #5ea2df;
  --accent: #ffe600;
  --ink: #111827;
  --white: #ffffff;
  --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%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: #d2dfe0;
  display: flex;
  align-items: center;
  justify-content: center;
  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: 320px;
  height: 480px;
  min-width: 320px;
  min-height: 480px;
  max-width: 320px;
  max-height: 480px;
  margin: auto;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  background: #fff;
}

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

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

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

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

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

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

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

.video-wrap:not(.has-player-script),
.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% !important;
  max-width: 100% !important;
  height: auto !important;
  object-fit: contain;
  display: block;
}

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

.player-slot>div,
.player-slot [id^="pf-"],
.player-slot [class*="yaas-wrapper"],
.player-slot [class*="yaas-container"],
.player-slot [class*="yaas-player"] {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  line-height: normal;
  font-size: initial;
}

.player-slot .yaas-aspect {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

.player-slot video {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

.player-slot>video {
  height: auto !important;
}

.player-slot iframe {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 100% !important;
  height: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  border: 0;
}

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

.video-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  overflow: hidden;
}

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

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

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

.fallback-logo {
  font-family: var(--font-display);
  font-size: 32px;
  font-style: italic;
  line-height: 1;
  letter-spacing: 3px;
  color: var(--accent);
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  animation: pop 0.8s cubic-bezier(0.2, 1.6, 0.4, 1) both;
}

.fallback-tag {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.2px;
  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: 1.9 / 1;
  cursor: pointer;
  overflow: hidden;
  display: block;
  line-height: 0;
  background: #4b94da;
}

.kv-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  object-position: center;
  display: block;
  opacity: 0;
  transition: opacity 0.4s ease-in-out;
}

.kv-image.is-visible {
  opacity: 1;
}

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

.locator {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: linear-gradient(160deg, #4b94da 0%, #63aae6 50%, #3478bd 100%);
}

/* Store panel ABOVE the map */

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

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

.store-label {
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  line-height: 1.25;
  margin-bottom: 1px;
  text-shadow: 0 1px 2px rgba(10, 35, 70, 0.35);
}

.store-name {
  color: var(--white);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 1px 2px rgba(10, 35, 70, 0.28);
}

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

/* Map (flex 1) */

.map {
  position: relative;
  isolation: isolate;
  flex: 1;
  min-height: 50px;
  background: #3a7ec2;
  border-top: 1px solid rgba(255, 255, 255, 0.4);
  border-bottom: 1px solid rgba(255, 255, 255, 0.4);
}

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

.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.75) brightness(1.03) contrast(0.95);
}

.map-canvas .leaflet-control-attribution {
  padding: 0 4px;
  background: rgba(255, 255, 255, 0.72);
  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: 15px;
  height: 15px;
  line-height: 15px;
  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(--sparx-blue);
  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(--brand);
  border-color: var(--white);
  border-width: 2.5px;
  box-shadow: 0 3px 10px rgba(227, 30, 36, 0.6);
}

.map-status {
  position: absolute;
  inset: 0;
  z-index: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #f3f3f5;
  color: #262830;
  font-size: 11px;
  font-weight: 700;
  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(227, 30, 36, 0.55);
  animation: pulse 1.4s ease-out infinite;
}

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

/* CTA button BELOW the map */

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

.cta {
  flex: 0 1 150px;
  width: 100%;
  max-width: 150px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 26px;
  padding: 0 10px;
  border-radius: 5px;
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  box-sizing: border-box;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.12s ease, opacity 0.15s ease;
}

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

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

.cta.is-loading {
  opacity: 0.85;
  cursor: wait;
}

/* Visit Store — bold Sparx red fill on light studio blue */
.cta-primary {
  background: linear-gradient(135deg, #e31e24 0%, #ff3b30 50%, #c81018 100%);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(15, 45, 85, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.45);
}

/* ---------- 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: #f2f7fc;
  color: #1f4f82;
  font-size: 14px;
  font-weight: 600;
}

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