/* Shared nav: visible before/without hydration flash */
#shared-nav.shared-nav--ssr {
  visibility: visible !important;
}

/* Shared nav icon font — local copy (CDN font blocked off-domain) */
@font-face {
  font-family: "Shared-Nav-Icons";
  src: url("../assets/fonts/sharedNav.woff") format("woff");
  font-weight: normal;
  font-style: normal;
  font-display: block;
}

#shared-nav .shared-nav-icon::before,
#shared-nav .shared-nav-icon::after,
.search-container .shared-nav-icon::before,
.search-container .shared-nav-icon::after {
  font-family: "Shared-Nav-Icons" !important;
}

/* Sony bar: hidden on mobile */
@media screen and (max-width: 699px) {
  #sony-bar {
    display: none !important;
  }
}

/* ─── Typography: SST everywhere (matches PS Store) ─── */
html.psw-root,
html.psw-root body,
.psw-root,
#shared-nav,
#shared-nav-root,
#sb-social-toolbar-root,
.sony-bar {
  font-family: SST, helvetica, arial, sans-serif;
}

[data-qa="web-toolbar#profile-container#signin-button"].psw-purchase-button {
  font-weight: 700;
}

[data-qa="web-toolbar#profile-container#signin-button"].psw-purchase-button span {
  color: inherit;
}

/* ─── Loading overlays must be hidden (no JS loader) ─── */
.psw-loading-block {
  display: none !important;
}

/* ─── CTA sections: remove SSR hidden states (not hero background layers) ─── */
.psw-fade-out:not([data-qa="gameBackgroundImage#heroImage#preview"]) {
  visibility: visible !important;
  opacity: 1 !important;
}

/* ─── Hero background: preview blur + high-res overlay (matches PS Store) ─── */
[data-qa="gameBackgroundImage#heroImage"] {
  position: relative;
}

[data-qa="gameBackgroundImage#heroImage"] img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

[data-qa="gameBackgroundImage#heroImage#preview"].psw-fade-out {
  opacity: 0 !important;
}

[data-qa="gameBackgroundImage#heroImage#image"] {
  opacity: 0;
}

[data-qa="gameBackgroundImage#heroImage#image"].psw-fade-in {
  opacity: 1 !important;
}

/* ─── Media carousel nav (scoped — do not affect tertiary tabs) ─── */
[data-qa="mfe-media-carousel#mediaCarousel"] .psw-media-carousel-nav.carousel__overlay {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  pointer-events: none;
}

[data-qa="mfe-media-carousel#mediaCarousel"] .psw-media-carousel-nav.carousel__overlay--prev {
  left: 0;
  background: linear-gradient(to right, rgba(0, 0, 0, 0.5), transparent);
}

[data-qa="mfe-media-carousel#mediaCarousel"] .psw-media-carousel-nav.carousel__overlay--next {
  right: 0;
  background: linear-gradient(to left, rgba(0, 0, 0, 0.5), transparent);
}

[data-qa="mfe-media-carousel#mediaCarousel"] .psw-media-carousel-nav.hide {
  display: none;
}

