/*
 * WOW ATLAS Global 2.0 — reversible P0 presentation overlay.
 * Scope: existing .g2-* surfaces only. No compiled bundle is changed.
 */

:root {
  --p0-green: #103f38;
  --p0-coral: #f45a48;
  --p0-paper: #fbf7ee;
}

/* Header: the old red Moscow mini-mark is the image before the wordmark. */
.p0-design-overlay .g2-brand {
  gap: 0 !important;
}

.p0-design-overlay .g2-brand > img {
  display: none !important;
}

.p0-design-overlay .g2-brand > span {
  white-space: nowrap;
}

/* Guest profile: retain the Angular button/click target, replace hard-coded initials. */
.p0-design-overlay .g2-profile-bubble > .p0-profile-guest-icon {
  width: 25px;
  height: 25px;
  display: block;
  color: var(--p0-green);
}

/* The non-functional weekly excursion card is removed from every city. */
.p0-design-overlay .g2-week-route {
  display: none !important;
}

/* Onboarding fidelity: lively map, pins, route, plane and supplied WOW roundel. */
.p0-design-overlay .g2-onboarding {
  background:
    radial-gradient(circle at 112% 13%, rgba(255, 255, 255, .46) 0 23%, transparent 23.3%),
    radial-gradient(circle at -13% 90%, rgba(239, 205, 189, .43) 0 28%, transparent 28.3%),
    #cce5dd !important;
  color: var(--p0-green);
}

.p0-design-overlay .g2-onboarding__top > img {
  width: 170px !important;
  height: 32px !important;
  object-fit: contain !important;
}

.p0-design-overlay .g2-onboarding__art {
  width: 92% !important;
  min-height: 0 !important;
  aspect-ratio: 1.48;
  margin: 22px auto 10px !important;
  overflow: visible !important;
  border: 8px solid rgba(255, 255, 255, .96) !important;
  border-radius: 51% 49% 48% 52% / 47% 53% 48% 52% !important;
  background: transparent !important;
  isolation: isolate;
  box-shadow:
    0 0 0 9px rgba(255, 255, 255, .32),
    0 20px 36px rgba(16, 63, 56, .17) !important;
}

.p0-design-overlay .g2-onboarding__art::after {
  border-radius: inherit;
  pointer-events: none;
}

.p0-design-overlay .g2-onboarding__art > img:first-of-type {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  clip-path: inset(0 round 51% 49% 48% 52% / 47% 53% 48% 52%);
  animation: p0-map-drift 9s ease-in-out infinite alternate !important;
  will-change: object-position, filter;
}

.p0-design-overlay .g2-onboarding__badge {
  left: -10px !important;
  top: -13px !important;
  transform: rotate(-4deg);
  box-shadow: 0 10px 20px rgba(16, 63, 56, .14);
}

.p0-design-overlay .g2-onboarding__pin {
  animation: p0-pin-hop 2.45s cubic-bezier(.38, .04, .21, 1) infinite !important;
  will-change: transform, filter;
}

.p0-design-overlay .g2-onboarding__pin--b {
  animation-delay: .62s !important;
}

.p0-design-overlay .g2-onboarding__art > b.p0-logo-roundel {
  width: 78px !important;
  height: 78px !important;
  padding: 0 !important;
  border: 5px solid #fff !important;
  border-radius: 50% !important;
  overflow: hidden;
  background: #ff0828 !important;
  box-shadow: 0 13px 24px rgba(16, 63, 56, .24);
  right: -13px !important;
  bottom: -14px !important;
  animation: p0-badge-wobble 4.6s ease-in-out infinite !important;
  transform-origin: 50% 65%;
}

.p0-design-overlay .p0-logo-roundel > img {
  width: 100%;
  height: 100%;
  display: block;
  padding: 5px;
  object-fit: contain;
}

.p0-design-overlay .p0-onboarding-route {
  position: absolute;
  z-index: 2;
  inset: 12% 7% 8%;
  width: 86%;
  height: 80%;
  overflow: visible;
  pointer-events: none;
  filter: drop-shadow(0 3px 5px rgba(16, 63, 56, .12));
}

.p0-design-overlay .p0-onboarding-route path {
  fill: none;
  stroke: rgba(255, 255, 255, .8);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-dasharray: 5 10;
  animation: p0-route-flow 5.5s linear infinite;
}

.p0-design-overlay .p0-onboarding-flight {
  position: absolute;
  z-index: 4;
  left: 12%;
  top: 19%;
  width: 45px;
  height: 45px;
  display: grid;
  place-items: center;
  color: var(--p0-green);
  pointer-events: none;
  filter: drop-shadow(0 8px 9px rgba(16, 63, 56, .2));
  animation: p0-plane-route 7.5s cubic-bezier(.42, 0, .3, 1) infinite;
}

