/* design.css — страница Дизайн. Mobile-first, без !important */

/* CTA: кнопки «Получить консультацию» и «Примеры и цены» в одну строку */
.cta-card--design .cta-card__actions .button--primary,
.cta-card--design .cta-card__actions .button--outline {
  white-space: nowrap;
}

.page--design.app .app__main {
  padding: 0;
}

.demo-design {
  width: 100%;
  max-width: 100vw;
  margin: 0 auto;
  background: #000000;
  overflow-x: hidden;
  box-sizing: border-box;
}

/* Hero — Desktop: скрыть фон (design-desktop) */
@media (min-width: 1440px) {
  .demo-design .hero-with-figure__bg,
  .demo-design .hero-with-figure__bg-img,
  .demo-design .hero-with-figure__overlay {
    display: none;
  }

  .demo-design {
    width: min(100%, clamp(1440px, 100vw, 2560px));
    margin-left: auto;
    margin-right: auto;
  }
}

/* Tablet 834–1439: масштабирование до 1440 */
@media (min-width: 834px) and (max-width: 1439px) {
  .demo-design {
    width: min(100%, clamp(834px, 92vw, 1440px));
    margin: 0 auto;
  }

  /* Hero на всю ширину экрана */
  .demo-design .hero-with-figure {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    min-height: 485px;
  }

  .hero-with-figure {
    display: flex;
    align-items: center;
  }

  .hero-with-figure__bg-img--mobile {
    display: none;
  }

  .hero-with-figure__bg-img--desktop {
    display: block;
  }

  .hero-with-figure__content {
    position: absolute;
    left: 32px;
    top: 50%;
    transform: translateY(-50%);
    width: 462px;
    max-width: calc(100% - 64px);
    padding: 0;
    gap: 18px;
  }

  .hero-with-figure__content .hero-with-figure__actions {
    margin-top: 18px;
  }

  .hero-with-figure__title {
    font-size: 32px;
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: 0.48px;
    margin: 0;
  }

  .hero-with-figure__subtitle {
    font-size: 16px;
    line-height: 24px;
    color: #c4c4c4;
    margin: 0;
    max-width: 439px;
  }

  .hero-with-figure__actions {
    gap: 8px;
    flex-shrink: 0;
  }

  /* Hero buttons 218×56 / 176×56 — button.css */
  .hero-with-figure__actions .button--primary {
    width: 218px;
    height: 56px;
  }
  .hero-with-figure__actions .button--outline {
    width: 176px;
    height: 56px;
  }

  .hero-with-figure__image-wrap {
    display: none;
  }
}

