/**
 * Targeted section fixes (membership, programs, partnerships, booking contact,
 * protein dose, calculators, preview). Preserves existing visual identity.
 */

:root {
  --booking-main-button-radius: var(--button-radius, 12px);
  --protein-dose-icon-size-desktop: 26px;
  --protein-dose-icon-size-mobile: 22px;
  --calc-result-panel-radius: 16px;
  --calc-result-panel-border: rgba(255, 255, 255, 0.14);
  --calc-result-panel-padding: clamp(18px, 3vw, 28px);
  --calc-result-panel-bg: var(--site-glass-bg-strong, rgba(18, 16, 22, 0.72));
}

/* ===== PHASE 1 — Membership: full mobile content, badge alignment ===== */
/* Offer badge is absolutely positioned, so all cards share the same padding-top
   and title/price start on the same baseline. */
body:not(.dashboard-app-body) .membership-card:not(:has(.membership-card-ribbon))::before {
  display: none !important;
  content: none !important;
  height: 0 !important;
}

@media (max-width: 760px) {
  body:not(.dashboard-app-body) .membership-section {
    overflow-x: clip;
    overflow-y: visible !important;
  }

  body:not(.dashboard-app-body) .membership-container {
    overflow: visible !important;
  }

  body:not(.dashboard-app-body) .membership-grid {
    align-items: stretch !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    padding-bottom: 12px !important;
  }

  body:not(.dashboard-app-body) .membership-grid .membership-card,
  body:not(.dashboard-app-body) .membership-card.is-active {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    opacity: 1 !important;
    align-self: stretch !important;
  }

  body:not(.dashboard-app-body) .membership-card-title,
  body:not(.dashboard-app-body) .membership-price-wrap,
  body:not(.dashboard-app-body) .membership-card-registration,
  body:not(.dashboard-app-body) .membership-card-text,
  body:not(.dashboard-app-body) .membership-card-ribbon,
  body:not(.dashboard-app-body) .membership-button {
    display: block !important;
    max-height: none !important;
    overflow: visible !important;
    opacity: 1 !important;
    visibility: visible !important;
    -webkit-line-clamp: unset !important;
  }

  body:not(.dashboard-app-body) .membership-features {
    display: flex !important;
    flex-direction: column;
    justify-content: space-between;
    max-height: none !important;
    overflow: visible !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  body:not(.dashboard-app-body) .membership-features li {
    display: flex !important;
    max-height: none !important;
    overflow: visible !important;
    opacity: 1 !important;
    visibility: visible !important;
    -webkit-line-clamp: unset !important;
  }

  body:not(.dashboard-app-body) .membership-price-wrap {
    display: flex !important;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px;
  }

  body:not(.dashboard-app-body) .membership-dots {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 5 !important;
    margin-top: 18px !important;
    margin-bottom: 4px !important;
    padding-bottom: 4px !important;
  }

  body:not(.dashboard-app-body) .membership-dot {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  body:not(.dashboard-app-body) .membership-selector-button {
    min-height: 40px;
    white-space: nowrap;
  }

  /* Avoid a phantom empty slot before the first card at scrollLeft=0 */
  body:not(.dashboard-app-body) .membership-grid {
    scroll-padding-inline: var(--membership-card-center-padding-mobile, calc((100vw - var(--membership-card-width-mobile, calc(100vw - 39px))) / 2)) !important;
  }
}

/* ===== PHASE 2 — Programs: keep photos visible under readable overlay ===== */
body:not(.dashboard-app-body) .programs-section .program-card {
  position: relative !important;
  isolation: isolate;
  background-color: #0a0a0e;
}

body:not(.dashboard-app-body) .programs-section .program-card-media {
  position: absolute !important;
  inset: 0 !important;
  z-index: 0 !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  min-height: 100% !important;
  height: 100% !important;
  width: 100% !important;
  overflow: hidden !important;
  aspect-ratio: auto !important;
}

body:not(.dashboard-app-body) .programs-section .program-card-media img,
body:not(.dashboard-app-body) .programs-section .program-card-image {
  position: absolute !important;
  inset: 0 !important;
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center center !important;
  opacity: 1 !important;
  visibility: visible !important;
}

body:not(.dashboard-app-body) .programs-section .program-card-overlay {
  z-index: 1 !important;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 8, 0.12) 0%,
    rgba(0, 0, 8, 0.35) 48%,
    rgba(0, 0, 8, 0.72) 100%
  ) !important;
  opacity: 0.75 !important;
  pointer-events: none;
}

