/* ============================================================
   MEDIA.LEAD — Case Header + Floating CTA
   Isolated styles with .mlead- prefix
   ============================================================ */

/* ── Font Faces ──────────────────────────────────────────────── */
@font-face {
  font-family: 'ML Loos Wide';
  src: url('/fonts/loos-wide-bold.woff') format('woff');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'ML Loos Wide';
  src: url('/fonts/loos-wide-medium.woff') format('woff');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'ML Loos Normal';
  src: url('/fonts/loos-wide-regular.woff') format('woff');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'ML Loos Normal';
  src: url('/fonts/loos-wide-light.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ── Full Reset ──────────────────────────────────────────────── */
.mlead-case-header,
.mlead-case-header *,
.mlead-case-header *::before,
.mlead-case-header *::after,
.mlead-float-cta,
.mlead-float-cta *,
.mlead-float-cta *::before,
.mlead-float-cta *::after,
.mlead-order-popup,
.mlead-order-popup *,
.mlead-order-popup *::before,
.mlead-order-popup *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'ML Loos Normal', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: normal;
  text-decoration: none;
  border: none;
  outline: none;
  background: none;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: normal;
  text-transform: none;
  list-style: none;
  vertical-align: baseline;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

/* ════════════════════════════════════════════════════════════════
   HEADER — static, sits above case content, doesn't overlap
   ════════════════════════════════════════════════════════════════ */
.mlead-case-header {
  position: relative;
  z-index: 99999;
  height: 48px;
  background: #0a0a0f;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 500;
}

/* ── Back Button (left) ───────────────────────────────────────── */
.mlead-back {
  position: absolute;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 8px;
  padding: 6px 14px;
  color: rgba(255, 255, 255, 0.55);
  font-family: 'ML Loos Normal', -apple-system, sans-serif;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.25s ease, color 0.25s ease;
  white-space: nowrap;
  text-decoration: none !important;
}

.mlead-back:hover {
  border-color: rgba(255, 255, 255, 0.2) !important;
  color: #ffffff;
}

.mlead-back__arrow {
  display: inline-block;
  font-style: normal;
  transition: transform 0.25s ease;
  font-size: 13px;
  line-height: 1;
}

.mlead-back:hover .mlead-back__arrow {
  transform: translateX(-3px);
}

.mlead-back__text {
  display: inline;
}

/* ── Center: Logo + Case Name ─────────────────────────────────── */
.mlead-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none !important;
  cursor: default;
}

.mlead-logo__svg {
  display: flex;
  align-items: center;
  height: 16px;
  flex-shrink: 0;
}

.mlead-logo__svg svg {
  display: block;
  width: auto;
  height: 100%;
  max-width: 100px;
}

.mlead-logo__case-name {
  font-family: 'ML Loos Normal', -apple-system, sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.2;
  white-space: nowrap;
  padding-left: 10px;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
}

/* ════════════════════════════════════════════════════════════════
   FLOATING BUTTONS — fixed bottom-left
   ════════════════════════════════════════════════════════════════ */
.mlead-float-wrap {
  position: fixed;
  bottom: 28px;
  left: 28px;
  z-index: 99998;
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: mlead-float-in 0.6s cubic-bezier(0.22, 1, 0.36, 1) 1s both;
}

.mlead-float-cta {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #ff3a3a 0%, #7d72fe 100%) !important;
  color: #ffffff !important;
  font-family: 'ML Loos Wide', -apple-system, sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 14px 24px;
  border-radius: 16px;
  border: none !important;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none !important;
  box-shadow:
    0 4px 24px rgba(255, 58, 58, 0.3),
    0 2px 8px rgba(0, 0, 0, 0.3);
  transition: transform 0.25s ease, box-shadow 0.3s ease;
}

.mlead-float-cta:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow:
    0 8px 32px rgba(255, 58, 58, 0.4),
    0 4px 12px rgba(0, 0, 0, 0.3);
}

.mlead-float-cta:active {
  transform: translateY(0) scale(0.98);
  box-shadow:
    0 2px 12px rgba(255, 58, 58, 0.25),
    0 1px 4px rgba(0, 0, 0, 0.2);
}

.mlead-float-cta__icon {
  display: flex;
  align-items: center;
  font-size: 18px;
  line-height: 1;
}

.mlead-float-cta__text-mobile {
  display: none;
}

@keyframes mlead-float-in {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ── "Вернуться на сайт" link ─────────────────────────────────── */
.mlead-float-back {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  background: rgba(20, 20, 24, 0.85) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.6) !important;
  font-family: 'ML Loos Normal', -apple-system, sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none !important;
  transition: border-color 0.25s ease, color 0.25s ease, background 0.25s ease;
}

