/* Shared storefront typography. Adapted using Unslop by Damir Sokolovsky (@heydamir), CC BY 4.0. */

/* Important declarations in this layer take precedence over the legacy component overrides. */
@layer storefront-typography {
  :root {
    --store-font: Manrope, system-ui, sans-serif;
    --store-regular: 500;
    --store-medium: 600;
    --store-bold: 700;
    --store-body-size: 15px;
    --store-label-size: 14px;
    --store-caption-size: 13px;
    --store-card-price-size: 18px;
    --store-page-title-size: clamp(27px, 3vw, 36px);
    --store-section-title-size: clamp(21px, 2vw, 26px);
  }

  body,
  .miniapp-gate {
    font-family: var(--store-font) !important;
    font-size: var(--store-body-size) !important;
    font-weight: var(--store-regular) !important;
    line-height: 1.55 !important;
  }

  .miniapp-gate h1 {
    letter-spacing: -.025em !important;
  }

  .miniapp-gate :is(.miniapp-retry, .miniapp-open-telegram) {
    font-family: var(--store-font) !important;
    font-weight: var(--store-medium) !important;
  }

  :is(h1, h2, h3, h4, h5, h6) {
    font-family: var(--store-font) !important;
    font-weight: var(--store-bold) !important;
    letter-spacing: normal !important;
  }

  main h1 {
    font-size: var(--store-page-title-size) !important;
    line-height: 1.16 !important;
    letter-spacing: -.025em !important;
  }

  :is(.home-section-head, .miniapp-shop-head, .miniapp-promo, .mh-section-head, .sf-section-head) > :is(h1, h2),
  #catalogRootHeading :is(h1, h2),
  :is(.steam-widget-heading, .related-heading, .product-faq-heading) h2,
  :is(h2.steam-widget-heading, h2.related-heading, h2.product-faq-heading) {
    font-size: var(--store-section-title-size) !important;
    line-height: 1.24 !important;
    letter-spacing: -.018em !important;
  }

  :is(.home-showcase, .home-reviews) .home-section-head h2,
  .sf-store-products .sf-section-head h2,
  .rust-popular-regions h2 {
    font-size: clamp(19px, 1.6vw, 23px) !important;
    line-height: 1.25 !important;
  }

  :is(.sf-scene-copy, .home-banner-copy) h2 {
    font-size: clamp(22px, 2.35cqw, 34px) !important;
    line-height: 1.17 !important;
    letter-spacing: -.02em !important;
  }

  :is(main p, main li, small, .helper-text, .muted, .text-muted, .product-description,
      .profile-tool-desc, .profile-tools-desc, .steam-widget-fee-label, .steam-order-modal-subtitle,
      .ct-root-copy small, .mh-category-copy small, .miniapp-steam-category small,
      .mh-wallet-copy > span, .mh-steam small, .mh-help small) {
    font-weight: var(--store-regular) !important;
    letter-spacing: normal !important;
  }

  :is(.sf-scene-copy, .home-banner-copy) p {
    font-size: clamp(14px, 1.28cqw, 18px) !important;
    line-height: 1.48 !important;
  }

  :is(.rust-license-description, .product-review, .home-review-card, .product-faq-section) p {
    font-size: var(--store-body-size) !important;
    line-height: 1.6 !important;
  }

  :is(.ct-root-copy small, .mh-category-copy small, .miniapp-steam-category small, .rust-license-region-label,
      .product-review time, .home-review-card time, .ct-breadcrumbs, .ct-level p) {
    font-size: var(--store-caption-size) !important;
    line-height: 1.4 !important;
  }

  :is(.ct-root-copy strong, .mh-category-copy strong, .miniapp-steam-category strong,
      .product-name, .rust-license-card-title, .rust-license-country, .profile-tool-title,
      label, .sf-scene-cta, .rust-license-buy, .home-catalog-link, .miniapp-all-products,
      .mh-wallet-action, .mh-steam strong, .mh-help strong, .mh-section-head > a, .sf-section-head > a,
      .ct-chip, .ct-level-link, .mobile-bottom-link, .site-header .nav-link, .site-header .btn,
      .btn, .btn-primary, .btn-secondary) {
    font-family: var(--store-font) !important;
    font-weight: var(--store-medium) !important;
    letter-spacing: normal !important;
  }

  :is(.ct-root-copy strong, .mh-category-copy strong, .miniapp-steam-category strong) {
    font-size: 15px !important;
    line-height: 1.3 !important;
  }

  :is(.product-name, .rust-license-card-title) {
    font-size: var(--store-label-size) !important;
    line-height: 1.35 !important;
  }

  :is(.home-catalog-link, .miniapp-all-products, .mh-section-head > a, .sf-section-head > a, .ct-chip, .ct-level-link) {
    font-size: var(--store-caption-size) !important;
  }

  :is(.mh-wallet-copy > span, .mh-wallet-action, .mh-steam small, .mh-help small) {
    font-size: 12px !important;
    line-height: 1.4 !important;
  }

  .mobile-bottom-link {
    font-size: 12px !important;
    line-height: 1.25 !important;
  }

  button {
    font-weight: var(--store-medium) !important;
  }

  :is(input, textarea, select) {
    font-family: var(--store-font) !important;
    font-weight: var(--store-regular) !important;
    letter-spacing: normal !important;
  }

  ::placeholder {
    font-weight: var(--store-regular) !important;
  }

  :is(.product-price, .rust-license-price, .related-price, .cart-line-price strong,
      .product-old-price, .old-price, .price-pair .price, .mobile-buybar-price,
      .cart-total-pay strong, .balance-topup-total strong, .steam-widget-total strong,
      .miniapp-wallet strong, .mh-wallet-copy strong) {
    font-family: var(--store-font) !important;
    font-variant-numeric: tabular-nums !important;
    letter-spacing: normal !important;
  }

  :is(.product-price, .rust-license-price, .related-price, .cart-line-price strong,
      .price-pair .price, .mobile-buybar-price, .cart-total-pay strong,
      .balance-topup-total strong, .steam-widget-total strong, .miniapp-wallet strong, .mh-wallet-copy strong) {
    font-weight: var(--store-bold) !important;
    line-height: 1.25 !important;
  }

  :is(.product-price, .rust-license-price, .related-price, .cart-line-price strong) {
    font-size: var(--store-card-price-size) !important;
  }

  :is(.product-old-price, .old-price) {
    font-size: 12px !important;
    font-weight: var(--store-regular) !important;
    line-height: 1.3 !important;
  }

  .catalog-skins .product-name { font-size: 13px !important; }
  .catalog-skins .product-price { font-size: 16px !important; }

  @media (min-width: 701px) and (max-width: 1100px) {
    :is(.sf-scene-copy, .home-banner-copy) h2 { font-size: clamp(19px, 2.35cqw, 25px) !important; }
    :is(.sf-scene-copy, .home-banner-copy) p { font-size: clamp(12px, 1.32cqw, 15px) !important; }
  }

  @media (max-width: 700px) {
    :root {
      --store-body-size: 14px;
      --store-label-size: 13px;
      --store-card-price-size: 16px;
      --store-page-title-size: 27px;
      --store-section-title-size: 21px;
    }

    :is(.sf-scene-copy, .home-banner-copy) h2 { font-size: 24px !important; }
    .sf-scene-copy h2 { width: 100% !important; }
    :is(.sf-scene-copy, .home-banner-copy) p { font-size: 13px !important; }
    .sf-scene-actions .sf-scene-cta { font-size: 13px !important; }

    :is(.ct-root-copy strong, .mh-category-copy strong, .miniapp-steam-category strong) {
      font-size: 14px !important;
    }

    :is(.ct-root-copy small, .mh-category-copy small, .miniapp-steam-category small, .ct-breadcrumbs) {
      font-size: 12px !important;
    }

    :is(input:not([type]), input:is([type="text"], [type="search"], [type="email"], [type="url"],
        [type="tel"], [type="password"], [type="number"]), textarea, select) {
      font-size: 16px !important;
    }

    .catalog-skins .product-name { font-size: 12px !important; }
  }

  @media (max-width: 360px) {
    .sf-scene-copy h2 { font-size: 21px !important; }
    .sf-scene-copy p { font-size: 12px !important; }
    .sf-scene-actions .sf-scene-cta { font-size: 12px !important; }
    :is(.home-catalog-link, .sf-section-head > a, .mh-section-head > a) { font-size: 12px !important; }
    .sf-store-products .sf-section-head h2 { font-size: 18px !important; }
  }
}
