/* ============================================================
   FIXU Jak to funguje — R17
   Scoped to body.fixu-jak. Reuses homepage tokens / contact CTA.
   ============================================================ */

body.fixu-jak {
  background: var(--fixu-bg);
}

.fixu-jak-main {
  overflow-x: clip;
  background: var(--fixu-bg);
}

/* ---------- Breadcrumbs: shared via fixu-ui.css ---------- */

/* ---------- Hero ---------- */
.fixu-jak-hero {
  padding: clamp(48px, 6.5vw, 88px) 0 clamp(20px, 3vw, 36px);
  text-align: center;
}

.fixu-jak-hero-inner {
  max-width: 42rem;
  margin-inline: auto;
}

.fixu-jak-hero-title {
  margin: 0 0 16px;
  font-family: var(--fixu-serif);
  font-size: clamp(2.1rem, 4.4vw, 3.15rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.12;
  color: var(--fixu-navy);
}

.fixu-jak-hero-lead {
  margin: 0;
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  line-height: 1.55;
  color: var(--fixu-text-soft);
}

/* ---------- 5 steps ---------- */
.fixu-jak-steps {
  padding: clamp(20px, 3vw, 36px) 0 clamp(48px, 6vw, 80px);
}

.fixu-jak-steps-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 18px 14px;
  align-items: stretch;
}

.fixu-jak-step {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  min-width: 0;
  height: 100%;
}

/* Dashed connector between numbered circles */
.fixu-jak-step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 15px;
  left: calc(50% + 18px);
  right: calc(-50% + 18px);
  border-top: 2px dashed var(--fixu-border-strong);
  pointer-events: none;
  z-index: 0;
}

.fixu-jak-step-num {
  position: relative;
  z-index: 1;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--fixu-navy);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 0 4px var(--fixu-bg);
}

.fixu-jak-step-card {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  align-self: stretch;
  width: 100%;
  min-width: 0;
  min-height: 0;
  background: #fff;
  border: 1px solid var(--fixu-border);
  border-radius: var(--fixu-r-xl);
  box-shadow: var(--fixu-sh-sm);
  overflow: hidden;
}

.fixu-jak-step-media {
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--fixu-bg-soft);
  /* R17b card assets are portrait (~4:5) */
  aspect-ratio: 4 / 5;
}

.fixu-jak-step-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* Badge: asset already includes white circle + red icon */
.fixu-jak-step-badge {
  position: absolute;
  left: 10px;
  bottom: 10px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--fixu-sh-sm);
  overflow: hidden;
}

.fixu-jak-step-badge img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.fixu-jak-step-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: 8px;
  min-width: 0;
  padding: 16px 14px 18px;
}

.fixu-jak-step-title {
  margin: 0;
  font-family: var(--fixu-sans);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--fixu-navy);
  line-height: 1.3;
}

.fixu-jak-step-text {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--fixu-text-soft);
}

.fixu-jak-step-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  color: var(--fixu-red);
  font-weight: 650;
  font-size: var(--fixu-fs-sm);
  text-decoration: none;
  width: fit-content;
}

.fixu-jak-step-link:hover,
.fixu-jak-step-link:focus-visible {
  color: var(--fixu-red-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- Scenario cards ---------- */
.fixu-jak-scenarios {
  padding: 0 0 clamp(48px, 6vw, 80px);
}

.fixu-jak-scenarios-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(18px, 2.2vw, 28px);
}

.fixu-jak-scenario {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 0;
  align-items: stretch;
  background: #fff;
  border: 1px solid var(--fixu-border);
  border-radius: var(--fixu-r-xl);
  box-shadow: var(--fixu-sh-sm);
  overflow: hidden;
  min-width: 0;
}

.fixu-jak-scenario-copy {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: clamp(22px, 3vw, 32px);
  justify-content: center;
}

.fixu-jak-scenario-title {
  margin: 0;
  font-family: var(--fixu-sans);
  font-size: clamp(1.15rem, 1.8vw, 1.35rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--fixu-navy);
  line-height: 1.25;
}

.fixu-jak-scenario-text {
  margin: 0;
  font-size: var(--fixu-fs-md);
  line-height: 1.55;
  color: var(--fixu-text-soft);
}

.fixu-jak-scenario-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  color: var(--fixu-red);
  font-weight: 650;
  font-size: var(--fixu-fs-md);
  text-decoration: none;
  width: fit-content;
}