.mlead-float-back:hover {
  border-color: rgba(255, 255, 255, 0.2) !important;
  color: #ffffff !important;
  background: rgba(30, 30, 38, 0.9) !important;
}

.mlead-float-back:active {
  transform: scale(0.97);
}

/* ── Pulse ring on CTA ───────────────────────────────────────── */
.mlead-float-cta::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 19px;
  background: linear-gradient(135deg, #ff3a3a, #7d72fe);
  opacity: 0;
  z-index: -1;
  animation: mlead-pulse 3s ease-in-out 2s infinite;
}

@keyframes mlead-pulse {
  0%, 100% { opacity: 0; transform: scale(1); }
  50% { opacity: 0.15; transform: scale(1.06); }
}

/* ════════════════════════════════════════════════════════════════
   ORDER POPUP — modal with form
   ════════════════════════════════════════════════════════════════ */
.mlead-order-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mlead-order-overlay.is-active {
  opacity: 1;
  visibility: visible;
}

.mlead-order-popup {
  position: relative;
  width: 100%;
  max-width: 460px;
  background: #141418;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 40px 36px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 400;
  transform: translateY(20px) scale(0.97);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.mlead-order-overlay.is-active .mlead-order-popup {
  transform: translateY(0) scale(1);
}

/* Close button */
.mlead-order-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06) !important;
  color: rgba(255, 255, 255, 0.5) !important;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  border: none !important;
  line-height: 1;
}

.mlead-order-close:hover {
  background: rgba(255, 255, 255, 0.12) !important;
  color: #fff !important;
}

/* Title */
.mlead-order-popup__title {
  font-family: 'ML Loos Wide', -apple-system, sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 8px;
}

.mlead-order-popup__subtitle {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 28px;
  line-height: 1.5;
}

/* Form */
.mlead-order-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.mlead-order-input {
  width: 100%;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 12px;
  color: #ffffff !important;
  font-family: 'ML Loos Normal', -apple-system, sans-serif;
  font-size: 14px;
  font-weight: 400;
  transition: border-color 0.2s;
}

.mlead-order-input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.mlead-order-input:focus {
  border-color: rgba(125, 114, 254, 0.5) !important;
  background: rgba(255, 255, 255, 0.07) !important;
}

.mlead-order-submit {
  width: 100%;
  padding: 15px 24px;
  background: linear-gradient(135deg, #ff3a3a 0%, #7d72fe 100%) !important;
  color: #ffffff !important;
  font-family: 'ML Loos Wide', -apple-system, sans-serif;
  font-size: 14px;
  font-weight: 700;
  border: none !important;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.3s;
  margin-top: 4px;
}

.mlead-order-submit:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 20px rgba(255, 58, 58, 0.3);
}

.mlead-order-submit:active {
  transform: scale(0.98);
}

.mlead-order-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

/* Success state */
.mlead-order-success {
  text-align: center;
  padding: 20px 0;
}

.mlead-order-success__icon {
  font-size: 48px;
  margin-bottom: 16px;
  display: block;
}

.mlead-order-success__title {
  font-family: 'ML Loos Wide', -apple-system, sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 8px;
}

.mlead-order-success__text {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.5;
}

/* ── Mobile ≤ 767px ──────────────────────────────────────────── */
@media (max-width: 767px) {
  .mlead-case-header {
    height: 40px;
    padding: 0 12px;
  }

  .mlead-back {
    left: 12px;
    padding: 5px 8px;
    border-color: rgba(255, 255, 255, 0.08) !important;
  }

  .mlead-back__text {
    display: none;
  }

  .mlead-back__arrow {
    font-size: 14px;
  }

  .mlead-logo {
    gap: 8px;
  }

  .mlead-logo__svg {
    height: 13px;
  }

  .mlead-logo__svg svg {
    max-width: 80px;
  }

  .mlead-logo__case-name {
    font-size: 11px;
    padding-left: 8px;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Floating buttons — compact on mobile */
  .mlead-float-wrap {
    bottom: 16px;
    left: 16px;
    right: 16px;
    gap: 8px;
  }

  .mlead-float-cta {
    justify-content: center;
    padding: 14px 20px;
    border-radius: 14px;
    font-size: 14px;
    width: 100%;
  }

  .mlead-float-cta__text-desktop {
    display: none;
  }

  .mlead-float-cta__text-mobile {
    display: inline;
  }

  .mlead-float-cta::before {
    border-radius: 17px;
  }

  .mlead-float-back {
    justify-content: center;
    padding: 10px 16px;
    font-size: 12px;
    border-radius: 10px;
  }

  /* Popup */
  .mlead-order-popup {
    padding: 32px 24px;
    border-radius: 16px;
  }

  .mlead-order-popup__title {
    font-size: 18px;
  }
}