.p0-design-overlay .p0-onboarding-flight svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

/* Menu: bounded by the viewport, always scrollable from its real top. */
.p0-design-overlay .g2-menu {
  top: max(8px, env(safe-area-inset-top)) !important;
  bottom: max(8px, env(safe-area-inset-bottom)) !important;
  max-height: none !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scroll-padding-top: 26px;
  scrollbar-width: thin;
  scrollbar-color: rgba(16, 63, 56, .22) transparent;
}

.p0-design-overlay .g2-menu > div {
  gap: 12px !important;
  padding: 4px 3px 12px;
}

.p0-design-overlay .g2-menu > div > button {
  --p0-card-tilt: 0deg;
  min-height: 138px !important;
  border: 1px solid rgba(255, 255, 255, .45) !important;
  padding: 17px 18px !important;
  transform: rotate(var(--p0-card-tilt));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .5),
    0 13px 24px rgba(16, 63, 56, .08);
  animation: p0-menu-card-in .5s cubic-bezier(.2, .85, .2, 1) both;
  transition: transform .24s cubic-bezier(.2, .8, .2, 1), box-shadow .24s ease, filter .24s ease !important;
}

.p0-design-overlay .g2-menu > div > button:nth-child(1) {
  --p0-card-tilt: -.65deg;
  border-radius: 31px 43px 34px 27px !important;
}

.p0-design-overlay .g2-menu > div > button:nth-child(2) {
  --p0-card-tilt: .7deg;
  border-radius: 42px 29px 31px 39px !important;
  animation-delay: 35ms;
}

.p0-design-overlay .g2-menu > div > button:nth-child(3) {
  --p0-card-tilt: .45deg;
  border-radius: 27px 40px 42px 31px !important;
  animation-delay: 70ms;
}

.p0-design-overlay .g2-menu > div > button:nth-child(4) {
  --p0-card-tilt: -.55deg;
  border-radius: 41px 32px 27px 43px !important;
  animation-delay: 105ms;
}

.p0-design-overlay .g2-menu > div > button:nth-child(5) {
  --p0-card-tilt: -.35deg;
  border-radius: 35px 27px 43px 31px !important;
  animation-delay: 140ms;
}

.p0-design-overlay .g2-menu > div > button:nth-child(6) {
  --p0-card-tilt: .6deg;
  border-radius: 28px 42px 34px 40px !important;
  animation-delay: 175ms;
}

.p0-design-overlay .g2-menu > div > button:nth-child(7) {
  --p0-card-tilt: .35deg;
  border-radius: 39px 31px 43px 27px !important;
  animation-delay: 210ms;
}

.p0-design-overlay .g2-menu > div > button:nth-child(8) {
  --p0-card-tilt: -.45deg;
  border-radius: 29px 43px 31px 39px !important;
  animation-delay: 245ms;
}

.p0-design-overlay .g2-menu > div > button:nth-child(9) {
  --p0-card-tilt: .22deg;
  border-radius: 34px 44px 31px 42px !important;
  animation-delay: 280ms;
}

.p0-design-overlay .g2-menu > div > button:hover {
  transform: translateY(-5px) rotate(0deg) !important;
  box-shadow: 0 20px 34px rgba(16, 63, 56, .16);
  filter: saturate(1.05);
}

.p0-design-overlay .g2-menu > div > button:active {
  transform: scale(.965) rotate(0deg) !important;
}

.p0-design-overlay .g2-menu > div > button > span:first-child {
  width: 52px;
  height: 52px;
  border-radius: 18px 23px 20px 17px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, .64);
  color: var(--p0-green);
  box-shadow: inset 0 1px rgba(255, 255, 255, .78), 0 8px 18px rgba(16, 63, 56, .08);
  transition: transform .25s ease;
}

.p0-design-overlay .g2-menu > div > button > span:first-child app-g2-icon,
.p0-design-overlay .g2-menu > div > button > span:first-child svg {
  width: 27px !important;
  height: 27px !important;
}

.p0-design-overlay .g2-menu > div > button:hover > span:first-child {
  transform: rotate(8deg) scale(1.06);
}

.p0-design-overlay .g2-menu > div > button > strong {
  font-size: 22px !important;
  line-height: 1.05;
}

/* Category cards: retain all actions, increase icon presence and add gentle life. */
.p0-design-overlay .g2-editorial-card {
  transform-origin: 50% 80%;
  animation: p0-category-arrive .52s cubic-bezier(.2, .82, .2, 1) backwards;
}

.p0-design-overlay .g2-editorial-card:nth-child(2n) {
  animation-delay: 55ms;
}

.p0-design-overlay .g2-editorial-card:nth-child(3n) {
  animation-delay: 105ms;
}