body:not(.dashboard-app-body) .programs-section .program-card-media picture {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
}

body:not(.dashboard-app-body) .programs-section .program-card-content {
  position: relative !important;
  z-index: 2 !important;
}

@media (max-width: 760px) {
  body:not(.dashboard-app-body) .programs-section .program-card-overlay {
    opacity: 0.78 !important;
  }

  body:not(.dashboard-app-body) .programs-section .program-card-media,
  body:not(.dashboard-app-body) .programs-section .program-card-image {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
  }
}

/* ===== PHASE 3 — Partnerships carousel visible on mobile + static fallback ===== */
body:not(.dashboard-app-body) .partnerships-section,
body:not(.dashboard-app-body) .partner-logo-scroll,
body:not(.dashboard-app-body) .partner-logo-scroll__viewport,
body:not(.dashboard-app-body) .partner-logo-scroll__track,
body:not(.dashboard-app-body) .partner-logo-scroll__list,
body:not(.dashboard-app-body) .partner-logo-scroll__item,
body:not(.dashboard-app-body) .partner-logo-scroll__link {
  visibility: visible !important;
  opacity: 1 !important;
}

body:not(.dashboard-app-body) .partner-logo-scroll,
body:not(.dashboard-app-body) .partner-logo-scroll__viewport,
body:not(.dashboard-app-body) .partner-logo-scroll__track,
body:not(.dashboard-app-body) .partner-logo-scroll__list,
body:not(.dashboard-app-body) .partner-logo-scroll__item,
body:not(.dashboard-app-body) .partner-logo-scroll__link {
  display: flex !important;
}

body:not(.dashboard-app-body) .partner-logo-scroll {
  overflow: hidden !important;
  max-width: 100vw;
  min-height: 72px;
}

body:not(.dashboard-app-body) .partner-logo-scroll__track {
  width: max-content !important;
  flex-wrap: nowrap !important;
}

body:not(.dashboard-app-body) .partner-logo-scroll__image {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  object-fit: contain !important;
  width: auto !important;
  height: auto !important;
  max-height: var(--partner-logo-scroll-logo-max-height, 72px) !important;
}

