/* ==========================================================================
   Steps section — How Our Plumbing Service Works
   Figma panel: 1440×663 at page top 6570 / left 240
   Title: Gilroy-ExtraBoldItalic 54px/72px, uppercase, centered, #00274E
   Badge: 142×60 at left 85px, pad 10/20, radius 100px
   Card image: 312×250 at top 80px | Body: 312×131 at top 330px, pad 15, gap 5
   Steps overlap: bottom 50% of yellow panel over blue; top 50% on white
   ========================================================================== */

.steps {
  --steps-w: 1440px;
  --steps-h: 663px;
  --steps-radius: 50px;
  --steps-yellow: #fab72a;
  --steps-pad-top: 48px;
  --steps-pad-bottom: 50px;
  --steps-title-h: 72px;
  --steps-title-badge-gap: 30px;
  --steps-grid-w: 1338px;
  --steps-grid-h: 461px;
  --steps-gap: 30px;
  --step-card-w: 312px;
  --step-card-h: 461px;
  --steps-pad-x: 51px;
  --step-img-w: 312px;
  --step-img-h: 250px;
  --step-img-top: 80px;
  --step-badge-w: 142px;
  --step-badge-h: 60px;
  --step-badge-left: 85px;
  --step-badge-gap: 10px;
  --step-badge-radius: 100px;
  --step-badge-pad-y: 10px;
  --step-badge-pad-x: 20px;
  --step-body-w: 312px;
  --step-body-h: 131px;
  --step-body-top: 330px;
  --step-body-pad: 15px;
  --step-body-gap: 5px;
  --step-card-radius: 20px;
  --step-body-radius: 24px;
  --steps-canvas: 1920px;
  --steps-page-top: 6570px;
  --steps-panel-page-left: 240px;
  --steps-canvas-offset: calc((min(100vw, var(--steps-canvas)) - var(--steps-canvas)) / 2);
  --steps-cb-overlap: calc(var(--steps-h) * 0.5);
  position: relative;
  z-index: 5;
  background: transparent;
  padding: 0;
  margin-bottom: calc(-1 * var(--steps-cb-overlap));
  overflow: visible;
  isolation: isolate;
}

.steps::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: var(--steps-cb-overlap);
  background: #fff;
  z-index: -1;
  pointer-events: none;
}

.steps-wrap {
  width: min(var(--steps-w), calc(100vw - 32px));
  min-width: 0;
  max-width: var(--steps-w);
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
  position: relative;
  z-index: 2;
  pointer-events: auto;
}

/* Figma yellow panel: 1440×663 at page top 6570 / left 240, 0deg, opacity 1 */
.steps-card {
  width: 100%;
  min-width: 0;
  max-width: var(--steps-w);
  height: var(--steps-h);
  min-height: var(--steps-h);
  max-height: var(--steps-h);
  margin: 0 auto;
  background: var(--steps-yellow);
  border-radius: var(--steps-radius);
  padding: var(--steps-pad-top) var(--steps-pad-x) var(--steps-pad-bottom);
  box-sizing: border-box;
  overflow: visible;
  opacity: 1;
  transform: rotate(0deg);
}

.steps h2.steps-title {
  box-sizing: content-box;
  width: 100%;
  margin: 0;
  padding: 0 0 var(--steps-title-badge-gap);
  min-height: var(--steps-title-h);
  font-family: 'Gilroy-ExtraBoldItalic', var(--display);
  font-weight: 400;
  font-style: italic;
  font-size: 54px;
  line-height: 72px;
  letter-spacing: 0;
  text-align: center;
  text-transform: uppercase;
  color: #00274e;
  opacity: 1;
  transform: rotate(0deg);
}

.steps-grid {
  width: var(--steps-grid-w);
  max-width: 100%;
  height: var(--steps-grid-h);
  margin: calc(var(--step-badge-h) / 2) auto 0;
  display: grid;
  grid-template-columns: repeat(4, var(--step-card-w));
  justify-content: center;
  gap: var(--steps-gap);
  align-items: stretch;
  overflow: visible;
}

.step-card {
  width: var(--step-card-w);
  max-width: 100%;
  height: var(--step-card-h);
  margin: 0;
  overflow: visible;
  text-align: center;
}

