/* ============================================================
   МАСТЕР-АСФАЛЬТ · стили первого экрана, калькулятора и мобильной панели
   Вставляется в: Настройки сайта → Вставка кода → «Редактировать CSS»
   (CSS вынесен из HEAD: поле HEAD в Тильде обрезает длинный код)
   ============================================================ */
:root {
    --mas-orange: #f77600;
    --mas-orange-dark: #e06a00;
    --mas-ink: #14161a;
    --mas-text: #2c2c2c;
    --mas-muted: #6b6b6b;
    --mas-radius: 14px;
    --mas-font: 'Inter', 'Muller', Arial, sans-serif;
  }

  .mas-orig-hero-hidden { display: none !important; }

  /* ---------- общий контейнер ---------- */
  .mas-hero * { box-sizing: border-box; }
  .mas-hero {
    position: relative;
    isolation: isolate;
    background: #0d0f12;
    color: #fff;
    font-family: var(--mas-font);
    overflow: hidden;
  }
  .mas-hero__bg {
    position: absolute;
    inset: 0;
    background-image: var(--mas-bg, none);
    background-size: cover;
    background-position: center 40%;
    transform: scale(1.03);
    z-index: -2;
  }
  .mas-hero__bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
      linear-gradient(100deg, rgba(8, 9, 11, .94) 0%, rgba(8, 9, 11, .82) 42%, rgba(8, 9, 11, .45) 72%, rgba(8, 9, 11, .62) 100%),
      radial-gradient(120% 90% at 82% 18%, rgba(247, 118, 0, .30) 0%, rgba(247, 118, 0, 0) 58%);
  }
  .mas-hero__inner {
    position: relative;
    z-index: 1;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 24px 34px;
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
  }

  /* ---------- верхняя строка внутри первого экрана ---------- */
  .mas-top {
    display: flex;
    align-items: center;
    gap: 26px;
    padding: 18px 0 14px;
    border-bottom: 1px solid rgba(255, 255, 255, .10);
  }
  .mas-top__logo { flex: 0 0 auto; display: flex; align-items: center; }
  /* логотип тёмный — на тёмном фоне инвертируем, сохраняя оранжевый */
  .mas-top__logo img {
    height: 46px;
    width: auto;
    display: block;
    filter: invert(1) hue-rotate(180deg) saturate(1.2) brightness(1.06);
  }
  .mas-top__socials { display: flex; align-items: center; gap: 6px; }
  .mas-top__socials a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    color: #fff;
    transition: transform .16s ease, opacity .16s ease;
  }
  .mas-top__socials a:hover { transform: translateY(-1px); opacity: .85; }
  .mas-top__socials svg { width: 30px; height: 30px; display: block; }
  .mas-top__nav { display: flex; align-items: center; gap: 22px; margin-left: 8px; }
  .mas-top__nav a {
    color: rgba(255, 255, 255, .82);
    text-decoration: none;
    font-size: 16px;
    line-height: 1;
    padding: 6px 0;
    border-bottom: 2px solid transparent;
    transition: color .18s ease, border-color .18s ease;
  }
  .mas-top__nav a:hover { color: #fff; border-color: var(--mas-orange); }
  .mas-top__actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
  .mas-top__burger {
    display: none;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .2);
    color: #fff;
    cursor: pointer;
  }
  .mas-top__phone {
    color: #fff;
    font-weight: 600;
    font-size: 17px;
    text-decoration: none;
    white-space: nowrap;
  }
  .mas-top__phone:hover { color: var(--mas-orange); }

  /* ---------- кнопки ---------- */
  .mas-btn {
    font-family: var(--mas-font);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px 26px;
    border-radius: 12px;
    border: 1px solid transparent;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.1;
    cursor: pointer;
    text-decoration: none;
    transition: transform .16s ease, background-color .16s ease, border-color .16s ease, box-shadow .16s ease;
    -webkit-tap-highlight-color: transparent;
  }
  .mas-btn:active { transform: translateY(1px); }
  .mas-btn--primary {
    background: var(--mas-orange);
    color: #fff;
    box-shadow: 0 14px 30px rgba(247, 118, 0, .28);
  }
  .mas-btn--primary:hover { background: var(--mas-orange-dark); box-shadow: 0 18px 36px rgba(247, 118, 0, .34); }
  .mas-btn--ghost {
    background: rgba(255, 255, 255, .06);
    border-color: rgba(255, 255, 255, .28);
    color: #fff;
  }
  .mas-btn--ghost:hover { background: rgba(255, 255, 255, .13); border-color: rgba(255, 255, 255, .5); }
  .mas-btn--sm { padding: 11px 18px; font-size: 15px; }
  .mas-btn--block { width: 100%; }
  .mas-btn svg { flex: 0 0 auto; }

  /* ---------- сетка первого экрана ---------- */
  .mas-hero__grid {
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: minmax(0, 1.06fr) minmax(0, .94fr);
    grid-template-areas:
      "left right"
      "trust right";
    align-content: center;
    gap: 22px 54px;
    padding: 22px 0 18px;
  }
  .mas-hero__left { grid-area: left; align-self: end; }
  .mas-hero__right { grid-area: right; align-self: center; }
  .mas-hero__trust { grid-area: trust; align-self: start; }
  .mas-pills { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
  .mas-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .09);
    border: 1px solid rgba(255, 255, 255, .14);
    font-size: 14px;
    color: rgba(255, 255, 255, .92);
  }
  .mas-pill b { color: #fff; font-weight: 600; }
  .mas-h1 {
    margin: 0 0 16px;
    font-size: clamp(28px, 3vw, 46px);
    line-height: 1.07;
    font-weight: 700;
    letter-spacing: -.6px;
    color: #fff;
  }
  .mas-h1 span { color: var(--mas-orange) !important; }
  .mas-sub {
    margin: 0 0 22px;
    font-size: 18px;
    line-height: 1.45;
    color: rgba(255, 255, 255, .84);
    max-width: 540px;
  }
  .mas-cta { display: flex; flex-wrap: wrap; gap: 12px; }
  .mas-trust { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
  .mas-trust li {
    position: relative;
    padding-left: 30px;
    font-size: 15.5px;
    line-height: 1.38;
    color: rgba(255, 255, 255, .88);
  }
  .mas-trust li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(247, 118, 0, .16) url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M1.5 6.4l3 3L10.6 3' fill='none' stroke='%23f77600' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center no-repeat;
  }

  /* ---------- калькулятор ---------- */
  .mas-calc {
    background: rgba(17, 19, 23, .78);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, .13);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 30px 70px rgba(0, 0, 0, .45);
  }
  .mas-calc--pulse { animation: mas-pulse 1.1s ease 2; }
  @keyframes mas-pulse {
    0%, 100% { box-shadow: 0 30px 70px rgba(0, 0, 0, .45); }
    50% { box-shadow: 0 0 0 6px rgba(247, 118, 0, .35), 0 30px 70px rgba(0, 0, 0, .45); }
  }
  .mas-calc__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
  .mas-calc__head strong { font-size: 19px; font-weight: 700; color: #fff; }
  .mas-calc__head span { font-size: 12px; color: rgba(255, 255, 255, .6); text-align: right; }
  .mas-field { margin-bottom: 12px; }
  .mas-field > label { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: rgba(255, 255, 255, .58); margin-bottom: 6px; }
  .mas-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .mas-seg button:nth-child(odd):last-child { grid-column: 1 / -1; }
  .mas-seg button {
    font-family: var(--mas-font);
    min-width: 0;
    padding: 9px 10px;
    font-size: 13px;
    line-height: 1.2;
    color: rgba(255, 255, 255, .85);
    background: rgba(255, 255, 255, .07);
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 10px;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
  }
  .mas-seg button:hover { background: rgba(255, 255, 255, .13); }
  .mas-seg button.is-active {
    background: var(--mas-orange);
    border-color: var(--mas-orange);
    color: #fff;
    font-weight: 600;
  }
  .mas-area { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
  .mas-area input[type="number"] {
    font-family: var(--mas-font);
    width: 104px;
    padding: 9px 11px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    background: rgba(255, 255, 255, .07);
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 10px;
    -moz-appearance: textfield;
  }
  .mas-area input[type="number"]::-webkit-outer-spin-button,
  .mas-area input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
  .mas-area input[type="number"]:focus { outline: 2px solid rgba(247, 118, 0, .6); outline-offset: 1px; }
  .mas-chips { display: flex; flex-wrap: wrap; gap: 6px; }
  .mas-chips button {
    font-family: var(--mas-font);
    padding: 7px 11px;
    font-size: 13px;
    color: rgba(255, 255, 255, .8);
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 999px;
    cursor: pointer;
  }
  .mas-chips button:hover { background: rgba(247, 118, 0, .22); border-color: rgba(247, 118, 0, .5); color: #fff; }
  .mas-range {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    border-radius: 4px;
    background: rgba(255, 255, 255, .2);
    outline: none;
    margin: 2px 0 0;
  }
  .mas-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--mas-orange);
    border: 3px solid #fff;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .4);
  }
  .mas-range::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--mas-orange);
    border: 3px solid #fff;
    cursor: pointer;
  }
  .mas-select {
    font-family: var(--mas-font);
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    color: #fff;
    background: rgba(255, 255, 255, .07);
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 10px;
    cursor: pointer;
  }
  .mas-select option { color: #2c2c2c; }
  .mas-result {
    margin: 14px 0 12px;
    padding: 14px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(247, 118, 0, .17), rgba(247, 118, 0, .05));
    border: 1px solid rgba(247, 118, 0, .35);
  }
  .mas-result__price { font-size: 26px; font-weight: 700; color: #fff; line-height: 1.1; letter-spacing: -.5px; }
  .mas-result__price small { display: block; font-size: 12px; font-weight: 500; color: rgba(255, 255, 255, .7); letter-spacing: 0; margin-top: 4px; }
  .mas-result__meta { margin-top: 8px; font-size: 13px; color: rgba(255, 255, 255, .82); }
  .mas-result__note { margin-top: 6px; font-size: 12px; color: rgba(255, 255, 255, .62); line-height: 1.4; }
  .mas-calc__fine { margin-top: 10px; font-size: 11.5px; line-height: 1.4; color: rgba(255, 255, 255, .5); }

  /* ---------- строка фактов ---------- */
  .mas-facts {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    padding: 14px 0 0;
    border-top: 1px solid rgba(255, 255, 255, .12);
  }
  .mas-fact__n { font-size: 24px; font-weight: 700; color: var(--mas-orange); line-height: 1.1; }
  .mas-fact__t { font-size: 13.5px; color: rgba(255, 255, 255, .74); line-height: 1.3; margin-top: 3px; }

  /* ---------- мобильная нижняя панель ---------- */
  .mas-bar { display: none; }
  /* ---------- фиксированная шапка на телефоне ---------- */
  .mas-fhead { display: none; }
  .mas-sheet { display: none; }

  @media (max-width: 1100px) {
    .mas-top__nav { display: none; }
    .mas-hero__grid { gap: 34px; }
    .mas-h1 { font-size: clamp(28px, 4.4vw, 42px); }
  }

  @media (max-width: 980px) {
    .mas-hero__inner { min-height: 0; padding: 0 18px 26px; }
    .mas-hero__grid {
      grid-template-columns: minmax(0, 1fr);
      grid-template-areas: "left" "right" "trust";
      gap: 22px;
      padding: 18px 0 16px;
    }
    .mas-hero__left, .mas-hero__right, .mas-hero__trust { align-self: stretch; }
    .mas-sub { font-size: 17px; }
    .mas-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  }

  @media (max-width: 767px) {
    .mas-top { padding: 14px 0 18px; gap: 10px; border-bottom: none; }
    .mas-top__logo img { height: 34px; }
    .mas-top__actions { gap: 10px; }
    .mas-top__actions .mas-btn { display: none; }
    .mas-top__socials { display: none; }
    /* на телефоне в шапке оставляем логотип и «бургер», номер — в нижней панели */
    .mas-top__phone { display: none; }
    .mas-top__burger { display: inline-flex; margin-left: auto; }
    /* больше воздуха: отступ после шапки и перед калькулятором */
    .mas-hero__grid { gap: 20px; padding: 22px 0 24px; }
    .mas-hero__left { padding-bottom: 4px; }
    .mas-pills { gap: 8px; margin-bottom: 18px; }
    .mas-pill { font-size: 12.5px; padding: 7px 11px; }
    .mas-h1 { font-size: clamp(26px, 7.4vw, 34px); letter-spacing: -.3px; margin-bottom: 14px; }
    .mas-sub { font-size: 16px; margin-bottom: 22px; }
    .mas-cta { gap: 12px; }
    .mas-cta .mas-btn { width: 100%; padding: 16px 20px; }
    /* на телефоне пункты доверия убираем — остаётся воздух, а смысл несут плашки */
    .mas-hero__trust { display: none; }
    .mas-hero__right { margin-top: 6px; }
    .mas-calc { padding: 20px 16px; border-radius: 16px; }
    .mas-calc__head strong { font-size: 18px; }
    .mas-result__price { font-size: 25px; }
    .mas-seg button { min-width: 0; flex: 1 1 46%; font-size: 13px; padding: 10px; }
    .mas-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 26px; padding-top: 18px; }
    .mas-fact__n { font-size: 21px; }
    .mas-fact__t { font-size: 13px; }

    body.mas-bar-space { padding-bottom: 78px !important; }

    /* фиксированная шапка: логотип, телефон, меню — появляется при прокрутке */
    .mas-fhead {
      position: fixed;
      left: 0;
      right: 0;
      top: 0;
      z-index: 9986;
      display: flex;
      align-items: center;
      gap: 10px;
      height: 56px;
      padding: 0 14px;
      background: rgba(12, 13, 16, .95);
      -webkit-backdrop-filter: blur(10px);
      backdrop-filter: blur(10px);
      border-bottom: 1px solid rgba(255, 255, 255, .1);
      transform: translateY(-100%);
      transition: transform .25s ease;
    }
    .mas-fhead.is-visible { transform: translateY(0); }
    .mas-fhead__logo { display: flex; align-items: center; }
    .mas-fhead__logo img {
      height: 26px;
      width: auto;
      display: block;
      filter: invert(1) hue-rotate(180deg) saturate(1.2) brightness(1.06);
    }
    .mas-fhead__phone {
      margin-left: auto;
      color: #fff;
      font-size: 14px;
      font-weight: 600;
      text-decoration: none;
      white-space: nowrap;
    }
    .mas-fhead__burger {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 38px;
      height: 38px;
      flex: 0 0 auto;
      border-radius: 10px;
      background: rgba(255, 255, 255, .1);
      border: 1px solid rgba(255, 255, 255, .2);
      color: #fff;
      cursor: pointer;
    }
    .mas-fhead__burger svg { width: 20px; height: 20px; display: block; }

    .mas-bar {
      position: fixed;
      left: 0;
      right: 0;
      bottom: 0;
      z-index: 9990;
      display: grid;
      grid-auto-flow: column;
      grid-auto-columns: minmax(0, 1fr);
      gap: 1px;
      background: rgba(12, 13, 16, .96);
      -webkit-backdrop-filter: blur(10px);
      backdrop-filter: blur(10px);
      border-top: 1px solid rgba(255, 255, 255, .12);
      padding-bottom: env(safe-area-inset-bottom, 0px);
      transform: translateY(110%);
      transition: transform .28s ease;
    }
    .mas-bar.is-visible { transform: translateY(0); }
    .mas-bar__btn {
      font-family: var(--mas-font);
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 3px;
      padding: 8px 2px 9px;
      font-size: 10.5px;
      line-height: 1.1;
      color: rgba(255, 255, 255, .86);
      background: transparent;
      border: 0;
      text-decoration: none;
      cursor: pointer;
      min-height: 56px;
    }
    .mas-bar__btn svg { width: 21px; height: 21px; }
    .mas-bar__btn--accent { color: #fff; background: var(--mas-orange); }
    .mas-bar__btn--accent svg { stroke: #fff; }

    .mas-sheet {
      position: fixed;
      inset: 0;
      z-index: 9991;
      display: block;
      background: rgba(6, 7, 9, .6);
      opacity: 0;
      pointer-events: none;
      transition: opacity .2s ease;
    }
    .mas-sheet.is-open { opacity: 1; pointer-events: auto; }
    .mas-sheet__panel {
      position: absolute;
      left: 0;
      right: 0;
      bottom: 0;
      background: #14161a;
      border-radius: 18px 18px 0 0;
      padding: 18px 18px calc(24px + env(safe-area-inset-bottom, 0px));
      border-top: 1px solid rgba(255, 255, 255, .12);
      transform: translateY(102%);
      transition: transform .26s ease;
      max-height: 86vh;
      overflow-y: auto;
    }
    .mas-sheet.is-open .mas-sheet__panel { transform: translateY(0); }
    .mas-sheet__title { font-size: 13px; letter-spacing: .05em; text-transform: uppercase; color: rgba(255, 255, 255, .5); margin-bottom: 10px; }
    .mas-sheet__list { display: grid; gap: 2px; margin-bottom: 16px; }
    .mas-sheet__list button {
      font-family: var(--mas-font);
      display: flex;
      align-items: center;
      justify-content: space-between;
      width: 100%;
      padding: 15px 4px;
      font-size: 17px;
      color: #fff;
      text-align: left;
      background: transparent;
      border: 0;
      border-bottom: 1px solid rgba(255, 255, 255, .08);
      cursor: pointer;
    }
    .mas-sheet__list button span { color: var(--mas-orange); }
    .mas-sheet__contacts { display: grid; gap: 10px; }
    .mas-sheet__contacts a {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 13px 14px;
      border-radius: 12px;
      background: rgba(255, 255, 255, .06);
      color: #fff;
      text-decoration: none;
      font-size: 16px;
    }
    .mas-sheet__close {
      font-family: var(--mas-font);
      position: absolute;
      top: 10px;
      right: 12px;
      width: 40px;
      height: 40px;
      border-radius: 50%;
      background: rgba(255, 255, 255, .08);
      border: 0;
      color: #fff;
      font-size: 22px;
      line-height: 1;
      cursor: pointer;
    }
  }

  @media (prefers-reduced-motion: reduce) {
    .mas-hero * { animation: none !important; transition: none !important; }
  }
