/* BlitzKey — Mobile styles (≤640px)
   Компоненты: tabbar, m-tile, m-row, m-search, m-chips, m-sect */

/* ── BOTTOM TAB BAR ──────────────────────────────────────── */
.m-tabbar {
  display: none;
}
@media (max-width: 640px) {
  .m-tabbar {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: rgba(30,31,34,.94);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--sep);
    padding: 8px 8px env(safe-area-inset-bottom, 16px);
    z-index: 200;
  }
  .m-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    color: var(--fg-3);
    font-size: 10px;
    font-weight: 600;
    padding-top: 3px;
    text-decoration: none;
    transition: color .13s;
  }
  .m-tab.on { color: var(--blurple-2); }
  .m-tab svg { width: 22px; height: 22px; }

  /* Push page content above tabbar */
  body { padding-bottom: 72px; }


}

/* ── MOBILE SEARCH ───────────────────────────────────────── */
.m-search {
  display: none;
  align-items: center;
  gap: 9px;
  height: 44px;
  padding: 0 15px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--fg-3);
  font-size: 13.5px;
  white-space: nowrap;
  overflow: hidden;
  text-decoration: none;
  transition: border-color .14s;
}
.m-search:active { border-color: var(--blurple); }
.m-search svg { flex-shrink: 0; color: var(--fg-3); }
.m-search span { color: var(--fg-3); }

/* ── CATEGORY CHIPS ──────────────────────────────────────── */
.m-chips {
  display: flex;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  border-bottom: 1px solid var(--sep);
}
.m-chips::-webkit-scrollbar { display: none; }
.m-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 10px 14px;
  background: none;
  border: 0;
  color: var(--fg-3);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  text-decoration: none;
  position: relative;
  border-radius: 8px 8px 0 0;
  transition: background .13s, color .13s;
}
.m-chip:hover { color: var(--fg); background: var(--surface-2); }
.m-chip.on { color: var(--fg); }
.m-chip.on::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: var(--blurple);
}

/* ── SECTION HEADER ──────────────────────────────────────── */
.m-sect {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.m-sect .all {
  margin-left: auto;
  font-size: 12px;
  color: var(--blurple-2);
  font-weight: 600;
  text-decoration: none;
}

/* ── MOBILE BLOG LIST ────────────────────────────────────── */
.m-blog-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.m-blog-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  background: var(--surface);
  text-decoration: none;
  color: var(--fg);
  transition: background .13s;
}
.m-blog-item:not(:last-child) { border-bottom: 1px solid var(--line); }
.m-blog-item:active { background: var(--surface-2); }
.m-blog-item img {
  width: 60px;
  height: 44px;
  object-fit: cover;
  border-radius: 7px;
  flex-shrink: 0;
}
.m-blog-body { flex: 1; min-width: 0; }
.m-blog-cat {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--blurple-2);
  font-family: var(--font-mono);
  display: block;
  margin-bottom: 3px;
}
.m-blog-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── GAME TILES (2-col grid) ─────────────────────────────── */
.m-grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px;
}
.m-tile {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: var(--fg);
  display: block;
  transition: border-color .14s;
}
.m-tile:active { border-color: var(--line-strong); }
.m-tile .cv {
  height: 88px;
  position: relative;
  overflow: hidden;
  background: var(--surface-2);
}
.m-tile .cv img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.m-tile .tp .db {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--fg-2);
  background: var(--neutral-bg);
  border-radius: 5px;
  padding: 1px 5px;
  white-space: nowrap;
}
.m-tile .tb {
  padding: 9px 11px 11px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.m-tile .tn {
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.m-tile .tp {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: nowrap;
}
.m-tile .tp .now {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
}
.m-tile .tp .now.free { color: var(--green); }
.m-tile .tp .old {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--fg-3);
  text-decoration: line-through;
  white-space: nowrap;
}

/* ── LIST ROWS (исторические минимумы / catalog) ─────────── */
.m-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.m-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  text-decoration: none;
  color: var(--fg);
  transition: border-color .14s;
}
.m-row:active { border-color: var(--line-strong); }
.m-row .rcv {
  width: 88px;
  aspect-ratio: 460/215;
  border-radius: 8px;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--surface-2);
}
.m-row .rcv img { width: 100%; height: 100%; object-fit: cover; display: block; }
.m-row .rmid {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.m-row .rn {
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.m-row .rm {
  font-size: 11px;
  color: var(--fg-3);
  display: flex;
  align-items: center;
  gap: 6px;
}
.m-row .rpr {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  flex-shrink: 0;
}
.m-row .rpr .now {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14.5px;
  white-space: nowrap;
}
.m-row .rpr .now.free { color: var(--green); }
.m-row .rpr .meta {
  display: flex;
  align-items: center;
  gap: 5px;
}
.m-row .rpr .old {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--fg-3);
  text-decoration: line-through;
  white-space: nowrap;
}
.m-row .rpr .disc {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--fg-2);
  background: var(--neutral-bg);
  border-radius: 5px;
  padding: 1px 5px;
}

