/* Elite Total Health — mobile & small-device overrides */

html {
  scroll-padding-top: calc(var(--header-h) + 12px);
}

/* Header / drawer */
@media (max-width: 1023px) {
  :root {
    --header-h: 80px;
  }

  body.menu-open {
    overflow: hidden;
    touch-action: none;
  }

  .nav {
    gap: 10px;
  }

  .brand img {
    height: 52px;
  }

  .site-header.scrolled .brand img {
    height: 44px;
  }

  .site-header.scrolled .nav {
    height: 72px;
  }

  .drawer-panel {
    padding: calc(var(--header-h) + 18px) 20px 28px;
  }

  .drawer-cta .btn {
    white-space: normal;
    text-align: center;
  }
}

@media (max-width: 480px) {
  :root {
    --header-h: 74px;
  }

  .brand img {
    height: 46px;
  }

  .site-header.scrolled .brand img {
    height: 40px;
  }

  .site-header.scrolled .nav {
    height: 66px;
  }

  .wrap {
    padding-inline: clamp(14px, 4vw, 24px);
  }
}

/* Buttons & CTA groups */
@media (max-width: 640px) {
  .btn {
    white-space: normal;
    text-align: center;
    justify-content: center;
  }

  .slide-cta,
  .cta-band .grp,
  .detail [style*="flex-wrap"],
  .detail [style*="display:flex"] {
    flex-direction: column;
    align-items: stretch;
  }

  .slide-cta .btn,
  .cta-band .grp .btn {
    width: 100%;
  }
}

/* Hero — fixed height so every slide/image is the same size on mobile */
@media (max-width: 640px) {
  .hero {
    height: min(100svh, 680px);
    min-height: 560px;
  }

  .slides {
    position: absolute;
    inset: 0;
  }

  .slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    box-sizing: border-box;
    padding-top: calc(var(--header-h) + 16px);
    padding-bottom: 56px;
  }

  .slide.active {
    opacity: 1;
    visibility: visible;
  }

  .slide .media,
  .slide .media .ph {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
  }

  .slide .media .ph img {
    object-fit: cover;
    object-position: center center;
  }

  /* Stronger dark scrub so white/teal copy stays readable on busy photos */
  .slide::after {
    background:
      linear-gradient(180deg, rgba(10, 23, 51, 0.58) 0%, rgba(10, 23, 51, 0.42) 38%, rgba(10, 23, 51, 0.9) 100%),
      linear-gradient(90deg, rgba(10, 23, 51, 0.28) 0%, transparent 35%, transparent 65%, rgba(10, 23, 51, 0.28) 100%);
  }

  .slide-inner {
    padding: 0 16px 8px;
  }

  .slide-tag {
    color: #b7f7ef;
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.75), 0 0 2px rgba(0, 0, 0, 0.9);
  }

  .slide h1 {
    font-size: clamp(1.55rem, 7.2vw, 2.35rem);
    line-height: 1.15;
    text-shadow: 0 2px 18px rgba(0, 0, 0, 0.7), 0 1px 3px rgba(0, 0, 0, 0.85);
  }

  .slide p {
    margin-top: 12px;
    font-size: 0.95rem;
    line-height: 1.45;
    color: #fff;
    text-shadow: 0 1px 14px rgba(0, 0, 0, 0.75), 0 1px 3px rgba(0, 0, 0, 0.9);
  }

  .slide-cta {
    margin-top: 18px;
    gap: 10px;
  }

  .hero-nav {
    bottom: 14px;
    gap: 14px;
  }
}

/* Narrow phones (320–390) — tighter type so full heading stays in view */
@media (max-width: 390px) {
  .hero {
    height: min(100svh, 640px);
    min-height: 540px;
  }

  .slide {
    padding-top: calc(var(--header-h) + 12px);
    padding-bottom: 48px;
  }

  .slide-inner {
    padding: 0 14px 4px;
  }

  .slide-tag {
    margin-bottom: 8px;
    font-size: 0.68rem;
    letter-spacing: 0.14em;
  }

  .slide h1 {
    font-size: 1.55rem;
    line-height: 1.15;
  }

  .slide p {
    margin-top: 10px;
    font-size: 0.88rem;
    line-height: 1.4;
  }

  .slide-cta {
    margin-top: 14px;
    gap: 10px;
  }

  .hero-nav {
    bottom: 10px;
  }
}