/* Mobile — hero, benefits, contact (кнопки wrap как reference) */
@media (max-width: 833px) {
  .cta-card--design .cta-card__actions {
    flex-wrap: wrap;
    justify-content: center;
  }
  .cta-card--design .cta-card__actions .button--primary,
  .cta-card--design .cta-card__actions .button--outline {
    min-width: 120px;
    width: auto;
    max-width: 199px;
  }
  .hero-with-figure {
    width: 100%;
    min-height: var(--hero-mobile-h, 485px);
    height: var(--hero-mobile-h, 485px);
    margin: 0;
    padding: 0;
    position: relative;
    box-sizing: border-box;
    overflow: hidden;
  }

  .hero-with-figure__bg {
    position: absolute;
    inset: 0;
    z-index: 0;
  }

  .hero-with-figure__bg-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  .hero-with-figure__bg-img--desktop {
    display: none;
  }

  .hero-with-figure__bg-img--mobile {
    display: block;
  }

  .hero-with-figure__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(0,0,0,0.8) 4.38%, rgba(0,0,0,0.619) 28.02%, rgba(0,0,0,0.4) 56.72%, rgba(0,0,0,0.1) 66.25%);
    z-index: 1;
  }

  .hero-with-figure__content {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 36px;
    text-align: left;
  }

  /* Design hero 440: центрируем весь контентный блок по экрану */
  .demo-design .hero-with-figure__content {
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(408px, calc(100% - 32px));
    max-width: 100%;
    align-items: stretch;
  }

  .hero-with-figure__title {
    width: 100%;
    margin: 0;
    font-family: var(--font-sans);
    font-weight: 800;
    font-size: 32px;
    line-height: 1.3;
    letter-spacing: 0.48px;
    color: #fff;
  }

  .hero-with-figure__subtitle {
    width: 100%;
    max-width: 277px;
    margin: 0;
    font-family: var(--font-sans);
    font-weight: 400;
    font-size: 16px;
    line-height: 24px;
    color: #c4c4c4;
  }

  .demo-design .hero-with-figure__actions {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center; /* как на AI hero 440 */
    gap: 10px;
    width: 100%;
    margin: 0 auto;
    text-align: center;
  }

  /* Design hero 440: повторяем паттерн AI hero 440 */
  .demo-design .hero-with-figure__actions .button--lg {
    flex: 1 1 0;
    min-width: 0;
    width: auto;
    box-sizing: border-box;
    padding: 16px 20px;
    height: 52px;
    font-size: 16px;
    line-height: 20px;
    border-radius: 64px;
    white-space: nowrap; /* текст кнопок в одну строку */
  }

  /* Очень узкие экраны (< 360px): ещё чуть уменьшаем кнопку, чтобы текст влезал */
  @media (max-width: 359px) {
    .demo-design .hero-with-figure__actions {
      gap: 8px;
    }

    .demo-design .hero-with-figure__actions .button--lg.button--primary,
    .demo-design .hero-with-figure__actions .button--lg.button--outline {
      padding: 10px 8px;
      font-size: 12px;
    }
  }

  .hero-with-figure__image-wrap {
    display: block;
    position: absolute;
    right: -15%;
    top: 50%;
    transform: translateY(-50%);
    left: auto;
    width: clamp(260px, 75vw, 420px);
    height: clamp(260px, 75vw, 420px);
  }

  /* Why-cards — вертикальные отступы от .section, контейнер только горизонтальный padding */
  .demo-design .why-cards .container {
    padding: 0 16px;
    gap: 42px;
    max-width: 100%;
  }

  .demo-design .why-cards__title {
    margin: 0;
    font-size: 24px;
    line-height: 1.3;
  }

  .demo-design .why-cards__grid {
    gap: 22px;
  }

  .demo-design .why-card {
    padding: 28px 14px;
    gap: 10px;
  }

  .demo-design .why-card__icon {
    width: 60px;
    height: 60px;
  }

  .demo-design .why-card__body {
    gap: 8px;
  }

  .demo-design .why-card__title {
    font-size: 20px;
    font-weight: 600;
    line-height: 26px;
    letter-spacing: 1.5px;
  }

  .demo-design .why-card__text {
    font-size: 14px;
    line-height: 21px;
    color: #ffffff;
  }

  /* Benefits «Как мы создаем дизайн» — fluid grid как reference (Print how) */
  .demo-design .benefits .container {
    padding: 0 clamp(16px, calc(20 * 100vw / 440), 24px);
    max-width: min(100%, clamp(320px, calc(408 * 100vw / 440), 600px));
    margin-left: auto;
    margin-right: auto;
  }

  .demo-design .benefits__title {
    margin: 0 0 42px;
    font-size: 24px;
    line-height: 1.3;
  }

  .demo-design .benefits__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(12px, calc(18 * 100vw / 440), 24px) clamp(10px, calc(12 * 100vw / 440), 18px);
    max-width: 100%;
    width: 100%;
  }

  .demo-design .benefit-card {
    width: 100%;
    max-width: min(100%, 198px);
    min-width: 0;
    justify-self: center;
    gap: 17px;
  }

  .demo-design .benefit-card__ring {
    width: 94px;
    height: 94px;
    border-width: 3px;
  }

  .demo-design .benefit-card__icon {
    width: 42px;
    height: 42px;
  }

  .demo-design .benefit-card__title {
    font-size: 18px;
  }

  .demo-design .benefit-card__text {
    font-size: 14px;
    line-height: 1.3;
  }

  /* Feature-grid — вертикальные отступы от .section */
  .demo-design .feature-grid .container {
    padding: 0 16px;
    max-width: 100%;
  }

  .demo-design .feature-grid__title {
    margin: 0 0 42px;
    font-size: 24px;
  }

  .demo-design .feature-grid__grid {
    gap: 16px;
  }
}

/* CTA Design — экраны < 440px: две кнопки строго в один ряд */
@media (max-width: 439px) {
  .cta-card--design .cta-card__actions {
    flex-wrap: nowrap;
    justify-content: center;
    gap: 8px;
  }

  .cta-card--design .cta-card__actions .button--primary,
  .cta-card--design .cta-card__actions .button--outline {
    flex: 1 1 0;
    min-width: 0;
    width: auto;
    max-width: none;
    padding-inline: 10px;
    font-size: 14px;
  }
}

/* Общие отступы (десктоп + планшет + мобилка) */
.demo-design .content-media-block__row {
  gap: 24px;
}
