/* TBM — каталог продукции (мобильный) */
@media (max-width: 991px) {
  .project-page-section {
    background: #f4f4f4;
    padding: 0 0 24px !important;
    overflow: visible;
  }

  .project-page-section .outer-container,
  .project-page-section .auto-container {
    padding: 0;
    max-width: none;
    overflow: visible !important;
  }

  .project-page-section .page-title {
    display: none !important;
  }

  .project-page-section .account-l {
    display: none !important;
  }

  /* ── Шапка категории ── */
  .tbm-catalog-toolbar {
    padding: 0;
    background: #fff;
    border-bottom: 1px solid #ddd;
    position: sticky;
    top: var(--tbm-sticky-h, 44px);
    z-index: 90;
  }

  .tbm-catalog-toolbar-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
  }

  .tbm-catalog-toolbar-text {
    flex: 1;
    min-width: 0;
  }

  .tbm-catalog-filter-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 16px;
    border: 1px solid #333;
    border-radius: 0;
    background: #111;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
  }

  .tbm-catalog-filter-btn:active {
    background: #333;
  }

  .tbm-catalog-filter-btn-label {
    display: block;
  }

  .tbm-catalog-title {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
    color: #111;
  }

  .tbm-catalog-meta {
    margin: 0;
    font-size: 12px;
    font-weight: 500;
    color: #888;
    line-height: 1.4;
  }

  /* ── Панель категорий (полноэкранная) ── */
  body.tbm-cat-filter-open {
    overflow: hidden;
  }

  .tbm-cat-filter {
    position: fixed;
    inset: 0;
    z-index: 3000;
    pointer-events: none;
  }

  .tbm-cat-filter-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.25s ease;
  }

  .tbm-cat-filter-sheet {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    top: 12%;
    background: #fff;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.28s ease;
    border-top: 2px solid #111;
  }

  .tbm-cat-filter.is-open {
    pointer-events: auto;
  }

  .tbm-cat-filter.is-open .tbm-cat-filter-backdrop {
    opacity: 1;
  }

  .tbm-cat-filter.is-open .tbm-cat-filter-sheet {
    transform: translateY(0);
  }

  .tbm-cat-filter-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid #ddd;
    flex-shrink: 0;
    background: #fff;
  }

  .tbm-cat-filter-head h2 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: #111;
  }

  .tbm-cat-filter-close {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 0;
    background: #fff;
    color: #111;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    flex-shrink: 0;
  }

  .tbm-cat-filter-search-wrap {
    padding: 10px 16px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
    background: #fafafa;
  }

  .tbm-cat-filter-search {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    border: 1px solid #ccc;
    border-radius: 0;
    background: #fff;
    font-size: 16px;
    line-height: 1.2;
    color: #111;
    font-family: inherit;
    -webkit-appearance: none;
  }

  .tbm-cat-filter-search:focus {
    outline: none;
    border-color: #111;
  }

  .tbm-cat-filter-search::placeholder {
    color: #999;
  }

  .tbm-cat-filter-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0;
  }

  .tbm-cat-filter-group {
    border-bottom: 1px solid #eee;
  }

  .tbm-cat-filter-group.is-hidden {
    display: none;
  }

  .tbm-cat-filter-row {
    display: flex;
    align-items: stretch;
    min-height: 48px;
    background: #fff;
  }

  .tbm-cat-filter-parent,
  .tbm-cat-filter-single {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 14px 16px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
    color: #111;
    text-decoration: none;
    border-left: 3px solid transparent;
    background: #fff;
    min-height: 48px;
    box-sizing: border-box;
  }

  .tbm-cat-filter-single {
    width: 100%;
  }

  .tbm-cat-filter-expand {
    flex-shrink: 0;
    width: 48px;
    min-height: 48px;
    border: none;
    border-left: 1px solid #eee;
    background: #fafafa;
    cursor: pointer;
    padding: 0;
    position: relative;
    -webkit-tap-highlight-color: transparent;
  }

  .tbm-cat-filter-expand::before {
    content: '';
    display: block;
    width: 8px;
    height: 8px;
    margin: 0 auto;
    border-right: 2px solid #555;
    border-bottom: 2px solid #555;
    transform: rotate(45deg);
    transition: transform 0.2s ease;
  }

  .tbm-cat-filter-group.is-expanded .tbm-cat-filter-expand::before {
    transform: rotate(-135deg);
    margin-top: 4px;
  }

  .tbm-cat-filter-subs {
    display: none;
    background: #fafafa;
    border-top: 1px solid #eee;
  }

  .tbm-cat-filter-group.is-expanded .tbm-cat-filter-subs {
    display: block;
  }

  .tbm-cat-filter-sub {
    display: block;
    padding: 13px 16px 13px 28px;
    font-size: 14px;
    line-height: 1.4;
    color: #444;
    text-decoration: none;
    border-left: 3px solid transparent;
    border-bottom: 1px solid #f0f0f0;
    background: #fafafa;
    min-height: 44px;
    box-sizing: border-box;
  }

  .tbm-cat-filter-sub:last-child {
    border-bottom: none;
  }

  .tbm-cat-filter-sub.is-hidden {
    display: none;
  }

  .tbm-cat-filter-parent.is-active,
  .tbm-cat-filter-single.is-active,
  .tbm-cat-filter-sub.is-active {
    border-left-color: #e30613;
    background: #fff0f0;
    color: #e30613 !important;
    font-weight: 700;
  }

  .tbm-cat-filter-parent:active,
  .tbm-cat-filter-single:active,
  .tbm-cat-filter-sub:active {
    background: #f0f0f0;
  }

  /* Старые стили фильтра */
  .tbm-catalog-filter-panel,
  .tbm-catalog-cats,
  .tbm-cat-sheet {
    display: none !important;
  }

  /* ── Карточки товаров и проектов ── */
  .project-page-section .porlist,
  .project-page-section .tbm-case-hub-row {
    width: 100% !important;
    float: none !important;
    margin: 0 !important;
    padding: 12px 12px 0 !important;
    overflow: visible !important;
  }

  .project-page-section .porlist.row,
  .project-page-section .tbm-case-hub-row {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 0 !important;
    --bs-gutter-x: 0;
    --bs-gutter-y: 0;
  }

  .project-page-section .porlist.row > :not(.case-block-two) {
    grid-column: 1 / -1;
  }

  .project-page-section .porlist.row > style {
    display: none !important;
  }

  .project-page-section .case-block-two,
  .project-page-section .tbm-case-hub-row .case-block {
    width: 100% !important;
    max-width: none !important;
    padding: 0 !important;
    margin: 0 0 12px !important;
    float: none !important;
    border: none;
    background: transparent;
    overflow: visible;
  }

  .project-page-section .case-block-two .inner-box,
  .project-page-section .tbm-case-hub-row .case-block .inner-box {
    background: transparent;
    border-radius: 0;
    overflow: visible;
    box-shadow: none !important;
    border: none !important;
    height: auto;
    display: block;
  }

  .project-page-section .case-block-two .image,
  .project-page-section .tbm-case-hub-row .case-block .image {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 100%;
    background: #faf8f5;
    margin: 0;
    overflow: hidden;
    border-radius: 12px;
  }

  .project-page-section .case-block-two .image a,
  .project-page-section .tbm-case-hub-row .case-block .image a {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: transparent;
    border: none;
  }

  .project-page-section .case-block-two .image img,
  .project-page-section .tbm-case-hub-row .case-block .image img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center center;
    transform: none !important;
    opacity: 1 !important;
    border-radius: 0;
    display: block;
    position: static;
  }

  .project-page-section .case-block-two .inner-box:hover .image img,
  .project-page-section .tbm-case-hub-row .case-block .inner-box:hover .image img {
    transform: none !important;
    opacity: 1 !important;
  }

  .project-page-section .case-block-two .lower-content,
  .project-page-section .tbm-case-hub-row .case-block .lower-content {
    padding: 8px 4px 0 !important;
    border: none !important;
    flex: 0 0 auto;
    position: static;
    background: transparent !important;
    box-shadow: none !important;
  }

  .project-page-section .case-block-two .lower-content::before,
  .project-page-section .tbm-case-hub-row .case-block .lower-content::before {
    display: none !important;
    content: none !important;
    border: none !important;
  }

  .project-page-section .case-block-two .content,
  .project-page-section .tbm-case-hub-row .case-block .content {
    width: 100% !important;
    text-align: center !important;
  }

  .project-page-section .case-block-two .d-flex,
  .project-page-section .tbm-case-hub-row .case-block .d-flex {
    display: block !important;
  }

  .project-page-section .case-block-two h4,
  .project-page-section .tbm-case-hub-row .case-block h4 {
    font-size: 13px !important;
    line-height: 1.35 !important;
    height: auto !important;
    margin: 0 !important;
    font-weight: 700 !important;
    text-align: center !important;
    text-transform: none;
    letter-spacing: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .project-page-section .case-block-two h4 a,
  .project-page-section .tbm-case-hub-row .case-block h4 a {
    color: #111 !important;
  }

  .project-page-section .case-block-two h4 a:active,
  .project-page-section .tbm-case-hub-row .case-block h4 a:active {
    color: #333 !important;
  }

  .project-page-section .case-block-two .tbm-card-sub,
  .project-page-section .tbm-case-hub-row .case-block .tbm-card-sub {
    display: none !important;
  }

  .project-page-section .case-block-two .content::after,
  .project-page-section .tbm-case-hub-row .case-block .content::after {
    display: none !important;
    content: none !important;
  }

  .project-page-section .case-block-two .arrow,
  .project-page-section .tbm-case-hub-row .case-block .arrow {
    display: none !important;
  }

  /* ── Индикатор страниц ── */
  .project-page-section .tbm-page-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 4px 0 12px;
  }

  .project-page-section .tbm-page-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ccc;
    display: block;
    text-indent: -9999px;
    overflow: hidden;
    flex-shrink: 0;
  }

  .project-page-section .tbm-page-dot.is-active {
    background: #111;
    width: 10px;
    height: 10px;
  }

  /* ── Пагинация (скрыта, заменена точками) ── */
  .project-page-section nav[aria-label="page navigation"] {
    margin: 14px 0 0 !important;
    padding: 0 !important;
    width: 100%;
  }

  .project-page-section .pagination {
    display: flex !important;
    justify-content: center !important;
    width: 100%;
    margin: 0 !important;
    padding: 0;
    border: none !important;
    background: transparent !important;
  }

  .project-page-section .pagination .page-link {
    display: none !important;
  }
}