.fixu-jak-scenario-cta:hover,
.fixu-jak-scenario-cta:focus-visible {
  color: var(--fixu-red-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.fixu-jak-scenario-media {
  position: relative;
  min-height: 180px;
  background: var(--fixu-bg-muted);
  overflow: hidden;
}

.fixu-jak-scenario-media > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  position: absolute;
  inset: 0;
}

.fixu-jak-scenario-media--restore {
  min-height: 220px;
}

.fixu-jak-scenario-media--restore .fixu-restore-preview,
.fixu-jak-scenario-media--restore .fixu-jak-restore-preview {
  position: absolute;
  inset: 0;
}

/* Separate real before/after photos (not one split frame) */
.fixu-jak-scenario-media--restore .fixu-restore-half img {
  width: 100%;
  max-width: none;
  height: 100%;
  margin-left: 0;
  object-fit: cover;
  object-position: center;
  filter: none;
}

.fixu-jak-scenario-media--restore .fixu-restore-half--before img {
  object-position: center center;
}

.fixu-jak-scenario-media--restore .fixu-restore-half--after img {
  margin-left: 0;
  object-position: center center;
}

.fixu-jak-scenario-media--custom {
  min-height: 220px;
}

/* Measurement guides (same visual language as homepage service card) */
.fixu-jak-scenario-media--custom .fixu-dim-guide {
  position: absolute;
  pointer-events: none;
  border: 0 dashed rgba(227, 6, 19, 0.85);
  z-index: 1;
}

.fixu-jak-scenario-media--custom .fixu-dim-guide--h {
  left: 10%;
  right: 10%;
  top: 14%;
  border-top-width: 2px;
}

.fixu-jak-scenario-media--custom .fixu-dim-guide--h::before,
.fixu-jak-scenario-media--custom .fixu-dim-guide--h::after {
  content: "";
  position: absolute;
  top: -5px;
  width: 2px;
  height: 10px;
  background: var(--fixu-red);
}

.fixu-jak-scenario-media--custom .fixu-dim-guide--h::before { left: 0; }
.fixu-jak-scenario-media--custom .fixu-dim-guide--h::after { right: 0; }

.fixu-jak-scenario-media--custom .fixu-dim-guide--v {
  top: 18%;
  bottom: 12%;
  right: 12%;
  border-right-width: 2px;
}

.fixu-jak-scenario-media--custom .fixu-dim-guide--v::before,
.fixu-jak-scenario-media--custom .fixu-dim-guide--v::after {
  content: "";
  position: absolute;
  right: -5px;
  height: 2px;
  width: 10px;
  background: var(--fixu-red);
}

.fixu-jak-scenario-media--custom .fixu-dim-guide--v::before { top: 0; }
.fixu-jak-scenario-media--custom .fixu-dim-guide--v::after { bottom: 0; }

/* ---------- USP band ---------- */
.fixu-jak-usps {
  background: var(--fixu-bg-soft);
  padding: clamp(36px, 5vw, 56px) 0;
  border-top: 1px solid var(--fixu-border);
  border-bottom: 1px solid var(--fixu-border);
}

.fixu-jak-usp-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.fixu-jak-usp-grid li {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: center;
  align-items: center;
}

.fixu-jak-usp-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin-bottom: 6px;
  color: var(--fixu-navy);
}

.fixu-jak-usp-icon img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  display: block;
}

.fixu-jak-usp-grid strong {
  font-size: var(--fixu-fs-md);
  color: var(--fixu-navy);
}

.fixu-jak-usp-grid span:last-child {
  font-size: var(--fixu-fs-sm);
  line-height: 1.45;
  color: var(--fixu-text-soft);
  max-width: 18rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .fixu-jak-steps-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px 20px;
  }

  .fixu-jak-step:nth-child(3)::after,
  .fixu-jak-step:last-child::after {
    display: none;
  }
}

@media (max-width: 900px) {
  .fixu-jak-scenarios-grid {
    grid-template-columns: 1fr;
  }

  .fixu-jak-scenario {
    grid-template-columns: 1fr;
  }

  .fixu-jak-scenario-media,
  .fixu-jak-scenario-media--restore,
  .fixu-jak-scenario-media--custom {
    min-height: 0;
    aspect-ratio: 16 / 10;
  }

  .fixu-jak-usp-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px 18px;
  }
}

@media (max-width: 700px) {
  .fixu-jak-hero {
    padding: 36px 0 12px;
  }

  .fixu-jak-steps-list {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .fixu-jak-step:not(:last-child)::after {
    display: none;
  }

  .fixu-jak-step {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    grid-template-rows: auto;
    column-gap: 12px;
    row-gap: 0;
    align-items: start;
    height: auto;
  }

  .fixu-jak-step-num {
    grid-column: 1;
    grid-row: 1;
    margin-top: 18px;
    box-shadow: 0 0 0 4px var(--fixu-bg);
  }

  .fixu-jak-step-card {
    grid-column: 2;
    grid-row: 1;
    flex: none;
    height: auto;
    align-self: stretch;
  }

  .fixu-jak-step-media {
    aspect-ratio: 3 / 4;
  }

  .fixu-jak-step-badge {
    width: 40px;
    height: 40px;
    left: 8px;
    bottom: 8px;
  }

  .fixu-jak-step-body {
    flex: none;
    padding: 14px 14px 16px;
  }

  .fixu-jak-step-link {
    margin-top: 2px;
  }

  .fixu-jak-step-title {
    font-size: 16px;
  }

  .fixu-jak-step-text {
    font-size: var(--fixu-fs-sm);
  }

  /* Vertical connector between stacked steps */
  .fixu-jak-step:not(:last-child)::before {
    content: "";
    position: absolute;
    top: 52px;
    left: 13px;
    bottom: -22px;
    border-left: 2px dashed var(--fixu-border-strong);
    z-index: 0;
  }
}

@media (max-width: 520px) {
  .fixu-jak-usp-grid {
    grid-template-columns: 1fr 1fr;
    gap: 20px 14px;
  }

  .fixu-jak-usps {
    padding: var(--fixu-sp-6) 0;
  }

  .fixu-jak-hero {
    padding: 28px 0 8px;
    text-align: center;
  }

  .fixu-jak-hero-inner {
    margin-inline: auto;
  }

  .fixu-jak-step-badge {
    width: 36px;
    height: 36px;
  }
}