.p0-design-overlay .g2-editorial-card__symbol {
  width: 74px !important;
  height: 74px !important;
  box-shadow: 0 9px 20px rgba(16, 63, 56, .11);
  animation: p0-category-icon-float 4.8s ease-in-out infinite;
}

.p0-design-overlay .g2-editorial-card:nth-child(2n) .g2-editorial-card__symbol {
  animation-delay: -1.7s;
}

.p0-design-overlay .g2-editorial-card:nth-child(3n) .g2-editorial-card__symbol {
  animation-delay: -3.1s;
}

/* Bottom dock: show a real profile glyph instead of invisible initials. */
.p0-design-overlay .g2-dock > button:last-child > b {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
}

.p0-design-overlay .p0-dock-profile-icon {
  width: 23px;
  height: 23px;
  display: block;
  color: currentColor;
}

/* Hotels reuses the existing working service action; the original stays below. */
.p0-design-overlay .g2-editorial-card.p0-hotels-card {
  --tile-accent: #efcdbd;
}

.p0-design-overlay .p0-hotels-card > .g2-editorial-card__wash {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(15deg, color-mix(in srgb, var(--tile-accent) 88%, #fff) 0 48%, #ffffff45);
  opacity: .94;
}

.p0-design-overlay .p0-hotels-card .g2-editorial-card__symbol > svg {
  width: 38px;
  height: 38px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@keyframes p0-map-drift {
  0% { object-position: 46% 49%; filter: saturate(.82) brightness(1.06); }
  50% { object-position: 53% 46%; filter: saturate(.88) brightness(1.04); }
  100% { object-position: 49% 53%; filter: saturate(.84) brightness(1.07); }
}

@keyframes p0-pin-hop {
  0%, 100% { transform: rotate(-45deg) translate3d(0, 0, 0); filter: drop-shadow(0 7px 8px rgba(15, 55, 48, .2)); }
  46% { transform: rotate(-45deg) translate3d(4px, -5px, 0) scale(1.035); filter: drop-shadow(-7px 13px 11px rgba(15, 55, 48, .28)); }
  58% { transform: rotate(-45deg) translate3d(2px, -2px, 0); }
}

@keyframes p0-badge-wobble {
  0%, 100% { transform: rotate(6deg) translateY(0); }
  35% { transform: rotate(1deg) translateY(-4px); }
  70% { transform: rotate(9deg) translateY(-1px); }
}

@keyframes p0-route-flow {
  to { stroke-dashoffset: -60; }
}

@keyframes p0-plane-route {
  0% { opacity: 0; transform: translate3d(-35px, 24px, 0) rotate(17deg) scale(.82); }
  9% { opacity: .92; }
  48% { opacity: .92; transform: translate3d(125px, -10px, 0) rotate(24deg) scale(1); }
  88% { opacity: .9; }
  100% { opacity: 0; transform: translate3d(285px, 48px, 0) rotate(35deg) scale(.86); }
}

@keyframes p0-menu-card-in {
  from { opacity: 0; transform: translateY(20px) scale(.965) rotate(0deg); }
  to { opacity: 1; transform: translateY(0) scale(1) rotate(var(--p0-card-tilt)); }
}

@keyframes p0-category-arrive {
  from { opacity: 0; transform: translateY(16px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes p0-category-icon-float {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-5px) rotate(3deg); }
}

@media (max-width: 520px) {
  .p0-design-overlay .g2-onboarding__top > img {
    width: 142px !important;
  }

  .p0-design-overlay .g2-menu {
    left: 8px !important;
    right: 8px !important;
    padding: 24px 20px 22px !important;
    border-radius: 34px !important;
  }

  .p0-design-overlay .g2-menu > div > button {
    min-height: 128px !important;
  }

  .p0-design-overlay .g2-menu > div > button > span:first-child {
    width: 48px;
    height: 48px;
  }
}

@media (max-height: 700px) and (max-width: 520px) {
  .p0-design-overlay .g2-menu > small {
    display: block;
    padding-top: 2px;
  }

  .p0-design-overlay .g2-menu h2 {
    margin-bottom: 18px !important;
    font-size: 34px !important;
  }

  .p0-design-overlay .g2-menu > div > button {
    min-height: 112px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .p0-design-overlay .g2-onboarding__art > img:first-of-type,
  .p0-design-overlay .g2-onboarding__pin,
  .p0-design-overlay .g2-onboarding__art > b.p0-logo-roundel,
  .p0-design-overlay .p0-onboarding-route path,
  .p0-design-overlay .p0-onboarding-flight,
  .p0-design-overlay .g2-menu > div > button,
  .p0-design-overlay .g2-editorial-card,
  .p0-design-overlay .g2-editorial-card__symbol {
    animation: none !important;
  }
}
