/* 02 «Рішення» — Figma node 25:395. Design: 650 / 650 / 324 cards, 660 high, 24 apart. */
.solutions__cards {
  display: grid;
  grid-template-columns: minmax(0, 650fr) minmax(0, 650fr) minmax(calc(316 * var(--ui)), 324fr); /* min keeps its title on one line */
  grid-auto-rows: calc(660 * var(--ui));
  gap: calc(24 * var(--ui));
}

.solution, .dealers {
  position: relative;
  overflow: hidden;
  border-radius: calc(28 * var(--ui));
  background: var(--color-bg-inverse);
}

/* ───────────── Photo cards ───────────── */
.solution { isolation: isolate; scroll-margin-top: 24px; }
.solution__photo, .solution__shade { position: absolute; z-index: -1; pointer-events: none; }
.solution__photo { inset: 0; width: 100%; height: 100%; object-fit: cover; }
.solution__shade { right: 0; bottom: 0; left: 0; }
.solution--home .solution__shade {
  height: calc(100% * 440 / 660);
  background: linear-gradient(rgb(28 27 25 / 0), rgb(28 27 25 / .5) 45%, rgb(28 27 25 / .9));
}
.solution--business .solution__shade {
  height: calc(100% * 520 / 660);
  background: linear-gradient(rgb(28 27 25 / 0), rgb(28 27 25 / .62) 45%, rgb(28 27 25 / .9));
}

.solution__tag {
  position: absolute;
  top: calc(28 * var(--ui));
  left: calc(28 * var(--ui));
  display: flex;
  align-items: center;
  gap: calc(8 * var(--ui));
  padding: calc(8 * var(--ui)) calc(16 * var(--ui)) calc(8 * var(--ui)) calc(8 * var(--ui));
  border: 1px solid var(--color-border-on-photo-muted);
  border-radius: var(--radius-full);
  background: var(--color-overlay-scrim);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  font-size: calc(13 * var(--ui));
  line-height: normal;
  color: #fff;
  white-space: nowrap;
}
/* 28px accent disc; the glyph sits where Figma puts it inside the 14px icon box (offset 7px) */
.solution__tag-icon {
  width: calc(28 * var(--ui));
  height: calc(28 * var(--ui));
  border-radius: 50%;
  background: var(--color-bg-accent) no-repeat;
}
.solution__tag-icon--house {
  background-image: url("../assets/solutions/icon-house.svg");
  background-position: calc(8.14 * var(--ui)) calc(8.43 * var(--ui));
  background-size: calc(11.72 * var(--ui)) calc(11.13 * var(--ui));
}
.solution__tag-icon--factory {
  background-image: url("../assets/solutions/icon-factory.svg");
  background-position: calc(7.27 * var(--ui)) calc(9.02 * var(--ui));
  background-size: calc(13.47 * var(--ui)) calc(10.55 * var(--ui));
}

.solution__stat {
  position: absolute;
  top: calc(28 * var(--ui));
  right: calc(28 * var(--ui));
  display: flex;
  flex-direction: column;
  gap: calc(4 * var(--ui));
  width: calc(238 * var(--ui));
  padding: calc(20 * var(--ui)) calc(24 * var(--ui));
  border-radius: calc(18 * var(--ui));
  background: var(--color-bg-surface);
  box-shadow: 0 calc(14 * var(--ui)) calc(36 * var(--ui)) rgb(38 26 13 / .14);
}
.solution__stat strong {
  font-weight: 700;
  font-size: calc(30 * var(--ui));
  line-height: calc(37 * var(--ui));
  letter-spacing: -.015em;
  white-space: nowrap;
}
.solution__stat span {
  width: calc(190 * var(--ui));
  font-size: calc(12 * var(--ui));
  line-height: calc(15 * var(--ui));
  color: var(--color-text-secondary);
}

.solution__content {
  position: absolute;
  right: calc(28 * var(--ui));
  bottom: calc(28 * var(--ui));
  left: calc(28 * var(--ui));
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: calc(24 * var(--ui));
}
.solution__title, .dealers__title {
  position: relative;
  top: calc(1 * var(--ui)); /* Figma's baseline rounding */
  font-family: var(--font-display);
  font-weight: 500;
  font-size: calc(44 * var(--ui));
  line-height: calc(46 * var(--ui));
  letter-spacing: -.025em;
}
.solution__title { color: #fff; }
.solution__benefits { display: flex; flex-direction: column; gap: calc(12 * var(--ui)); }
.solution__benefits li {
  display: flex;
  align-items: center;
  gap: calc(12 * var(--ui));
  font-size: calc(15 * var(--ui));
  line-height: calc(23 * var(--ui));
  color: var(--color-text-on-photo-muted);
}
.solution__benefits li::before {
  content: "";
  flex: none;
  width: calc(26 * var(--ui));
  height: calc(26 * var(--ui));
  border-radius: 50%;
  background: rgb(255 255 255 / .14) url("../assets/solutions/icon-check.svg") no-repeat calc(7.43 * var(--ui)) calc(8.6 * var(--ui));
  background-size: calc(11.13 * var(--ui)) calc(8.22 * var(--ui));
}
.solution__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: calc(16 * var(--ui));
  width: 100%;
}
.solution__power {
  position: relative;
  top: calc(1 * var(--ui));
  font-weight: 600;
  font-size: calc(14 * var(--ui));
  line-height: normal;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--color-text-on-photo-muted);
}