.step-card__shell {
  position: relative;
  width: var(--step-card-w);
  height: var(--step-card-h);
  background: transparent;
  border-radius: var(--step-card-radius);
  overflow: visible;
  opacity: 1;
  transform: rotate(0deg);
  filter: drop-shadow(0 4px 18px rgba(11, 27, 52, .08));
}

/* Figma badge: 142×60 at left 85px, pad 10/20, radius 100px, gap 10px */
.step-card__badge {
  position: absolute;
  top: 0;
  left: var(--step-badge-left);
  z-index: 3;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--step-badge-gap);
  width: var(--step-badge-w);
  height: var(--step-badge-h);
  min-width: var(--step-badge-w);
  max-width: var(--step-badge-w);
  min-height: var(--step-badge-h);
  max-height: var(--step-badge-h);
  padding: var(--step-badge-pad-y) var(--step-badge-pad-x);
  background: #0154BC;
  color: #fff;
  font-family: 'Gilroy-Bold', var(--display);
  font-weight: 400;
  font-size: 30px;
  line-height: 40px;
  letter-spacing: 0;
  text-align: center;
  border-radius: var(--step-badge-radius);
  transform: translateY(-50%);
  white-space: nowrap;
  opacity: 1;
  box-shadow: 0 2px 8px rgba(11, 27, 52, .14);
}

/* Figma image: 312×250 at top 80px, 0deg, opacity 1 */
.step-card__media {
  position: absolute;
  top: var(--step-img-top);
  left: 0;
  width: var(--step-img-w);
  height: var(--step-img-h);
  overflow: hidden;
  background: #e8edf5;
  border-radius: var(--step-card-radius) var(--step-card-radius) 0 0;
  opacity: 1;
  transform: rotate(0deg);
  z-index: 1;
}

.step-card__media img {
  width: var(--step-img-w);
  height: var(--step-img-h);
  max-width: none;
  object-fit: cover;
  object-position: center;
  display: block;
  opacity: 1;
  transform: rotate(0deg);
}

/* Figma white body: 312×131 at top 330px, pad 15, gap 5, bottom radius 24px */
.step-card__body {
  position: absolute;
  top: var(--step-body-top);
  left: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: var(--step-body-gap);
  width: var(--step-body-w);
  min-width: var(--step-body-w);
  max-width: var(--step-body-w);
  height: var(--step-body-h);
  min-height: var(--step-body-h);
  max-height: var(--step-body-h);
  padding: var(--step-body-pad);
  background: #fff;
  border-radius: 0 0 var(--step-body-radius) var(--step-body-radius);
  opacity: 1;
  transform: rotate(0deg);
}

.step-card__body h3 {
  font-family: 'Gilroy-Bold', var(--display);
  font-weight: 400;
  font-size: 24px;
  line-height: 36px;
  letter-spacing: 0;
  text-align: center;
  color: #00274e;
  margin: 0;
  text-align: center;
}

.step-card__body p {
  font-family: 'Gilroy-Medium', var(--font);
  font-weight: 800;
  font-size: 18px;
  line-height: 30px;
  letter-spacing: 0;
  text-align: center;
  color: #00274e;
  opacity: .82;
  margin: 0;
  max-width: 100%;
  text-align: center;
}

.steps-slider {
  display: contents;
}

.steps-grid__inner {
  display: contents;
}

.steps-active-badge,
.steps__nav {
  display: none;
}

/* ------------------------------- Responsive ------------------------------- */

