/* NOVALOOM — адаптив: правки под телефоны */

/* ≤1024: logo + CTA + burger; primary links move into overlay */
@media (max-width: 1024px) {
  :root {
    --nav-mobile-h: clamp(72px, 12vw, 88px);
  }
  .nav {
    --nav-mobile-h: clamp(72px, 12vw, 88px);
    padding: 10px var(--gutter);
    padding-top: max(10px, env(safe-area-inset-top, 0px));
    max-width: 100%;
    overflow-x: clip;
  }

  .nav-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    column-gap: clamp(6px, 2.5vw, 10px);
    min-width: 0;
    width: 100%;
    max-width: 100%;
  }

  .nav-links {
    display: none !important;
  }
  .nav-more-dots {
    display: none !important;
  }

  .logo {
    min-width: 0;
    max-width: 100%;
    width: 100%;
    flex-shrink: 1;
    justify-self: start;
    align-items: center;
  }

  .nav .logo-img {
    transform: none !important;
    display: block;
    height: clamp(48px, 7vw, 62px) !important;
    width: auto !important;
    max-width: 100% !important;
    max-height: clamp(48px, 7vw, 62px) !important;
    object-fit: contain;
    object-position: left center;
  }

  .nav-cta {
    display: flex;
    align-items: center;
    gap: clamp(6px, 2vw, 8px);
    margin-left: 0;
    flex-shrink: 0;
    min-width: 0;
  }

  .nav-cta .btn-primary {
    position: relative;
    flex-shrink: 1;
    min-width: 0;
    max-width: min(200px, 36vw);
    padding: 10px 16px;
    font-size: 13px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .menu-toggle {
    display: flex !important;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
  }

  .mobile-menu {
    padding-top: max(calc(var(--nav-mobile-h) + 16px), calc(72px + env(safe-area-inset-top, 0px)));
  }
}