/* ── GAME DETAIL: HEADER BLOCK ───────────────────────────── */
.m-ghead {
  display: flex;
  gap: 13px;
  align-items: center;
}
.m-gcv {
  width: 130px;
  aspect-ratio: 9 / 5;
  border-radius: 10px;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--surface-2);
}
.m-gcv img { width: 100%; height: 100%; object-fit: cover; display: block; }
.m-ghead .gt {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.m-ghead h2 {
  margin: 0;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.12;
}
.m-gmeta { display: flex; gap: 6px; flex-wrap: wrap; }
.m-pill {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  padding: 3px 7px;
  border-radius: 6px;
  background: var(--neutral-bg);
  color: var(--fg-2);
  white-space: nowrap;
}
.m-pill.green { background: var(--green-bg); color: var(--green); }

/* ── GAME DETAIL: SEGMENT SELECTOR ──────────────────────── */
.m-seg {
  display: flex;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 3px;
}
.m-seg .s {
  flex: 1;
  text-align: center;
  padding: 8px 4px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--fg-3);
  cursor: pointer;
  transition: background .13s, color .13s;
}
.m-seg .s.on { background: var(--surface-2); color: var(--fg); }

/* ── OFFER ROWS ──────────────────────────────────────────── */
.m-offers { display: flex; flex-direction: column; gap: 8px; }
.m-offer {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 13px;
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: var(--fg);
}
.m-offer.best {
  background: linear-gradient(180deg, rgba(75,208,127,.07), rgba(75,208,127,.03)), var(--surface);
  border-color: rgba(75,208,127,.25);
}
.m-offer .slogo {
  width: 34px; height: 34px;
  border-radius: 9px;
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-weight: 800; font-size: 11px;
  color: #fff;
  flex-shrink: 0;
  background: var(--surface-3);
  overflow: hidden;
}
.m-offer .slogo img { width: 100%; height: 100%; object-fit: cover; }
.m-offer .omid {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 4px;
}
.m-offer .on1 { font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.m-offer .om { display: flex; align-items: center; gap: 6px; color: var(--fg-3); font-size: 10.5px; }
.m-offer .opr {
  display: flex; flex-direction: column;
  align-items: flex-end; gap: 2px; flex-shrink: 0;
}
.m-offer .opr .now { font-family: var(--font-mono); font-weight: 700; font-size: 15px; }
.m-offer .opr .old { font-family: var(--font-mono); font-size: 10.5px; color: var(--fg-3); text-decoration: line-through; }
.m-offer .go {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: var(--blurple);
  display: grid; place-items: center;
  color: #fff; flex-shrink: 0;
  box-shadow: var(--shadow-btn);
}
.m-offer.best .go {
  background: rgba(75,208,127,.12);
  border: none;
  color: var(--green);
  box-shadow: none;
}

/* ── MARKETPLACE SUB-ROWS ────────────────────────────────── */
.m-sublist {
  display: flex; flex-direction: column;
  background: var(--surface-2);
  border-radius: 0 0 10px 10px;
  padding: 4px 8px 6px;
  margin-top: -10px;
  border: 1px solid var(--line);
  border-top: 0;
}
.m-sub {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 6px;
  text-decoration: none;
  color: var(--fg);
  border-bottom: 1px solid var(--sep);
}
.m-sub:last-child { border-bottom: 0; }
.m-sub .st { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.m-sub .sn { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-sub .sm { font-size: 10px; color: var(--fg-3); display: flex; gap: 5px; }
.m-sub .sp { font-family: var(--font-mono); font-weight: 700; font-size: 13px; white-space: nowrap; }
.m-sub .sgo {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: var(--neutral-bg);
  display: grid; place-items: center;
  color: var(--fg-2); flex-shrink: 0;
}

/* ── SORT ROW ────────────────────────────────────────────── */
.m-sort {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1;
  min-width: 0;
}
.m-sort::-webkit-scrollbar { display: none; }
.m-sort .sl {
  color: var(--fg-3);
  font-size: 11.5px;
  flex-shrink: 0;
}
.m-sort button {
  appearance: none;
  border: 0;
  background: none;
  color: var(--fg-3);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 9px;
  border-radius: 7px;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
}
.m-sort button.on { background: var(--surface-2); color: var(--fg); }

/* ── FILTER BAR (catalog) ────────────────────────────────── */
.m-filterbar {
  display: flex;
  align-items: center;
  gap: 8px;
}
.m-filterbtn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--fg-2);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
}
.m-filterbtn svg { color: var(--fg-3); }

/* ── ARTICLE STYLES ──────────────────────────────────────── */
.m-cat {
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--blurple-2);
  background: var(--blurple-bg);
  border-radius: 6px;
  padding: 3px 8px;
}
.m-art-featured {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: var(--fg);
  display: block;
}
.m-art-cover {
  height: 160px;
  background: var(--surface-2);
  overflow: hidden;
}
.m-art-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.m-art-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.m-art-head {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.2;
}
.m-art-meta {
  display: flex;
  gap: 7px;
  font-size: 11.5px;
  color: var(--fg-3);
}
.m-art-exc {
  font-size: 13px;
  line-height: 1.55;
  color: var(--fg-2);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* .m-row articles variant — square cover */
.m-row .rcv-sq {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--surface-2);
}
.m-row .rcv-sq img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ── GIFT CARD ROW ───────────────────────────────────────── */
.m-row .gcv-ico {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  flex-shrink: 0;
  background: var(--surface-2);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.m-row .gcv-ico svg { width: 24px; height: 24px; }
.m-row .gcv-ico img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }

/* ── MOBILE FILTER BUTTON ────────────────────────────────── */
.m-filt-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-2);
  background: var(--surface);
  border: 1px solid var(--line);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  font-family: var(--font-ui);
  transition: .13s;
}
.m-filt-btn:active { border-color: var(--line-strong); }
.m-filt-cnt {
  display: inline-flex;
  place-items: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--blurple);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
}

/* ── MOBILE FILTER DRAWER ────────────────────────────────── */
.m-filt-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0,0,0,.55);
  display: flex;
  align-items: flex-end;
}
.m-filt-overlay[aria-hidden="true"] { display: none; }
.m-filt-drawer {
  width: 100%;
  background: var(--surface);
  border-radius: 18px 18px 0 0;
  padding: 0 0 env(safe-area-inset-bottom, 0);
  max-height: 85vh;
  overflow-y: auto;
}
.m-filt-drawer__hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  font-size: 15px;
  font-weight: 700;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 1;
}
.m-filt-close {
  background: none;
  border: 0;
  color: var(--fg-3);
  cursor: pointer;
  padding: 4px;
  display: flex;
}
.m-filt-section {
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
}
.m-filt-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--fg-3);
  font-family: var(--font-mono);
  margin-bottom: 10px;
}
.m-filt-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.m-filt-price {
  display: flex;
  align-items: center;
  gap: 8px;
}
.m-filt-price input {
  flex: 1;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 8px 12px;
  min-width: 0;
  -moz-appearance: textfield;
}
.m-filt-price input::-webkit-outer-spin-button,
.m-filt-price input::-webkit-inner-spin-button { -webkit-appearance: none; }
.m-filt-price input::placeholder { color: var(--fg-3); }
.m-filt-price span { color: var(--fg-3); flex-shrink: 0; }

.m-filt-drawer__foot {
  display: flex;
  gap: 10px;
  padding: 14px 20px 20px;
  align-items: center;
}
.m-filt-reset {
  color: var(--fg-3);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  padding: 10px 0;
}
.m-filt-apply {
  flex: 1;
  background: var(--blurple);
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 11px;
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font-ui);
  cursor: pointer;
}

/* ── FILTER CHIPS (shared by platform chips and drawer) ───── */
.m-pchip {
  display: inline-flex;
  align-items: center;
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-2);
  background: var(--bg-2);
  border: 1px solid var(--line);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  font-family: var(--font-ui);
  transition: .13s;
}
.m-pchip.on { background: var(--blurple); color: #fff; border-color: var(--blurple); }

/* ── WRAPPERS ────────────────────────────────────────────── */
.mob-catalog, .mob-blog, .mob-giftcards, .mob-game, .mob-article { display: none; }

/* ── MOBILE HOME WRAPPER ─────────────────────────────────── */
.mob-home {
  display: none;
}
@media (max-width: 640px) {
  /* ── Показываем мобильные обёртки ───────────────────────── */
  .mob-home      { display: flex; flex-direction: column; gap: 20px; padding: 16px 16px 0; }
  .mob-catalog   { display: flex; flex-direction: column; gap: 14px; padding: 12px 16px 0; }
  .mob-blog      { display: flex; flex-direction: column; gap: 16px; padding: 12px 16px 0; }
  .mob-giftcards { display: flex; flex-direction: column; gap: 14px; padding: 12px 16px 0; }
  .mob-game      { display: flex; flex-direction: column; gap: 14px; padding: 12px 16px 20px; }
  .mob-article   { display: flex; flex-direction: column; gap: 16px; padding: 12px 16px 16px; }

  /* ── Скрываем десктопные обёртки ─────────────────────────── */
  .desk-home, .desk-catalog, .desk-blog, .desk-giftcards,
  .desk-article  { display: none !important; }

  /* ── Скрыть десктопный футер ────────────────────────────── */
  .site-footer { display: none; }
}