@media (max-width: 1380px) {
  .steps {
    padding: 0 18px;
  }

  .steps-wrap {
    width: min(calc(100vw - 36px), var(--steps-w));
    min-width: 0;
    max-width: var(--steps-w);
    margin-left: auto;
    margin-right: auto;
  }

  .steps-card {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    height: auto;
    min-height: var(--steps-h);
    max-height: none;
  }

  .steps-grid {
    width: 100%;
    height: auto;
    margin-top: 0;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 22px;
  }

  .step-card {
    width: 100%;
    height: auto;
    min-height: var(--step-card-h);
  }

  .step-card__shell {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: auto;
    min-height: var(--step-card-h);
    background: #fff;
    box-shadow: 0 4px 18px rgba(11, 27, 52, .08);
    filter: none;
  }

  .step-card__badge,
  .step-card__media,
  .step-card__body {
    position: relative;
    top: auto;
    left: auto;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    height: auto;
    min-height: 0;
    max-height: none;
    transform: none;
  }

  .step-card__badge {
    align-self: center;
    z-index: 3;
    margin-top: calc(-1 * var(--step-badge-h) / 2);
    margin-bottom: calc(-1 * var(--step-badge-h) / 2);
    width: auto;
    min-width: var(--step-badge-w);
    max-width: none;
    height: var(--step-badge-h);
    min-height: var(--step-badge-h);
    max-height: var(--step-badge-h);
  }

  .step-card__media {
    flex: 0 0 auto;
    aspect-ratio: 312 / 250;
    min-height: 0;
    border-radius: var(--step-card-radius) var(--step-card-radius) 0 0;
  }

  .step-card__media img {
    width: 100%;
    height: 100%;
    min-height: 0;
    max-width: 100%;
    object-fit: cover;
    object-position: center center;
  }

  .step-card__body {
    min-height: var(--step-body-h);
    flex: 1 1 auto;
  }
}

/* Tablet / small desktop — 1025px–1440px */
@media (min-width: 1025px) and (max-width: 1440px) {
  .steps {
    --step-img-h: clamp(200px, 17.4vw, 250px);
    --steps-gap: clamp(18px, 2vw, 28px);
  }

  .steps-card {
    padding: clamp(36px, 3.5vw, 48px) clamp(28px, 3.5vw, 51px) clamp(40px, 3.5vw, 50px);
  }

  .steps h2.steps-title {
    font-size: clamp(2rem, 3.8vw, 3.375rem);
    line-height: clamp(2.5rem, 5vw, 4.5rem);
    min-height: 0;
  }

  .step-card__shell {
    overflow: visible;
  }

  .step-card__media {
    aspect-ratio: 312 / 250;
  }
}

@media (max-width: 1024px) {
  .steps {
    --steps-gap: 24px;
    --step-img-h: 210px;
  }

  .steps-card {
    padding: 32px 28px 36px;
    border-radius: 32px;
    min-height: 0;
  }

  .steps h2.steps-title {
    font-size: clamp(1.6rem, 4vw, 2.5rem);
    line-height: 1.25;
    min-height: 0;
    margin: 0;
    padding-bottom: 24px;
  }

  .steps-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 0;
    row-gap: 28px;
  }

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

  .step-card__shell {
    min-height: 0;
  }
}