/* ───────────── Dealers card ───────────── */
.dealers {
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: calc(24 * var(--ui));
  padding: calc(32 * var(--ui)) calc(28 * var(--ui)) calc(28 * var(--ui));
}
/* the wavy gradient of section 04 (wave-gradient.js), inside the card */
.dealers > canvas[data-wave] { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; opacity: 0; pointer-events: none; transition: opacity .6s ease; }
.dealers > canvas[data-wave].is-drawn { opacity: 1; }
.dealers__top { display: flex; flex-direction: column; align-items: flex-start; gap: calc(24 * var(--ui)); }
.dealers__badge {
  width: calc(48 * var(--ui));
  height: calc(48 * var(--ui));
  border-radius: 50%;
  background: var(--color-bg-accent) url("../assets/solutions/icon-users.svg") no-repeat center;
  background-size: calc(20.13 * var(--ui)) calc(18.3 * var(--ui));
}
.dealers__title { color: var(--color-text-inverse); }
.dealers__proof { display: flex; flex-direction: column; gap: calc(4 * var(--ui)); }
.dealers__proof strong {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: calc(88 * var(--ui));
  line-height: calc(84 * var(--ui));
  letter-spacing: -.035em;
  white-space: nowrap;
  color: var(--color-bg-accent);
}
.dealers__proof span { font-size: calc(13 * var(--ui)); line-height: calc(16 * var(--ui)); color: var(--color-text-inverse-muted); }
.dealers__perks { display: flex; flex-direction: column; gap: calc(12 * var(--ui)); }
.dealers__perks li {
  display: flex;
  align-items: center;
  gap: calc(12 * var(--ui));
  font-size: calc(15 * var(--ui));
  line-height: calc(23 * var(--ui));
  color: var(--color-text-inverse-muted);
}
.dealers__perks li::before {
  content: "";
  flex: none;
  width: calc(6 * var(--ui));
  height: calc(6 * var(--ui));
  border-radius: 50%;
  background: var(--color-bg-accent);
}
.dealers .btn { width: 100%; }

/* ───────────── Narrower windows ─────────────
   Figma has only the 1800 frame. Three cards stop fitting first: the dealers card becomes a full-width band. */
@media (max-width: 1279px) {
  .solutions__cards { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: auto; }
  .solution { min-height: calc(660 * var(--ui)); }
  .dealers { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; align-items: flex-end; }
  .dealers__top {
    display: grid;
    grid-template-columns: auto auto;
    align-items: start;
    justify-content: start;
    column-gap: 56px;
  }
  .dealers__top > :not(.dealers__perks) { grid-column: 1; }
  .dealers__perks { grid-column: 2; grid-row: 1 / span 3; align-self: end; }
  .dealers .btn { width: auto; }
}

@media (max-width: 1099px) {
  .section { gap: 40px; padding: 72px 20px; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 24px; }
  .section-title { font-size: clamp(40px, 11.5cqw, 88px); line-height: .96; }
  .section-lead { width: auto; max-width: 540px; font-size: 16px; line-height: 1.45; }
}
@media (min-width: 600px) and (max-width: 1099px) {
  .section { padding-inline: 40px; }
}

/* two narrow columns: the tag and the stat no longer fit side by side */
@media (max-width: 1099px) {
  .solution__stat { top: 86px; right: auto; left: 28px; }
}

/* one column: the card content flows, so long text can never collide with the tag or the stat */
@media (max-width: 899px) {
  .solutions__cards { grid-template-columns: minmax(0, 1fr); }
  .solution {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    min-height: 600px;
    padding: 20px;
  }
  .solution__tag, .solution__stat, .solution__content { position: static; }
  .solution__tag { white-space: normal; }
  .solution__stat { width: min(238px, 100%); }
  .solution__stat span { width: auto; }
  .solution__content { margin-top: auto; padding-top: 120px; width: 100%; }
  .solution__footer { flex-wrap: wrap; }
  .solution .solution__shade { height: 80%; }
  .dealers { flex-direction: column; align-items: stretch; padding: 28px 20px 20px; }
  .dealers__top { display: flex; }
  .dealers__perks { align-self: flex-start; }
  .dealers .btn { width: 100%; }
}
