/* ============================================================
   Code Clean Interactive Shop Tour — v1.1
   Goal: immersive full-page shop image with minimal popup overlay.
   ============================================================ */

:root {
  --yellow: #FFC72C;
  --navy: #0E2A4E;
  --white: #FFFFFF;
  --shadow-md: 0 10px 30px rgba(14, 42, 78, 0.12);
  --shadow-lg: 0 30px 80px rgba(14, 42, 78, 0.35);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  width: 100%;
  font-family: 'Prompt', system-ui, -apple-system, sans-serif;
  background: #FAFAF7;
}
button { font-family: inherit; cursor: pointer; }

/* ============================================================
   STAGE — full viewport, image fills the screen
   The image uses object-fit: contain at small viewports so the
   shop never gets cropped; on wider viewports it fills using
   the container's aspect ratio.
   ============================================================ */
.stage {
  position: relative;
  width: 100vw;
  min-height: 100vh;
  display: grid;
  place-items: center;
  /* v1.4: no side padding — image goes edge-to-edge */
  padding: 0;
  background: #FAFAF7;
}
/* Aspect-locked frame holds the image AND the hotspots together,
   so percentage-positioned hotspots always align with the photo
   regardless of viewport size. Image native aspect = ~2.05:1.
   The frame is sized to fit the viewport without cropping the
   image's top or bottom (returns to the rounded-edge look of v1.0). */
.stage__frame {
  position: relative;
  aspect-ratio: 1493 / 728;
  width: 100%;
  max-height: 100vh;
  /* When the viewport is wider than the image aspect, max-height
     wins and width auto-shrinks via aspect-ratio. */
  background: #DDE6EF;
  /* v1.3: rounded edges discarded — plain rectangular frame
     v1.4: side padding removed on stage for edge-to-edge fill */
}
.stage__img {
  width: 100%;
  height: 100%;
  display: block;
  /* contain prevents the top sky and bottom pavement from being
     cropped — the entire shop image is always visible. */
  object-fit: contain;
  user-select: none;
  pointer-events: none;
}

/* ============================================================
   HOTSPOTS — Positioned by data-x / data-y (% of image)
   To adjust a hotspot, edit its data-x / data-y in index.html.
   ============================================================ */
.hotspot {
  position: absolute;
  transform: translate(-50%, -50%);
  width: clamp(36px, 3.6vw, 54px);
  height: clamp(36px, 3.6vw, 54px);
  border: none;
  background: transparent;
  padding: 0;
  z-index: 5;
  outline: none;
}
.hotspot__ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid var(--yellow);
  box-shadow:
    0 0 0 3px rgba(255, 199, 44, 0.25),
    0 6px 18px rgba(14, 42, 78, 0.35);
  animation: pulse 2.4s var(--ease) infinite;
  background: radial-gradient(circle at center, rgba(255, 199, 44, 0.30) 0%, rgba(255, 199, 44, 0) 70%);
}
.hotspot__dot {
  position: absolute;
  inset: 22%;
  background: var(--yellow);
  color: var(--navy);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: clamp(13px, 1.4vw, 18px);
  box-shadow: 0 4px 10px rgba(14, 42, 78, 0.35);
  transition: transform 0.25s var(--ease), background 0.25s var(--ease);
}
.hotspot:hover .hotspot__dot,
.hotspot:focus-visible .hotspot__dot {
  transform: scale(1.12);
  background: var(--white);
}

/* ============================================================
   STORE BADGES — App Store + Google Play stacked vertically
   on the pavement area, above the @codecleanfamily strip.
   Positioned with percentages so they stay locked to the image.
   ============================================================ */
/* v1.8: Each badge positioned independently so we can move only
   the App Store badge closer to the Google Play badge. */
.store-badge {
  position: absolute;
  left: 13%;
  transform: translateX(-50%);
  width: 8%;
  z-index: 4;
  pointer-events: none;
  display: block;
  height: auto;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.35));
}
.store-badge--appstore {
  /* v1.8: App Store dropped down so it sits closer to Google Play.
     `top` here is the App Store badge's BOTTOM edge (transform -100%).
     Was ~84.66% in v1.7; now ~85.20% — a ~0.5% drop, gap narrowed. */
  top: 85.20%;
  transform: translate(-50%, -100%);
}
.store-badge--googleplay {
  /* Google Play kept at the same lower position as v1.7
     (top ≈ 85.34%, bottom ≈ 90.21%). */
  top: 85.34%;
  transform: translate(-50%, 0);
}

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0   rgba(255, 199, 44, 0.55), 0 6px 18px rgba(14, 42, 78, 0.35); }
  70%  { box-shadow: 0 0 0 18px rgba(255, 199, 44, 0),    0 6px 18px rgba(14, 42, 78, 0.35); }
  100% { box-shadow: 0 0 0 0   rgba(255, 199, 44, 0),    0 6px 18px rgba(14, 42, 78, 0.35); }
}

/* ============================================================
   MODAL — Minimal overlay containing only the source image,
   with rounded corners. Sized to feel like a polished tooltip
   sitting on top of the shop without overwhelming it.
   ============================================================ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s var(--ease);
}
.modal[aria-hidden="false"] {
  opacity: 1;
  pointer-events: auto;
}
.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(14, 42, 78, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.modal__panel {
  position: relative;
  background: var(--white);
  border-radius: 22px;
  padding: 12px;
  max-width: min(72vw, 880px);
  max-height: 82vh;
  box-shadow: var(--shadow-lg);
  transform: translateY(14px) scale(0.96);
  transition: transform 0.35s var(--ease);
  display: flex;
}
.modal[aria-hidden="false"] .modal__panel {
  transform: translateY(0) scale(1);
}
.modal__image {
  display: block;
  max-width: 100%;
  max-height: calc(82vh - 24px);
  width: auto;
  height: auto;
  border-radius: 14px;
  object-fit: contain;
}
.modal__close {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--white);
  color: var(--navy);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-md);
  transition: transform 0.2s var(--ease), background 0.2s var(--ease);
  z-index: 2;
}
.modal__close:hover {
  background: var(--yellow);
  transform: rotate(90deg);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .modal__panel {
    max-width: 92vw;
    max-height: 85vh;
    padding: 10px;
  }
  .modal__image { max-height: calc(85vh - 20px); }
}
@media (max-width: 640px) {
  .modal { padding: 16px; }
  .modal__close { top: -10px; right: -10px; width: 34px; height: 34px; }
}