@media (max-width: 768px) {
  .steps {
    --steps-m-overlap: 180px;
    --steps-m-gap: 20px;
    --steps-m-card-h: 434px;
    --step-slide-w: 312px;
    --step-img-h: 250px;
    width: 100vw;
    min-width: 0;
    max-width: none;
    padding: 0 20px;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    margin-bottom: calc(-1 * var(--steps-m-overlap));
    z-index: 6;
  }

  .steps::before {
    display: block;
    height: var(--steps-m-overlap);
  }

  .steps-wrap {
    width: 100%;
    min-width: 0;
    max-width: none;
    margin-left: auto;
    margin-right: auto;
  }

  .steps-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    height: auto;
    min-height: 0;
    max-height: none;
    padding: 32px 0 48px;
    border-radius: 32px;
    background: var(--steps-yellow);
    overflow: visible;
  }

  .steps h2.steps-title {
    box-sizing: border-box;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0 16px 24px;
    min-height: 0;
    font-family: 'Gilroy-ExtraBoldItalic', var(--display);
    font-size: 30px;
    line-height: 40px;
    letter-spacing: 0;
    text-align: center;
    text-transform: uppercase;
    color: #00274e;
  }

  .steps-active-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: auto;
    min-width: var(--step-badge-w);
    height: var(--step-badge-h);
    min-height: var(--step-badge-h);
    margin: 0 auto 28px;
    padding: var(--step-badge-pad-y) var(--step-badge-pad-x);
    background: #0154BC;
    color: #fff;
    font-family: 'Gilroy-Bold', var(--display);
    font-weight: 400;
    font-size: clamp(18px, 4vw, 30px);
    line-height: clamp(28px, 5.5vw, 40px);
    letter-spacing: 0;
    text-align: center;
    border-radius: var(--step-badge-radius);
    box-shadow: 0 2px 8px rgba(11, 27, 52, .14);
  }

  .steps-slider {
    display: block;
    position: relative;
    width: calc(100% + 40px);
    max-width: none;
    margin-left: -20px;
    margin-right: -20px;
  }

  .steps-track-wrap {
    position: relative;
    z-index: 2;
    width: 100%;
    overflow: hidden;
    touch-action: pan-y pinch-zoom;
  }

  .steps-grid {
    display: block;
    width: 100%;
    height: var(--steps-m-card-h);
    min-height: var(--steps-m-card-h);
    margin: 0;
    padding: 0;
    overflow: hidden;
    grid-template-columns: none;
    box-sizing: border-box;
  }

  .steps-grid__inner {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: var(--steps-m-gap);
    width: max-content;
    height: var(--steps-m-card-h);
    min-height: var(--steps-m-card-h);
    margin: 0;
    padding: 0;
    transition: transform 0.4s ease;
    will-change: transform;
  }

  .steps-grid__inner .step-card {
    flex: 0 0 var(--step-slide-w, 312px);
    width: var(--step-slide-w, 312px);
    min-width: var(--step-slide-w, 312px);
    max-width: var(--step-slide-w, 312px);
    box-sizing: border-box;
    height: var(--steps-m-card-h);
    min-height: var(--steps-m-card-h);
    max-height: var(--steps-m-card-h);
    overflow: hidden;
  }

  .step-card__badge {
    display: none;
  }

  .step-card__shell {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: var(--steps-m-card-h);
    min-height: var(--steps-m-card-h);
    background: #fff;
    border-radius: var(--step-card-radius);
    box-shadow: 0 4px 18px rgba(11, 27, 52, .08);
    filter: none;
    overflow: hidden;
  }

  .step-card__media,
  .step-card__body {
    position: relative;
    top: auto;
    left: auto;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    height: auto;
    min-height: 0;
    max-height: none;
    transform: none;
  }

  .step-card__media {
    flex: 0 0 var(--step-img-h);
    height: var(--step-img-h);
    min-height: var(--step-img-h);
    border-radius: var(--step-card-radius) var(--step-card-radius) 0 0;
    background: #e8edf5;
  }

  .step-card__media img {
    width: 100%;
    height: 100%;
    min-height: var(--step-img-h);
    object-fit: cover;
  }

  .step-card__body {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    flex: 1 1 auto;
    min-height: 184px;
    padding: var(--step-body-pad);
    gap: var(--step-body-gap);
    background: #fff;
    border-radius: 0 0 var(--step-body-radius) var(--step-body-radius);
  }

  .step-card__body h3 {
    font-family: 'Gilroy-Bold', var(--display);
    font-weight: 400;
    font-size: clamp(18px, 4vw, 24px);
    line-height: clamp(26px, 5.5vw, 36px);
    letter-spacing: 0;
    color: #00274e;
    text-align: center;
    margin: 0;
  }

  .step-card__body p {
    font-family: 'Gilroy-Medium', var(--font);
    font-weight: 400;
    font-size: clamp(14px, 3.5vw, 18px);
    line-height: clamp(22px, 5vw, 30px);
    letter-spacing: 0;
    text-align: center;
    color: #00274e;
    opacity: 1;
    margin: 0;
  }

  /* Nav arrows on card image row */
  .steps__nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 125px;
    transform: translateY(-50%);
    z-index: 4;
    width: 40px;
    height: 40px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: opacity .15s ease;
  }

  .steps__nav:disabled {
    opacity: 0.35;
    cursor: default;
  }

  .steps__nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    border-radius: 50%;
  }

  .steps__nav-icon svg {
    width: 18px;
    height: 18px;
  }

  .steps__nav--prev {
    left: 0;
  }

  .steps__nav--prev .steps__nav-icon {
    background: #fff;
    color: #00274e;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
  }

  .steps__nav--next {
    right: 0;
  }

  .steps__nav--next .steps__nav-icon {
    background: #00274e;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
  }

  .steps__nav--next .steps__nav-icon svg {
    stroke-width: 2.6;
  }
}
