/* =========================
   CTA Blocks (standard + mini)
   Strict / no radius

   IMPORTANT:
   - Standard CTA: keep as designed (unchanged styles)
   - Mini CTA: compact layout (left text, right buttons in a row,
     secondary contacts under buttons in the same right column)
   ========================= */

/* -------- Base wrapper (card width = content width) -------- */
.problems-cta {
  /* подгони под ширину основного контента темы */
  --cta-content-width: 1200px;

  --cta-bg: #F9F6F5;
  --cta-mini-bg: #F9F6F5;

  --border: #E0DAD9;

  --text: #1A1A1A;
  --muted: #4A4A4A;

  --accent: #863A3A;     /* обводка/акцент кнопок */
  --link: #3B5998;       /* ссылки телефона/почты */

  background: var(--cta-bg);
  border: 1px solid var(--border);
  border-radius: 0;
  box-sizing: border-box;

  width: 100%;
  max-width: var(--cta-content-width);
  margin: 0 auto;

  padding: 48px 32px;
}

/* если CTA стоит рядом — добавляем вертикальный ритм */
.problems-cta + .problems-cta {
  margin-top: 20px;
}

/* =========================
   STANDARD CTA (unchanged)
   ========================= */

/* Standard is center-aligned */
.problems-cta:not(.problems-cta--mini) {
  text-align: center;
}

.problems-cta__content {
  margin-bottom: 32px;
}

.problems-cta__title {
  margin: 0 0 12px 0;
  font-weight: 700;
  color: var(--text);
  font-size: 34px;
  line-height: 1.15;
}

.problems-cta__text {
  margin: 0 auto;
  max-width: 760px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
}

/* actions row (buttons) */
.problems-cta__actions {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 20px;
  flex-wrap: wrap;
  width: 100%;
}

/* -------- Buttons (base; used by standard, overridden for mini) -------- */
.cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 18px;

  min-height: 64px;     /* standard size */
  padding: 14px 26px;

  width: 100%;
  max-width: 420px;

  border: 2px solid transparent;
  border-radius: 0;
  box-sizing: border-box;

  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;

  line-height: 1.2;

  transition: background-color 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

/* SVG (standard): large and crisp */
.cta-button svg {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;

  overflow: visible;
  display: block;
}

/* Make icons follow currentColor */
.cta-button svg * {
  stroke: currentColor;
  fill: none;
  vector-effect: non-scaling-stroke;
}

/* If icon uses fill */
.cta-button svg [fill]:not([fill="none"]) {
  fill: currentColor;
  stroke: none;
}

/* primary buttons (TG/MAX) */
.cta-button--telegram,
.cta-button--max {
  background: #ffffff;
  color: var(--accent);
  border-color: var(--accent);
}