@media (max-width: 760px) {
  body:not(.dashboard-app-body) .partner-logo-scroll {
    display: block !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    max-width: 100% !important;
    min-height: 64px;
  }

  body:not(.dashboard-app-body) .partner-logo-scroll__viewport {
    overflow: hidden !important;
    width: 100% !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  body:not(.dashboard-app-body) .partner-logo-scroll__track {
    animation: none !important;
    flex-wrap: wrap !important;
    width: 100% !important;
    justify-content: center;
    gap: var(--partner-logo-scroll-gap, 24px);
  }

  body:not(.dashboard-app-body) .partner-logo-scroll__list--clone {
    display: none !important;
  }

  body:not(.dashboard-app-body) .partner-logo-scroll__list {
    flex-wrap: wrap !important;
    justify-content: center;
    width: 100%;
  }
}

/* ===== PHASE 4 — Booking contact: compact rows, no stretch ===== */
body:not(.dashboard-app-body) .booking-contact-strip,
.booking-contact-strip {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 8px !important;
  height: auto !important;
  min-height: 0 !important;
  grid-template-columns: none !important;
}

body:not(.dashboard-app-body) .booking-contact-strip,
body:not(.dashboard-app-body) .booking-contact-strip--home {
  color: rgba(255, 255, 255, 0.88) !important;
}

body:not(.dashboard-app-body) .booking-contact-row,
.booking-contact-strip .booking-contact-row,
.booking-contact-strip > span {
  display: flex !important;
  align-items: flex-start !important;
  gap: 8px !important;
  height: auto !important;
  min-height: 0 !important;
  padding: 0 !important;
  text-decoration: none;
  color: inherit;
}

body:not(.dashboard-app-body) .booking-contact-row svg,
body:not(.dashboard-app-body) .booking-contact-row svg path,
.booking-contact-strip svg,
.booking-contact-strip svg path {
  flex: 0 0 auto !important;
  width: 18px !important;
  height: 18px !important;
  fill: rgba(255, 255, 255, 0.78) !important;
  stroke: none !important;
  margin-top: 2px !important;
}

body:not(.dashboard-app-body) .booking-contact-row span,
.booking-contact-strip .booking-contact-row span {
  flex: 1 1 auto;
  min-width: 0;
  white-space: normal !important;
  overflow-wrap: anywhere;
  text-align: left !important;
  justify-content: flex-start !important;
}

body:not(.dashboard-app-body) .booking-main-button,
body:not(.dashboard-app-body) .booking-home-cta,
body:not(.dashboard-app-body) .booking-submit,
html body:not(.dashboard-app-body) .booking-main-button,
html body:not(.dashboard-app-body) .booking-home-cta,
html body:not(.dashboard-app-body) .booking-submit {
  border-radius: var(--booking-main-button-radius, var(--button-radius, 12px)) !important;
}

/* ===== PHASE 5 — Protein Dose: image always visible + icon sizes ===== */
body:not(.dashboard-app-body) .protein-dose-media,
body:not(.dashboard-app-body) .protein-dose-media--banner,
body:not(.dashboard-app-body) .protein-dose-image {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  max-height: none !important;
}

body:not(.dashboard-app-body) .protein-dose-image {
  width: 100% !important;
  height: auto !important;
  object-fit: cover;
}

body:not(.dashboard-app-body) .protein-dose-benefit__icon {
  width: var(--protein-dose-icon-size-desktop, 22px);
  height: var(--protein-dose-icon-size-desktop, 22px);
}

body:not(.dashboard-app-body) .protein-dose-benefit:not(:has(.protein-dose-benefit__icon))::before {
  width: var(--protein-dose-icon-size-desktop, 22px);
  height: var(--protein-dose-icon-size-desktop, 22px);
  background-size: var(--protein-dose-icon-size-desktop, 22px);
}

/* Facilities: force photos visible (broken tiles previously showed only alt/caption). */
body:not(.dashboard-app-body) .gym-gallery-section--facilities .gym-gallery-image,
body:not(.dashboard-app-body) .gym-gallery-section--facilities .gym-gallery-trigger img {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  z-index: 1;
}

body:not(.dashboard-app-body) .gym-gallery-section--facilities .gym-gallery-caption {
  display: block !important;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  padding: 10px 12px;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.72));
  color: #fff;
  font-size: 12px;
  line-height: 1.3;
  text-align: left;
}

@media (max-width: 860px) {
  body:not(.dashboard-app-body) .protein-dose-media--banner {
    order: -1;
    width: 100% !important;
    max-width: 100% !important;
    margin-inline: 0 !important;
  }

  body:not(.dashboard-app-body) .protein-dose-benefit__icon {
    width: var(--protein-dose-icon-size-mobile, 22px);
    height: var(--protein-dose-icon-size-mobile, 22px);
  }

  body:not(.dashboard-app-body) .protein-dose-benefit:not(:has(.protein-dose-benefit__icon))::before {
    width: var(--protein-dose-icon-size-mobile, 22px);
    height: var(--protein-dose-icon-size-mobile, 22px);
    background-size: var(--protein-dose-icon-size-mobile, 22px);
  }
}

