/* КАПРИН — мобильный слой. Перебивает «Yandex mobile-friendly» в style.css. */
@media (max-width: 900px) {
  /* Снять * { max-width:100% } — ломает тикер, сетки и кнопки */
  * { max-width: none !important; }
  html, body {
    overflow-x: clip !important;
    max-width: 100% !important;
    width: 100% !important;
  }
  img, video, canvas, iframe { max-width: 100% !important; height: auto; }
  svg { max-width: 100%; }
  .container, .header, .footer, .hero, .section, .catalog-desk, .blog-wrap {
    max-width: 100% !important;
  }
  .container { padding-left: 14px !important; padding-right: 14px !important; }

  /* Не раздувать каждую ссылку и span до 44px / 16px */
  span, small, time { font-size: inherit !important; line-height: inherit !important; }
  a { min-height: 0; }
  .btn, button, input, select, textarea { min-height: 44px; font-size: 16px !important; }
  p, li { font-size: 16px; line-height: 1.5; }

  h1, .page-h, .hero h1 {
    overflow-wrap: break-word !important;
    word-break: normal !important;
    hyphens: none !important;
    line-height: 1.22 !important;
  }

  body { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)) !important; }
  * { -webkit-tap-highlight-color: rgba(17,17,17,.12); }

  .caprin-ai-toggle,
  .kp-quick-btn { display: none !important; }

  /* ---- Тикер ---- */
  .kp-ticker { position: relative; z-index: 40; }
  .kp-ticker-inner {
    gap: 8px !important;
    padding: 7px 10px !important;
    align-items: center;
    overflow: hidden !important;
  }
  .kp-ticker-label { display: none !important; }
  .kp-ticker-viewport {
    min-width: 0 !important;
    flex: 1 1 auto !important;
    overflow: hidden !important;
  }
  .kp-ticker a, .kp-ticker-item { min-height: 0 !important; font-size: 13px !important; }
  .kp-ticker-links {
    flex: 0 0 auto;
    background: #0f172a;
    position: relative;
    z-index: 2;
    padding-left: 8px !important;
  }
  .kp-ticker-blog {
    display: inline-flex !important;
    align-items: center;
    min-height: 36px !important;
    padding: 8px 12px !important;
    font-size: 12px !important;
    white-space: nowrap;
  }
  .kp-ticker-links a[aria-label="Telegram"],
  .kp-ticker-links a[aria-label="ВКонтакте"] { display: none !important; }

  /* ---- Полоска регистрации ---- */
  .order-status-strip .container {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
    padding: 10px 14px !important;
    text-align: left !important;
  }
  .order-status-strip a.oss-btn {
    margin-left: 0 !important;
    width: 100%;
    justify-content: center;
    min-height: 40px !important;
  }

  /* ---- Шапка ---- */
  .header .container {
    grid-template-columns: 46px minmax(0, 1fr) auto !important;
    gap: 8px !important;
    padding: 8px 10px 10px !important;
  }
  .logo { min-width: 0 !important; max-width: none !important; overflow: hidden; }
  .logo-img { max-width: min(48vw, 190px) !important; height: 32px !important; width: auto; object-fit: contain; }
  .header-actions .hdr-tool { display: none !important; }
  .search-box input { font-size: 16px !important; min-height: 44px; }

  /* ---- Герой ---- */
  .hero .container { padding: 22px 14px 26px !important; }
  .hero-badge { white-space: normal; line-height: 1.35; font-size: 12.5px !important; min-height: 0; }
  .hero h1 { font-size: 24px !important; margin: 12px 0 10px !important; }
  .hero p { font-size: 15px !important; }
  .hero-search {
    display: flex !important;
    flex-direction: row !important;
    border-radius: 14px !important;
    overflow: hidden;
    width: 100% !important;
    max-width: 100% !important;
  }
  .hero-search input {
    flex: 1 1 auto; min-width: 0;
    padding: 12px 14px !important;
    font-size: 16px !important;
  }
  .hero-search .btn {
    width: auto !important;
    max-width: 40%;
    flex: 0 0 auto;
    border-radius: 0 !important;
    min-height: 48px !important;
    padding: 8px 10px !important;
    font-size: 13px !important;
    white-space: normal !important;
    line-height: 1.2;
  }
  .hero-cta {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 8px !important;
    margin-top: 12px !important;
  }
  .hero-cta .btn {
    width: 100% !important;
    justify-content: center;
    white-space: normal !important;
    min-height: 48px !important;
  }
  .hero-stats {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
    margin-top: 18px !important;
  }
  .hero-stats .hs b { font-size: 20px !important; color: #fff !important; }
  .hero-stats .hs span { font-size: 12px !important; color: #c8c8c8 !important; }

  .trust-ribbon-grid { grid-template-columns: 1fr 1fr !important; gap: 8px !important; }
  .steps-grid { grid-template-columns: 1fr !important; }
  .sec-head { align-items: flex-start !important; }
  .sec-head h2 { font-size: 22px !important; }

  .tool-mega { min-height: 0 !important; padding: 16px !important; }
  .tool-mega .btn { width: 100%; justify-content: center; }
  .tools-secondary { display: grid !important; grid-template-columns: 1fr 1fr !important; gap: 10px !important; }
  .tool-mini { min-width: 0; padding: 14px 12px !important; }

  /* ---- Каталог ---- */
  .cat-strip { max-width: 100%; }
  .desk-subs {
    display: flex; flex-wrap: wrap; gap: 8px;
    overflow: visible !important;
  }
  .desk-subs .brand-chip { flex: 0 0 auto; min-height: 40px; }
  .filter-toggle { width: 100%; min-height: 48px; }
  .filter-bar, .filter-bar.open {
    display: flex; flex-direction: column; gap: 10px; width: 100%;
  }
  .filter-bar select, .filter-bar input, .brand-dd-btn { width: 100%; min-height: 44px; }
  .desk-toolbar { flex-direction: column; align-items: stretch !important; gap: 10px; }
  .view-toggle { width: 100%; display: grid !important; grid-template-columns: 1fr 1fr; }
  .prod-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px !important; }
  .card { min-width: 0; }
  .card-name, .cl-name { overflow-wrap: break-word; word-break: normal; }
  .card-bottom { display: grid !important; grid-template-columns: 1fr; gap: 8px; }
  .card-bottom .btn, .cl-buy .btn { width: 100%; }
  .cl-row { min-width: 0; }
  .pager a, .pager span { min-height: 40px; }

  /* ---- Товар ---- */
  .pg { padding-bottom: 150px !important; }
  .pg-info h1 { font-size: 20px !important; overflow-wrap: break-word !important; word-break: normal !important; }
  .pg-buy .btn { width: 100%; }
  .mob-buybar, #prod-sticky, #cart-sticky:not([hidden]) {
    left: 0 !important; right: 0 !important; width: 100% !important;
    bottom: calc(66px + env(safe-area-inset-bottom, 0px)) !important;
    z-index: 88;
    gap: 8px;
  }
  .mob-buybar .btn, #prod-sticky .btn { min-width: 0; flex: 1; }
  .mbb-price { min-width: 0 !important; font-size: 16px !important; }
  body:has(#prod-sticky), body:has(#cart-sticky:not([hidden])) {
    padding-bottom: calc(150px + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* ---- Чекаут / формы ---- */
  .chk-actions { display: grid !important; grid-template-columns: 1fr !important; }
  .chk-actions .btn { width: 100%; }
  .form-grid { grid-template-columns: 1fr !important; }
  .checkout-layout { grid-template-columns: 1fr !important; }
  .mini-cart { position: static !important; }
  .dropzone { padding: 22px 14px; }
  .dz-actions, .catalog-help-actions { display: grid; grid-template-columns: 1fr; gap: 8px; }
  .catalog-help-actions .btn { width: 100%; }

  /* ---- Блог ---- */
  .blog-feed { padding: 0 14px !important; grid-template-columns: 1fr 1fr !important; gap: 10px !important; }
  .blog-article { padding: 0 14px !important; }
  .blog-article-layout { grid-template-columns: 1fr !important; }
  .blog-article-card { padding: 18px 16px !important; }
  .blog-article-card h1 { font-size: 22px !important; }
  .blog-side { position: static !important; grid-template-columns: 1fr !important; }
  .blog-card { min-height: 0; }

  .cta-band { display: grid !important; gap: 12px; padding: 20px 16px !important; }
  .cta-band .btn { width: 100%; justify-content: center; }
  .about-grid { display: grid !important; grid-template-columns: 1fr !important; }
  .footer-grid { grid-template-columns: 1fr 1fr !important; gap: 16px !important; }

  .mob-bar a, .mob-bar button {
    min-height: 48px !important;
    min-width: 0;
    font-size: 11px !important;
    padding: 6px 2px !important;
    overflow: hidden;
    white-space: nowrap;
  }
  .wago-pop { width: min(440px, calc(100vw - 24px)) !important; max-height: 80vh; }
  .wago-pop-actions .btn { width: 100%; }

  .modal, .quick-modal, .kp-quick-modal { max-width: calc(100vw - 24px); }
}

@media (max-width: 560px) {
  .tools-secondary { grid-template-columns: 1fr !important; }
  .trust-ribbon-grid { grid-template-columns: 1fr !important; }
  .footer-grid { grid-template-columns: 1fr !important; }
  .hero h1 { font-size: 22px !important; }
  .blog-feed { grid-template-columns: 1fr !important; }
  .page-h { font-size: 22px !important; }
}

@media (max-width: 380px) {
  .logo-img { max-width: 42vw !important; }
  .kp-ticker-blog { font-size: 11px !important; padding: 7px 10px !important; }
  .prod-grid { gap: 8px !important; }
}