@media (max-width: 768px) {
  :root {
    --nav-mobile-h: clamp(76px, 19vw, 88px);
  }
  html {
    overflow-x: clip;
  }

  .container {
    min-width: 0;
    width: 100%;
  }

  .nav {
    --nav-mobile-h: clamp(76px, 19vw, 88px);
    padding: 8px var(--gutter);
    padding-top: max(8px, env(safe-area-inset-top, 0px));
  }

  .nav .logo-img {
    height: clamp(55px, 14.4vw, 67px) !important;
    max-height: clamp(55px, 14.4vw, 67px) !important;
  }

  .nav-cta .btn-primary {
    max-width: min(200px, 48vw);
    padding: 10px 12px;
    font-size: 11px;
  }
  .nav-cta .btn-primary .arrow {
    display: none;
  }

  .hero {
    padding: calc(var(--nav-mobile-h, 88px) + 16px) 0 28px;
  }

  .mobile-menu [data-locale-mount] {
    width: 100%;
    padding-bottom: 12px;
    margin-bottom: 4px;
    border-bottom: 1px solid var(--border-soft);
  }
  .hero-headline {
    font-size: clamp(1.7rem, 8vw, 2.15rem);
    margin-bottom: 12px;
  }
  .hero-job {
    font-size: 0.98rem;
    line-height: 1.4;
  }
  .hero-deck {
    font-size: 0.98rem;
  }
  .hero-cta-row {
    flex-direction: column;
    width: 100%;
    gap: 8px;
  }
  .hero .eyebrow {
    flex-wrap: wrap;
    row-gap: 6px;
    font-size: 10px;
    letter-spacing: 0.08em;
  }

  .hero-cta-row .btn {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    justify-content: center;
    text-align: center;
    white-space: normal;
    flex-wrap: wrap;
    line-height: 1.3;
    hyphens: auto;
  }
  .hero-cta-row .btn > [data-i18n],
  .hero-cta-row .btn > [data-i18n-html] {
    min-width: 0;
    flex: 1 1 auto;
  }
  .btn-lg {
    padding: 14px 18px;
    font-size: 15px;
  }

  .hero-visual {
    margin-top: 40px;
    overflow: hidden;
  }
  .browser-frame {
    transform: none;
    border-radius: var(--r-lg);
  }
  .browser-bar {
    padding: 12px 14px;
    gap: 8px;
  }
  .browser-url {
    font-size: 10px;
    padding: 5px 10px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .browser-content {
    padding: 28px 20px 24px;
    min-height: 0;
  }
  .bc-eyebrow {
    font-size: 9px;
    letter-spacing: 0.08em;
    line-height: 1.45;
    flex-wrap: wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
  }
  .bc-eyebrow::before {
    flex-shrink: 0;
  }
  .bc-title {
    max-width: none;
    font-size: clamp(1.35rem, 6.5vw, 1.85rem);
  }
  .bc-stats {
    width: 100%;
    justify-content: space-between;
    margin-top: 20px;
  }
  .browser-tag {
    display: none;
  }

  .section-head.row {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }
  .section-head .h-1 {
    max-width: none;
  }

  .agitate-card,
  .agitate-card:nth-child(2),
  .agitate-card:nth-child(3) {
    padding: 28px 0 !important;
  }

  .problem-item {
    grid-template-columns: 44px 1fr;
    gap: 14px;
    padding: 22px 0;
  }

  .calc-section .container {
    max-width: 100%;
    overflow-x: clip;
  }

  .calc-container {
    padding: 20px 14px;
    border-radius: var(--r-lg);
    width: 100%;
    box-sizing: border-box;
    overflow-x: clip;
  }

  .calc-result {
    padding: 18px 0 0;
    border: none;
    background: transparent;
    gap: 16px;
  }

  .calc-quick-form.form {
    padding: 0 !important;
    margin-top: 0;
    border: none !important;
    background: transparent !important;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none;
  }

  .calc-ai-monitor {
    margin-bottom: 18px;
    padding: 14px 16px;
    border: 1px solid rgba(200, 175, 95, 0.4);
    border-radius: var(--r-md);
    background: rgba(8, 8, 10, 0.95);
    box-shadow:
      0 0 0 1px rgba(255, 61, 46, 0.08),
      inset 0 1px 0 rgba(255, 255, 255, 0.06);
  }

  .calc-ai-monitor__warn {
    border: 1px solid rgba(217, 255, 58, 0.22);
    background: rgba(255, 61, 46, 0.07);
    padding: 10px 12px;
    border-radius: 10px;
  }

  .calc-alt-link {
    text-align: left;
    padding-top: 4px;
  }

  .calc-grid {
    min-width: 0;
    width: 100%;
  }

  .calc-block,
  .calc-options,
  .calc-addons {
    max-width: 100%;
    overflow: hidden;
  }

  .calc-option {
    max-width: 100%;
    box-sizing: border-box;
  }

  .calc-opt-price {
    white-space: normal;
  }

  .calc-result {
    width: 100%;
    box-sizing: border-box;
  }

  .calc-result-meta {
    flex-wrap: wrap;
    gap: 10px;
  }

  .calc-quick-form {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .calc-quick-form .form-field input,
  .calc-quick-form .form-field textarea {
    max-width: 100%;
    box-sizing: border-box;
  }

  .calc-ai-monitor {
    max-width: 100%;
    box-sizing: border-box;
  }

  .calc-addon {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 10px;
    max-width: 100%;
    box-sizing: border-box;
  }

  .calc-addon-info {
    min-width: 0;
    flex: 1 1 60%;
  }

  .calc-addon.active {
    box-shadow: inset 0 0 0 1px rgba(255, 61, 46, 0.35);
  }
  .calc-options,
  .calc-options.two,
  .calc-options.four {
    grid-template-columns: 1fr;
  }
  .calc-option {
    padding: 14px 12px;
  }
  .calc-label {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .calc-ai-monitor__row {
    flex-wrap: wrap;
    align-items: flex-start;
  }
  .calc-ai-monitor__dd {
    white-space: normal;
    text-align: left;
    width: 100%;
  }

  .case-preview {
    aspect-ratio: 9 / 14;
    min-height: clamp(360px, 102vw, 560px);
  }
  .case.large .case-preview,
  .case.full-row .case-preview {
    aspect-ratio: 9 / 14;
    min-height: clamp(360px, 102vw, 560px);
  }
  /* Превью: вписывание по ширине фрейма, привязка к верху */
  .case-preview picture {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
    line-height: 0;
  }
  .case-preview-shot {
    display: block;
    width: 100%;
    height: auto;
    object-position: top center;
  }
  .case-preview-shot--freight {
    object-position: center 36%;
  }
  .case-preview-shot--roi {
    object-position: top center;
  }
  .case-preview-shot--mossteklo {
    object-position: top center;
  }
  .case-preview--roi {
    background: #eef1f6;
  }

  .case-glass {
    padding: 9px 10px 10px;
    max-width: 100%;
  }

  .case-meta {
    gap: 6px;
  }
  .case-badge,
  .case-tag {
    font-size: 9px;
    padding: 4px 8px;
    letter-spacing: 0.04em;
  }

  .case-name-sub,
  .case-result {
    font-size: 11px;
    line-height: 1.35;
  }
  .case-logo {
    height: 18px;
    max-width: min(58vw, 210px);
  }
  .case-name-sub {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .case-glass-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .case-headline {
    font-size: clamp(0.98rem, 4.2vw, 1.25rem);
    line-height: 1.22;
    overflow-wrap: anywhere;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .price-card > .btn.price-card-btn {
    white-space: normal;
    line-height: 1.25;
  }

  .pricing-guarantee {
    margin-top: 32px;
    padding: 22px 18px;
    gap: 18px;
  }
  .pricing-guarantee__body {
    min-width: 0;
    flex: 1 1 100%;
  }
  .pricing-guarantee .btn {
    width: 100%;
    justify-content: center;
  }

  .cta-final .cta-benefits {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    margin-top: 24px;
  }

  .form {
    padding: 28px 20px;
  }
  .form-field input,
  .form-field textarea,
  .form-field select {
    font-size: 16px;
  }

  .footer-contact-row {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 12px !important;
  }
}

@media (max-width: 400px) {
  .nav-cta .btn-primary {
    width: 44px;
    height: 44px;
    max-width: 44px;
    padding: 0;
    border-radius: 50%;
    justify-content: center;
    overflow: visible;
    text-overflow: clip;
  }

  .nav-cta .btn-primary > span[data-i18n] {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .nav-cta .btn-primary .arrow {
    display: inline;
    margin: 0;
    font-size: 18px;
    line-height: 1;
  }
}

@media (max-width: 480px) {
  .trust-strip {
    grid-template-columns: 1fr 1fr;
    gap: 20px 12px;
  }
  .trust-num {
    font-size: 1.45rem;
  }

  .niches-grid {
    grid-template-columns: 1fr;
  }

  .upgrade-card {
    padding: 22px 18px;
  }

  .stat-big {
    font-size: clamp(3.2rem, 18vw, 5rem);
  }

  .testi-card {
    width: min(88vw, 300px);
  }

  .case-preview,
  .case.large .case-preview,
  .case.full-row .case-preview {
    aspect-ratio: 9 / 15;
    min-height: clamp(330px, 108vw, 500px);
  }

  .case-glass {
    padding: 9px 10px 10px;
  }

  .case-name-sub,
  .case-result {
    font-size: 10px;
  }
  .case-logo {
    height: 16px;
    max-width: min(62vw, 190px);
  }

  .case-headline {
    font-size: clamp(0.92rem, 4.4vw, 1.08rem);
    line-height: 1.2;
  }

  body:has(.mobile-sticky-cta:not([hidden])) {
    padding-bottom: calc(72px + env(safe-area-inset-bottom));
  }

  .mobile-sticky-cta {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9000;
    display: flex;
    gap: 8px;
    padding: 10px var(--gutter) max(12px, env(safe-area-inset-bottom));
    background: rgba(245, 242, 236, 0.96);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--border-soft);
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.08);
  }
  .mobile-sticky-cta[hidden] {
    display: none !important;
  }
  .mobile-sticky-cta__primary,
  .mobile-sticky-cta__secondary {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 10px;
    border-radius: 999px;
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: -0.02em;
    text-align: center;
    line-height: 1.2;
  }
  .mobile-sticky-cta__primary {
    background: var(--accent);
    color: #fff;
  }
  .mobile-sticky-cta__secondary {
    background: #fff;
    border: 1px solid var(--border);
    color: var(--ink);
  }
}