/* Larger devices — same readability + equal slide image framing as mobile */
@media (min-width: 641px) {
  .hero {
    height: min(94vh, 820px);
    min-height: 560px;
  }

  .slides {
    position: absolute;
    inset: 0;
  }

  .slide {
    position: absolute;
    inset: 0;
  }

  .slide .media,
  .slide .media .ph {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
  }

  .slide .media .ph img {
    object-fit: cover;
    object-position: center center;
  }

  .slide::after {
    background:
      linear-gradient(180deg, rgba(10, 23, 51, 0.52) 0%, rgba(10, 23, 51, 0.32) 38%, rgba(10, 23, 51, 0.88) 100%),
      linear-gradient(90deg, rgba(10, 23, 51, 0.22) 0%, transparent 35%, transparent 65%, rgba(10, 23, 51, 0.22) 100%);
  }

  .slide-tag {
    color: #b7f7ef;
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.7), 0 0 2px rgba(0, 0, 0, 0.85);
  }

  .slide h1 {
    text-shadow: 0 2px 18px rgba(0, 0, 0, 0.65), 0 1px 3px rgba(0, 0, 0, 0.8);
  }

  .slide p {
    color: #fff;
    text-shadow: 0 1px 14px rgba(0, 0, 0, 0.7), 0 1px 3px rgba(0, 0, 0, 0.85);
  }
}

/* QA laptop 1366×768 — keep copy clear of the fixed header, but centered */
@media (min-width: 1024px) and (max-width: 1366px) and (max-height: 800px) {
  .hero {
    height: 100vh;
    min-height: 0;
  }

  .slide {
    align-items: flex-start;
    justify-content: center;
    box-sizing: border-box;
    padding-top: calc(var(--header-h) + 18px);
    padding-bottom: 64px;
  }

  .slide-inner {
    margin-inline: auto;
    text-align: center;
    padding: 0 22px 40px;
  }

  .slide-tag {
    margin-bottom: 10px;
  }

  .slide h1 {
    font-size: clamp(1.85rem, 2.8vw, 2.55rem);
    line-height: 1.15;
  }

  .slide p {
    margin-top: 12px;
    margin-inline: auto;
    font-size: 1rem;
    max-width: 54ch;
  }

  .slide-cta {
    margin-top: 18px;
    justify-content: center;
  }

  .hero-nav {
    bottom: 18px;
  }
}

/* 120% zoom on 1366×768 laptops (CSS viewport ≈1138×640) — hero copy sat too high */
@media (min-width: 1024px) and (max-width: 1366px) and (max-height: 680px) {
  .slide {
    align-items: center;
    padding-top: calc(var(--header-h) + 28px);
    padding-bottom: 80px;
  }
}

/* Intro stack & stats */
@media (max-width: 640px) {
  .stack {
    min-height: 280px;
  }

  .stack .badge {
    left: 0;
    top: 8%;
    padding: 10px 14px;
  }

  .stack .s1 {
    inset: 0 10% 12% 0;
  }

  .stack .s2 {
    width: 58%;
    height: 42%;
    border-width: 4px;
  }

  .stat-cards {
    grid-template-columns: 1fr;
  }
}

/* Section spacing & page banners */
@media (max-width: 640px) {
  .section {
    padding-block: clamp(44px, 8vw, 72px);
  }

  .crumb {
    padding-block: clamp(28px, 7vw, 44px);
  }

  .crumb h1 {
    font-size: clamp(1.65rem, 7vw, 2.4rem);
  }

  .svc-head {
    margin-bottom: 28px;
  }

  .trust .wrap {
    flex-direction: column;
    gap: 10px;
  }
}

