/* Typography layer. Loaded after legacy styles so admin settings win predictably. */
body {
  font-family: var(--font-ui);
  font-size: var(--type-body, 15px);
}

.mlc-logo,
.site-footer__brand {
  font-family: var(--font-ui);
  font-size: var(--type-logo, 30px);
  line-height: 1;
  font-weight: 950;
}

.marketplace-hero h1,
.market-home-body .marketplace-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(30px, 3vw, var(--type-hero, 42px));
  line-height: 1.04;
  letter-spacing: 0;
}

.marketplace-section-head h2,
.catalog-section h2,
.market-home-body .catalog-section h2,
.catalog-roadmap-panel__copy h2,
.partner-cta h2 {
  font-family: var(--font-display);
  font-size: clamp(28px, 3vw, var(--type-section, 34px));
  line-height: 1.06;
  letter-spacing: 0;
}

.market-product-info h3,
.market-product-main h3,
.market-home-body .market-product-info h3 {
  font-family: var(--font-ui);
  font-size: var(--type-card-title, 19px);
  line-height: 1.18;
  letter-spacing: 0;
}

.market-product-info p,
.market-product-meta,
.market-maker,
.market-rating,
.market-product-cta,
.catalog-result-summary {
  font-size: max(12px, calc(var(--type-body, 15px) - 1px));
}

.market-product-card {
  grid-template-rows: auto 1fr;
  min-height: clamp(460px, 36vw, 520px);
}

.market-product-visual {
  aspect-ratio: 1.05 / 1;
  height: auto;
  min-height: 0;
}

.market-product-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.market-product-info {
  display: grid;
  grid-template-rows: auto auto auto 1fr;
}

.market-product-info strong,
.market-product-price,
.market-home-body .market-product-info strong,
.market-product-card.is-coming-soon .market-product-info strong {
  font-family: var(--font-ui);
  font-size: var(--type-card-price, 24px);
  line-height: 1;
  letter-spacing: 0;
}

.category-pills a,
.marketplace-actions,
.telegram-login-button {
  font-size: max(13px, calc(var(--type-body, 15px) - 1px));
}

.admin-typography-form {
  display: grid;
  grid-template-columns: minmax(220px, 0.85fr) minmax(320px, 1.15fr) auto;
  gap: 14px;
  align-items: stretch;
}

.admin-typography-preview {
  min-height: 180px;
  display: grid;
  align-content: end;
  gap: 8px;
  padding: 22px;
  border-radius: 24px;
  background:
    radial-gradient(circle at 84% 16%, rgba(255, 255, 255, 0.34), transparent 28%),
    linear-gradient(135deg, #3522a5, #6b4df6 52%, #1f9d8f);
  color: #fff;
}

.admin-typography-preview span {
  color: rgba(255, 255, 255, 0.74);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-typography-preview strong {
  max-width: 360px;
  font-family: var(--preview-display-font, var(--font-display));
  font-size: min(42px, var(--preview-section-size, var(--type-section, 34px)));
  line-height: 1.04;
}

.admin-typography-preview small {
  max-width: 340px;
  color: rgba(255, 255, 255, 0.78);
  font-family: var(--preview-ui-font, var(--font-ui));
  font-size: var(--preview-body-size, var(--type-body, 15px));
  font-weight: 750;
}

.admin-typography-editor {
  display: grid;
  gap: 10px;
}

.admin-typography-row {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(150px, 0.75fr);
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid #dde2ec;
  border-radius: 18px;
  background: #f7f8fb;
}

.admin-typography-row span {
  display: grid;
  gap: 2px;
}

.admin-typography-row strong {
  color: #111318;
  font-weight: 950;
}

.admin-typography-row small {
  color: #667082;
  font-weight: 780;
}

.admin-typography-row input,
.admin-typography-row select {
  width: 100%;
  min-height: 44px;
  border: 1px solid #dde2ec;
  border-radius: 14px;
  padding: 0 12px;
  background: #fff;
  color: #111318;
  font: inherit;
  font-weight: 900;
}

.admin-typography-form > button {
  min-height: 48px;
  align-self: end;
  border: 0;
  border-radius: 16px;
  padding: 0 18px;
  background: #111318;
  color: #fff;
  font-weight: 950;
  cursor: pointer;
}

@media (max-width: 920px) {
  .admin-typography-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .mlc-logo {
    font-size: clamp(24px, 7vw, var(--type-logo, 30px));
  }

  .marketplace-hero h1,
  .market-home-body .marketplace-hero h1 {
    font-size: clamp(21px, 6.2vw, calc(var(--type-hero, 42px) * 0.68));
  }

  .marketplace-section-head h2,
  .catalog-section h2,
  .market-home-body .catalog-section h2 {
    font-size: clamp(26px, 7.2vw, calc(var(--type-section, 34px) * 0.86));
  }

  .market-product-info h3,
  .market-home-body .market-product-info h3 {
    font-size: clamp(16px, 4.7vw, var(--type-card-title, 19px));
  }

  .market-product-info p,
  .market-product-meta,
  .market-maker,
  .market-rating,
  .market-product-cta,
  .catalog-result-summary {
    font-size: clamp(12px, 3.35vw, max(12px, calc(var(--type-body, 15px) - 1px)));
  }

  .market-product-info strong,
  .market-product-price,
  .market-home-body .market-product-info strong {
    font-size: clamp(22px, 6.4vw, var(--type-card-price, 24px));
  }

  .market-product-card {
    min-width: 0;
    min-height: 293px;
    grid-template-rows: auto 1fr;
  }

  .market-product-visual {
    aspect-ratio: 1.04 / 1;
  }

  .market-product-info {
    min-height: 132px;
    padding: 16px;
    gap: 8px;
  }
}