/* ===== PHASE 6 — Shared calculator result card chrome ===== */
body:not(.dashboard-app-body) .bmi-result,
body:not(.dashboard-app-body) .bmi-result.premium-glass--panel,
body:not(.dashboard-app-body) #bmiResult,
body:not(.dashboard-app-body) .strength-result,
body:not(.dashboard-app-body) .strength-result.premium-glass--panel {
  border-radius: var(--calc-result-panel-radius, 16px) !important;
  border: 1px solid var(--calc-result-panel-border, rgba(255, 255, 255, 0.14)) !important;
  border-left: 1px solid var(--calc-result-panel-border, rgba(255, 255, 255, 0.14)) !important;
  background: var(--calc-result-panel-bg) !important;
  padding: var(--calc-result-panel-padding) !important;
  box-shadow: var(--site-glass-shadow, 0 18px 48px rgba(0, 0, 0, 0.28)) !important;
}

/* ===== Video-first: never show still photos behind hero/about videos ===== */
body:not(.dashboard-app-body) .hero-media--video-only .hero-image,
body:not(.dashboard-app-body) .hero-media--video-only .hero-image--poster,
body:not(.dashboard-app-body) .hero-media--video-only .hero-image--video-fallback,
body:not(.dashboard-app-body) .hero-media--video-only picture,
body:not(.dashboard-app-body) .about-home-spotlight__media--video-only .about-home-spotlight__poster,
body:not(.dashboard-app-body) .about-home-spotlight.has-about-video .about-home-spotlight__poster {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
}

body:not(.dashboard-app-body) .hero-media--video-only,
body:not(.dashboard-app-body) .about-home-spotlight__media--video-only,
body:not(.dashboard-app-body) .hero-video,
body:not(.dashboard-app-body) .about-home-spotlight__video {
  background: #0a0a0e !important;
}

/* ===== PHASE 7 — Preview: collapse hero empty space immediately ===== */
html.pr1melab-preview-mode {
  --hero-viewport-full: auto;
  --hero-min-height-desktop: auto;
  --hero-min-height-mobile: auto;
  --hero-viewport-height: auto;
}

html.pr1melab-preview-mode .hero-section,
html.pr1melab-preview-mode body.preview-editor-mode .hero-section,
html body.pr1melab-preview-mode .hero-section,
html body.pr1melab-preview-mode.preview-editor-mode .hero-section,
html.pr1melab-preview-mode body:not(.dashboard-app-body) .hero-section,
html.pr1melab-preview-mode body:not(.dashboard-app-body) .hero-section.hero-neon {
  min-height: 0 !important;
  height: auto !important;
  max-height: none !important;
  padding-top: var(--header-height, 72px) !important;
  padding-bottom: clamp(24px, 4vw, 48px) !important;
}

html.pr1melab-preview-mode .hero-container,
html.pr1melab-preview-mode body:not(.dashboard-app-body) .hero-container {
  min-height: 0 !important;
  height: auto !important;
}

html.pr1melab-preview-mode .hero-media,
html.pr1melab-preview-mode .hero-aurora-layer,
html.pr1melab-preview-mode .hero-media--video-only,
html.pr1melab-preview-mode .hero-video {
  min-height: 0 !important;
  height: auto !important;
  max-height: min(52vh, 420px) !important;
}

html.pr1melab-preview-mode [data-site-background],
html.pr1melab-preview-mode .site-bg,
html.pr1melab-preview-mode [data-preview-pick="site_background"] {
  pointer-events: none !important;
  position: fixed !important;
  inset: 0 !important;
  height: auto !important;
  min-height: 0 !important;
  z-index: 0 !important;
}

html.pr1melab-preview-mode .site-main {
  padding-top: 0 !important;
  margin-top: 0 !important;
}

@media (max-width: 760px) {
  html.pr1melab-preview-mode body:not(.dashboard-app-body) .hero-section {
    min-height: 0 !important;
    height: auto !important;
  }
}