/* Grid stepping for tablets & phones */
@media (min-width: 560px) and (max-width: 759px) {
  .steps,
  .sub-cards,
  .qual-grid,
  .prog-grid,
  .ba-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 560px) and (max-width: 779px) {
  .tiers {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 559px) {
  .steps,
  .sub-cards,
  .qual-grid,
  .prog-grid,
  .tiers,
  .ba-grid {
    grid-template-columns: 1fr;
  }
}

/* Sticky layouts off on small screens */
@media (max-width: 979px) {
  .why-left {
    position: static;
  }

  .why-item:hover {
    transform: none;
  }
}

@media (max-width: 899px) {
  .inj-media {
    position: static;
  }
}

/* Contact form */
@media (max-width: 559px) {
  .two {
    gap: 16px;
  }

  .form-card {
    padding: 20px;
  }

  .field input,
  .field textarea,
  .notify input {
    font-size: 16px;
  }

  .notify {
    grid-template-columns: 1fr;
  }

  .notify .btn {
    width: 100%;
    justify-content: center;
  }

  .map-embed {
    height: 220px;
  }
}

/* Long text / contact rows */
.f-contact a,
.f-contact span,
.f-contact .f-hours,
.info-row a,
.info-row span,
.info-row > div {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* FAQ */
@media (max-width: 640px) {
  .faq-q {
    font-size: 0.96rem;
    padding: 16px 18px;
    align-items: flex-start;
  }

  .faq-q > span:not(.faq-ico) {
    min-width: 0;
    flex: 1;
    text-align: left;
  }

  .faq-a p {
    padding: 0 18px 18px;
  }
}

/* Before/after compare — allow vertical scroll until dragging */
.compare {
  touch-action: pan-y;
  cursor: grab;
}

.compare.is-dragging {
  touch-action: none;
  cursor: ew-resize;
}

/* CMS rich content */
.rich img,
.rich video,
.rich iframe {
  max-width: 100%;
  height: auto;
}

.rich table {
  display: block;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.rich pre {
  overflow-x: auto;
  max-width: 100%;
}

/* Service pill nav */
@media (max-width: 640px) {
  .svc-nav .row {
    padding-block: 12px;
    margin-inline: calc(-1 * clamp(14px, 4vw, 24px));
    padding-inline: clamp(14px, 4vw, 24px);
  }
}

/* Cards & offer blocks */
@media (max-width: 640px) {
  .offer-card,
  .svc-card,
  .sub-card,
  .why-item,
  .tst-card {
    padding: 20px;
  }

  .svc-card {
    min-height: 0;
  }
}

/* Homepage customized-programs split callout — left-align text (overrides later centered .cta-band rules) */
.cta-band.cta-band--split,
.cta-band.cta-band--split .inner {
  text-align: left;
}

.cta-band.cta-band--split p {
  margin-left: 0;
  margin-right: 0;
  max-width: none;
}

.cta-band.cta-band--split .chips {
  justify-content: flex-start;
}

.cta-band.cta-band--split .eyebrow {
  justify-content: flex-start;
}

/* Testimonials slider */
.tst-slider {
  position: relative;
}

.tst-viewport {
  overflow: hidden;
}

.tst-slider .tst-track {
  display: flex;
  gap: 20px;
  padding: 6px 0 8px;
  grid-template-columns: none;
  transition: transform 0.45s ease;
  will-change: transform;
}

.tst-slider .tst-card {
  flex: 0 0 100%;
  min-width: 0;
  box-sizing: border-box;
}

@media (min-width: 680px) {
  .tst-slider .tst-card {
    flex-basis: calc((100% - 20px) / 2);
  }
}

@media (min-width: 1000px) {
  .tst-slider .tst-card {
    flex-basis: calc((100% - 40px) / 3);
  }
}

.tst-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 18px;
}

.tst-arrow {
  position: static;
  z-index: 1;
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--navy-deep);
  font-size: 1.4rem;
  line-height: 1;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: 0.2s ease;
}

.tst-arrow:hover {
  background: var(--navy-deep);
  color: #fff;
  border-color: transparent;
}

.tst-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 0;
  min-height: 12px;
}

.tst-dots button {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(17, 42, 99, 0.22);
  transition: 0.25s ease;
}

.tst-dots button.active {
  background: var(--teal);
  width: 26px;
  border-radius: 6px;
}

.tst-slider.is-static .tst-controls {
  display: none;
}

.tst-av--img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@media (max-width: 640px) {
  .tst-controls {
    gap: 12px;
    margin-top: 14px;
  }

  .tst-arrow {
    width: 38px;
    height: 38px;
    font-size: 1.25rem;
  }
}