@media (max-width: 380px) {
  .project-page-section .porlist.row,
  .project-page-section .tbm-case-hub-row,
  .news-page-section .tbm-news-hub-row {
    grid-template-columns: 1fr;
  }
}

/* ── Новости — список ── */
@media (max-width: 991px) {
  .news-page-section {
    background: #f4f4f4;
    padding: 0 0 24px !important;
    overflow: visible;
  }

  .news-page-section .auto-container {
    padding: 0;
    max-width: none;
    overflow: visible !important;
  }

  .news-page-section .tbm-news-hub-row {
    width: 100% !important;
    float: none !important;
    margin: 0 !important;
    padding: 12px 12px 0 !important;
    overflow: visible !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    --bs-gutter-x: 0;
    --bs-gutter-y: 0;
  }

  .news-page-section .news-block {
    width: 100% !important;
    max-width: none !important;
    padding: 0 !important;
    margin: 0 0 12px !important;
    float: none !important;
    border: none;
    background: transparent;
    overflow: visible;
  }

  .news-page-section .news-block .inner-box {
    background: transparent;
    border: none !important;
    border-radius: 0;
    box-shadow: none !important;
    overflow: visible;
    display: block;
  }

  .news-page-section .news-block .image {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 100%;
    background: #faf8f5;
    margin: 0;
    overflow: hidden;
    border-radius: 12px;
  }

  .news-page-section .news-block .image a {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: transparent;
  }

  .news-page-section .news-block .image img,
  .news-page-section .news-block .tbm-news-no-cover {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transform: none !important;
    position: static;
    min-height: 0 !important;
    border-radius: 0;
    background: #faf8f5 !important;
    color: #666 !important;
  }

  .news-page-section .news-block .lower-content {
    padding: 8px 4px 0 !important;
    border: none !important;
    background: transparent !important;
  }

  .news-page-section .news-block .lower-content::before {
    display: none !important;
  }

  .news-page-section .news-block .post-date,
  .news-page-section .news-block .read-more,
  .news-page-section .news-block .theme-btn {
    display: none !important;
  }

  .news-page-section .news-block h4 {
    font-size: 13px !important;
    line-height: 1.35 !important;
    height: auto !important;
    margin: 0 !important;
    font-weight: 700 !important;
    text-align: center !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .news-page-section .news-block h4 a {
    color: #111 !important;
  }

  .news-page-section .tbm-page-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 4px 0 12px;
  }

  .news-page-section .tbm-page-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ccc;
    display: block;
    text-indent: -9999px;
    overflow: hidden;
    flex-shrink: 0;
  }

  .news-page-section .tbm-page-dot.is-active {
    background: #111;
    width: 10px;
    height: 10px;
  }

  .news-page-section nav[aria-label="page navigation"] {
    margin: 14px 0 0 !important;
    padding: 0 !important;
    width: 100%;
  }

  .news-page-section .pagination {
    display: flex !important;
    justify-content: center !important;
    width: 100%;
    margin: 0 !important;
    padding: 0;
    border: none !important;
    background: transparent !important;
  }

  .news-page-section .pagination .page-link {
    display: none !important;
  }
}

/* Каталог на десктопе — шире */
@media (min-width: 992px) {
  .project-page-section .outer-container {
    max-width: 1700px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 16px;
    padding-right: 16px;
    box-sizing: border-box;
  }

  .project-page-section .page-title .auto-container {
    max-width: 1700px;
  }

  .account-l .accordion li.is-current > .link,
  .account-l .accordion li.is-current > .link a,
  .account-l .accordion .link.is-active,
  .account-l .accordion .link.is-active a {
    color: #e30613 !important;
    font-weight: 700;
  }

  .account-l .submenu li.current a {
    background: #e30613 !important;
    color: #fff !important;
  }
}