[data-qa="mfe-media-carousel#mediaCarousel"] .psw-media-carousel-nav .carousel__button {
  width: 40px;
  height: 40px;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  cursor: pointer;
  pointer-events: auto;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

[data-qa="mfe-media-carousel#mediaCarousel"] .psw-media-carousel-nav .carousel__button::after {
  content: "";
  display: block;
  width: 10px;
  height: 10px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
}

[data-qa="mfe-media-carousel#mediaCarousel"]
  .psw-media-carousel-nav
  .carousel__button--prev::after {
  transform: rotate(135deg);
  margin-left: 3px;
}

[data-qa="mfe-media-carousel#mediaCarousel"]
  .psw-media-carousel-nav
  .carousel__button--next::after {
  transform: rotate(-45deg);
  margin-right: 3px;
}

[data-qa="mfe-media-carousel#mediaCarousel"] .psw-with-carousel-items {
  position: relative;
}

[data-qa="mfe-media-carousel#mediaCarousel"] .psw-strand-scroller {
  -webkit-overflow-scrolling: touch;
}

/* ─── NaN transform fix ─── */
[style*="NaN"] {
  transform: none !important;
}

/* ─── Inline-toast spacer hidden button - show real one ─── */
[data-qa="inline-toast#cta-spacer"] {
  display: none !important;
}

[data-qa="inline-toast#slot1"] {
  opacity: 1 !important;
  transform: none !important;
}

[data-qa="inline-toast#slot2"] {
  display: none !important;
}

[data-qa="inline-toast"] {
  perspective: none !important;
}

[data-qa="inline-toast"] > div {
  transform: none !important;
}

[data-qa="inline-toast"] > div > div {
  transform: none !important;
}

/* ─── CTA row: reserve height so Pre-Order stays inside the card ─── */
[data-qa="mfeCtaMain#cta"],
[data-qa="mfeUpsell#productEdition0#ctaWithPrice#cta"],
[data-qa="mfeUpsell#productEdition1#ctaWithPrice#cta"] {
  min-height: 40px;
}

[data-qa="mfeCtaMain#cta"] [data-qa="inline-toast"],
[data-qa="mfeUpsell#productEdition0#ctaWithPrice#cta"] [data-qa="inline-toast"],
[data-qa="mfeUpsell#productEdition1#ctaWithPrice#cta"] [data-qa="inline-toast"] {
  min-height: 40px;
}

@media screen and (max-width: 767px) {
  [data-qa="mfeCtaMain#cta"],
  [data-qa="mfeUpsell#productEdition0#ctaWithPrice#cta"],
  [data-qa="mfeUpsell#productEdition1#ctaWithPrice#cta"],
  [data-qa="mfeCtaMain#cta"] [data-qa="inline-toast"],
  [data-qa="mfeUpsell#productEdition0#ctaWithPrice#cta"] [data-qa="inline-toast"],
  [data-qa="mfeUpsell#productEdition1#ctaWithPrice#cta"] [data-qa="inline-toast"] {
    min-height: 34px;
  }
}

/* ─── Tertiary nav: centered tabs on desktop (shared-nav.js logic) ─── */
@media screen and (min-width: 768px) {
  #jetstream-tertiary-nav .tertiary-container-inner {
    position: relative;
  }

  #jetstream-tertiary-nav .tertiary-carousels.centered {
    position: absolute;
    left: 0;
    right: 0;
    width: 100%;
    margin: 0;
    justify-content: center;
  }

  #jetstream-tertiary-nav .tertiary-logo {
    position: relative;
    z-index: 2;
  }
}

/* ─── Mobile (matches PS Store breakpoints) ─── */
@media screen and (max-width: 767px) {
  /* PS logo: center in full header bar, not the narrowed nav column */
  #shared-nav {
    position: relative;
  }

  #shared-nav nav.shared-nav {
    flex: 1 1 auto;
    width: 100%;
    justify-content: center;
  }

  #shared-nav .shared-nav__ps-logo-container {
    position: absolute;
    left: calc(50% + 2px);
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    justify-content: center;
  }

  #shared-nav .shared-nav-ps-logo-link {
    margin-right: 0 !important;
    margin-left: 0 !important;
  }

  /* Tertiary tabs: horizontal scroll — styles from shared-nav.css */
  #jetstream-tertiary-nav .carousel-tertiary-tabs {
    -webkit-overflow-scrolling: touch;
  }

  /* Hide tertiary carousel arrows on mobile (original) */
  #jetstream-tertiary-nav .carousel__overlay {
    display: none !important;
  }

  /* CTA row: Pre-Order + Wishlist */
  [data-qa="inline-toast#slot1"] {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    width: 100%;
  }

  [data-qa="inline-toast#slot1"] .psw-purchase-button {
    flex: 1 1 auto;
    min-width: 0;
  }

  [data-qa="inline-toast#slot1"] [data-qa="wishlistToggle"] {
    flex: 0 0 auto;
  }

  /* Media carousel: swipe-only on mobile (no arrow overlays) */
  [data-qa="mfe-media-carousel#mediaCarousel"] .psw-media-carousel-nav.carousel__overlay {
    display: none !important;
  }

  [data-qa="mfe-media-carousel#mediaStrand#next"] .psw-media-next-chevron {
    display: block;
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(-45deg);
  }
}

@media screen and (max-width: 699px) {
  body {
    overflow-x: hidden;
  }
}