.cta-button--telegram:hover,
.cta-button--max:hover {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

.cta-button__text {
  display: inline-block;
  line-height: 1.15;
  text-align: left;
}

/* -------- Secondary contacts (base; standard uses it) -------- */
.problems-cta__divider {
  text-align: center;
  margin: 26px 0 8px;
}

.problems-cta__divider-text {
  font-size: 15px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.2px;
}

.problems-cta__secondary {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;

  text-decoration: none;
  border-radius: 0;

  color: var(--link);
  font-size: 15px;
  padding: 4px 6px;

  transition: color 0.15s ease;
}

.contact-link svg {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;

  overflow: visible;
  display: block;
}

.contact-link svg * {
  stroke: currentColor;
  fill: none;
  vector-effect: non-scaling-stroke;
}

.contact-link__text {
  font-weight: 500;
  color: currentColor;
}

.contact-link__label {
  display: none;
}

.contact-link:hover {
  color: var(--accent);
}

/* =========================
   MINI CTA (only mini changes below)
   Layout goal:
   - Left column: title + subtitle (tight)
   - Right column: Telegram + MAX buttons in a row
   - Under buttons (right column): phone/email (secondary) — smaller
   ========================= */

.problems-cta--mini {
  background: var(--cta-mini-bg);
  padding: 22px 20px;
  text-align: left;
}

/* remove default bottom margin of content (standard uses it) */
.problems-cta--mini .problems-cta__content {
  margin: 0;
}

/* tighter typography in mini */
.problems-cta--mini .problems-cta__title {
  font-size: 18px;      /* [TUNE] */
  line-height: 1.2;     /* [TUNE] */
  margin: 0 0 4px 0;    /* [TUNE] */
}

.problems-cta--mini .problems-cta__text {
  font-size: 14px;      /* [TUNE] */
  line-height: 1.35;    /* [TUNE] */
  margin: 0;
  max-width: 58ch;      /* [TUNE] */
}

/* divider text is not needed in mini */
.problems-cta--mini .problems-cta__divider {
  display: none;
}

/* show secondary only if has-secondary */
.problems-cta--mini:not(.problems-cta--has-secondary) .problems-cta__divider,
.problems-cta--mini:not(.problems-cta--has-secondary) .problems-cta__secondary {
  display: none;
}

/* ===== MINI: default (mobile/tablet): stack ===== */
.problems-cta--mini .problems-cta__actions {
  justify-content: flex-start;
  align-items: center;
  gap: 10px;           /* [TUNE] */
  flex-wrap: wrap;     /* if not enough width — wrap */
  margin-top: 10px;    /* [TUNE] space after text */
}

/* smaller buttons in mini */
.problems-cta--mini .cta-button {
  min-height: 46px;      /* >= 44px */
  padding: 10px 12px;    /* [TUNE] */
  width: auto;
  max-width: none;
  font-size: 13px;       /* [TUNE] */
  line-height: 1.1;
  gap: 10px;             /* [TUNE] icon <-> text gap */
  white-space: nowrap;   /* keep label in one line */
}

/* button text slightly smaller (keeps uppercase from base) */
.problems-cta--mini .cta-button__text {
  font-size: 12px;       /* [TUNE] */
  letter-spacing: 0.5px; /* [TUNE] */
  line-height: 1.1;
}

/* MINI button icons - consistent sizing */
.problems-cta--mini .cta-button svg {
  flex: 0 0 22px;     /* fixed size for icons */
  width: 22px;        /* fixed size for icons */
  height: 22px;       /* fixed size for icons */
  stroke-width: 1px;
  overflow: visible;
  display: block;
}

/* MINI secondary contacts (smaller, compact) */
.problems-cta--mini .problems-cta__secondary {
  justify-content: flex-start;
  gap: 6px 14px;       /* [TUNE] */
  margin-top: 8px;     /* [TUNE] */
}

.problems-cta--mini .contact-link {
  font-size: 12px;     /* [TUNE] */
  padding: 0;          /* compact */
  line-height: 1.2;
  white-space: nowrap; /* keep phone/email on one line */
}

/* MINI secondary icons */
.problems-cta--mini .contact-link svg {
  flex: 0 0 14px;     /* [TUNE] */
  width: 14px;        /* [TUNE] */
  height: 14px;       /* [TUNE] */
  stroke-width: 1px;
  overflow: visible;
  display: block;
  position: relative;
  top: -1px;          /* [TUNE] align with text baseline */
}

/* ===== MINI: desktop layout (>= 900px): two columns ===== */
@media (min-width: 900px) {
  .problems-cta--mini {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "content actions"
      "content secondary";
    column-gap: 18px; /* [TUNE] */
    row-gap: 8px;     /* [TUNE] vertical gap between actions and secondary */
    align-items: start;
  }

  .problems-cta--mini .problems-cta__content   { grid-area: content; }
  .problems-cta--mini .problems-cta__actions   { grid-area: actions; }
  .problems-cta--mini .problems-cta__secondary { grid-area: secondary; }

  /* right column alignment */
  .problems-cta--mini .problems-cta__actions {
    justify-content: center;
    flex-wrap: nowrap; /* keep TG + MAX in one row on desktop */
    margin-top: 0;     /* spacing handled by grid */
  }

  .problems-cta--mini .problems-cta__secondary {
    justify-content: center;
    margin-top: 0;     /* spacing handled by grid row-gap */
  }
}

/* ===== Responsive (common) ===== */
@media (max-width: 640px) {
  .problems-cta {
    padding: 28px 16px;
  }

  /* standard content spacing on mobile */
  .problems-cta__content {
    margin-bottom: 18px;
  }

  .problems-cta__title {
    font-size: 26px;
  }

  /* standard buttons: full width on mobile */
  .cta-button {
    max-width: none;
    min-height: 56px;
  }

  .problems-cta__actions {
    gap: 12px;
  }

  /* mini keeps its own sizing (more specific rules above will win),
     but we add a small top spacing for readability */
  .problems-cta--mini .problems-cta__actions {
    margin-top: 12px;
  }
}