:root {
  --kfc-red: #e4002b;
  --kfc-red-dark: #a3001f;
  --kfc-black: #1a1a1a;
  --kfc-white: #ffffff;
  --kfc-cream: #fff6ec;
  --grey-border: #9d9d9d;
  --grey-cta: #5f6368;
  --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(--kfc-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(--kfc-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(228, 0, 43, 0.15);
  border-top-color: var(--kfc-red);
  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 player ---------- */

.video-wrap {
  position: relative;
  flex: none;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
}

.player-slot {
  position: absolute;
  inset: 0;
  z-index: 1;
}

/* Placeholder shown behind the player until it renders */

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

.fallback-stripes {
  position: absolute;
  inset: -50%;
  background: repeating-linear-gradient(
    90deg,
    var(--kfc-red) 0 28px,
    var(--kfc-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: 54px;
  line-height: 1;
  letter-spacing: 2px;
  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;
}

.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(--kfc-red) 0%, var(--kfc-red-dark) 100%);
  color: var(--kfc-white);
}

.bucket {
  position: relative;
  flex: none;
  width: 27%;
  height: 84%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  animation: bucketIn 0.7s 0.3s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}

.bucket-chicken {
  position: absolute;
  top: 0;
  left: 6%;
  right: 6%;
  height: 34%;
  border-radius: 50% 50% 30% 30%;
  background:
    radial-gradient(circle at 25% 60%, #d98a2b 0 28%, transparent 30%),
    radial-gradient(circle at 55% 40%, #e9a03f 0 30%, transparent 32%),
    radial-gradient(circle at 80% 62%, #c97a1f 0 26%, transparent 28%);
}

.bucket-body {
  position: relative;
  height: 72%;
  clip-path: polygon(0 0, 100% 0, 88% 100%, 12% 100%);
  background: repeating-linear-gradient(
    90deg,
    var(--kfc-red) 0 16%,
    var(--kfc-white) 16% 26%
  );
  border-top: 4px solid var(--kfc-white);
  display: flex;
  align-items: center;
  justify-content: center;
}

.bucket-body span {
  padding: 2px 6px;
  background: var(--kfc-white);
  color: var(--kfc-red);
  font-family: var(--font-display);
  font-size: clamp(10px, 3.6vw, 15px);
  border-radius: 3px;
}

.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(--kfc-white);
  color: var(--kfc-red);
  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 bucketIn {
  from { transform: translateY(30%) scale(0.7); opacity: 0; }
  to { transform: none; opacity: 1; }
}

@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;
}

.map {
  position: relative;
  flex: 1;
  display: block;
  width: 100%;
  min-height: 0;
  overflow: hidden;
  background: #ece8e1;
}

.map-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.map:not(.is-live)::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.map .map-canvas {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.map.is-live .map-canvas {
  opacity: 1;
}

.map.is-live .map-cta,
.map.is-live .map-image {
  display: none;
}

.map-locate {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--kfc-white);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.map-locate svg {
  width: 22px;
  height: 22px;
  fill: var(--kfc-black);
}

.map-locate.is-busy svg {
  fill: #1a73e8;
  animation: spin 1.2s linear infinite;
}

.map-cta {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #fff;
}

.map-text {
  font-size: 13px;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.map-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--kfc-white);
  box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.55);
  animation: pulse 1.6s ease-out infinite;
}

.map-icon svg {
  width: 24px;
  height: 24px;
  fill: var(--kfc-black);
}

.map-cta:active .map-icon {
  transform: scale(0.94);
}

@keyframes pulse {
  to { box-shadow: 0 0 0 14px rgba(255, 255, 255, 0); }
}

.store-bar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: var(--kfc-white);
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.08);
}

.store-info {
  flex: 1;
  min-width: 0;
}

.store-headline {
  color: var(--kfc-black);
  font-size: 15px;
  line-height: 1.2;
}

.store-name {
  margin-top: 2px;
  color: var(--kfc-black);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.store-phone {
  margin-top: 2px;
  color: #555;
  font-size: 11.5px;
}

.store-info p:empty {
  display: none;
}

.cta-group {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 36%;
  max-width: 140px;
}

.cta {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  padding: 0 8px;
  border-radius: 8px;
  color: var(--kfc-white);
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
  transition: transform 0.12s ease, filter 0.12s ease;
}

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

.cta-outlet {
  background: var(--grey-cta);
}

.cta-call {
  background: var(--kfc-red);
}

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

.outlet-panel {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  background: var(--kfc-white);
  animation: panelIn 0.3s ease both;
}

@keyframes panelIn {
  from { transform: translateY(100%); }
  to { transform: none; }
}

.panel-head {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: max(10px, env(safe-area-inset-top)) 10px 10px;
  background: var(--kfc-black);
  color: var(--kfc-white);
}

.panel-logo {
  padding: 3px 6px;
  border-radius: 3px;
  background: var(--kfc-red);
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 1px;
}

.panel-head-title {
  flex: 1;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.panel-close {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.85);
}

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

.panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
}

.panel-title {
  padding-bottom: 8px;
  border-bottom: 1px solid #ddd;
  color: #333;
  font-size: 14px;
  font-weight: 400;
}

.panel-tabs {
  margin: 12px 0 14px;
}

.panel-tab {
  display: inline-block;
  padding: 4px 10px;
  border: 1px solid var(--kfc-black);
  color: var(--kfc-black);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.panel-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.field {
  display: flex;
  align-items: center;
  gap: 10px;
}

.field-label {
  flex: none;
  width: 62px;
  color: #444;
  font-size: 12px;
}

.field-label sup {
  color: var(--kfc-red);
}

.field select {
  flex: 1;
  min-width: 0;
  height: 32px;
  padding: 0 8px;
  border: 1px solid #c9c9c9;
  border-radius: 3px;
  background: #fff;
  color: var(--kfc-black);
  font: inherit;
  font-size: 13px;
}

.field select:disabled {
  background: #f3f3f3;
  color: #888;
}

.panel-error {
  color: var(--kfc-red);
  font-size: 11px;
  font-weight: 600;
}

.panel-actions {
  display: flex;
  gap: 8px;
}

.panel-search {
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 18px;
  border-radius: 3px;
  background: var(--kfc-red);
  color: var(--kfc-white);
  font-size: 13px;
  font-weight: 700;
}

.panel-search svg,
.panel-helpline svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.panel-search:active,
.panel-helpline:active {
  filter: brightness(0.92);
}

.panel-helpline {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 34px;
  padding: 0 8px;
  border: 1.5px solid var(--kfc-red);
  border-radius: 3px;
  color: var(--kfc-red);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

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

.results {
  margin-top: 18px;
  scroll-margin-top: 8px;
}

.results-title {
  padding-bottom: 8px;
  border-bottom: 2px solid var(--kfc-black);
  color: var(--kfc-black);
  font-family: var(--font-display);
  font-size: 14px;
  line-height: 1.25;
  text-transform: uppercase;
}

.results-note {
  margin-top: 8px;
  color: #666;
  font-size: 11px;
}

.outlet-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.outlet-card {
  overflow: hidden;
  border: 1px solid #ddd;
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.outlet-name {
  padding: 10px 12px 0;
  color: var(--kfc-black);
  font-size: 13px;
  font-weight: 700;
}

.outlet-addr {
  padding: 4px 12px 0;
  color: #444;
  font-size: 11.5px;
  line-height: 1.4;
}

.outlet-phone {
  padding: 4px 12px 0;
  color: #444;
  font-size: 11.5px;
}

.outlet-actions {
  display: flex;
  margin-top: 10px;
  background: var(--kfc-red);
}

.outlet-btn {
  flex: 1;
  height: 32px;
  color: var(--kfc-white);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.outlet-btn + .outlet-btn {
  border-left: 1px solid rgba(255, 255, 255, 0.35);
}

.outlet-btn:active {
  background: var(--kfc-red-dark);
}

.results-more {
  display: block;
  width: 100%;
  height: 34px;
  margin-top: 12px;
  border: 1.5px solid var(--kfc-black);
  border-radius: 3px;
  color: var(--kfc-black);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

/* ---------- 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(--kfc-red);
  color: #fff;
  font-weight: 700;
}

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

@media (max-height: 560px) {
  .store-bar {
    padding-top: 6px;
    padding-bottom: 6px;
  }

  .store-headline {
    font-size: 13.5px;
  }

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

  .store-phone {
    font-size: 11px;
  }

  .cta {
    height: 26px;
    font-size: 10.5px;
  }

  .map-cta {
    gap: 6px;
  }

  .map-text {
    font-size: 12px;
  }

  .map-icon {
    width: 32px;
    height: 32px;
  }

  .map-icon svg {
    width: 20px;
    height: 20px;
  }

  .map-locate {
    top: 6px;
    left: 6px;
    width: 30px;
    height: 30px;
  }

  .map-locate svg {
    width: 18px;
    height: 18px;
  }

  .map .maplibregl-ctrl-group {
    display: none;
  }
}
