/* ── Techno Devices: компоненты каталога (общие для главной, каталога, карточки) ── */


/* базовые стили карточки (дублируются здесь, чтобы работали на любой странице) */
.product-card { background: #ffffff; border: 1px solid rgba(0,0,0,0.06); cursor: pointer; transition: background 0.25s, transform 0.2s, box-shadow 0.25s, border-color 0.25s; position: relative; overflow: hidden; border-radius: 24px; color: inherit; text-decoration: none; }
.product-card:hover { box-shadow: 0 20px 50px rgba(0,0,0,0.10); transform: translateY(-4px); border-color: rgba(0,0,0,0.08); }
.product-badge { position: absolute; top: 12px; left: 12px; background: #0071e3; color: white; font-size: 10px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; padding: 4px 10px; border-radius: 10px; z-index: 3; }
.product-brand { font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: #0a84ff; }
.product-name { font-weight: 600; color: #1d1d1f; }
.product-price { font-weight: 600; color: #bf8c30; }
.stock-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.stock-in { background: rgba(48,209,88,0.1); border: 1px solid rgba(48,209,88,0.3); color: #1f9d48; }

/* карточка товара */
.td-card { display: flex !important; flex-direction: column; height: 100%; }
.td-card-media { position: relative; aspect-ratio: 4/3; background: #fff; border-bottom: 1px solid rgba(0,0,0,0.05); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.td-card-media img { width: 100%; height: 100%; object-fit: contain; padding: 14px; transition: transform .35s ease; }
.td-card:hover .td-card-media img { transform: scale(1.04); }
.td-card-media.td-noimg, .td-card-media:not(:has(img)) { background: linear-gradient(135deg, #f3f4f7, #e9ebf0); }
.td-noimg-label { font-size: 12px; color: #8a8a8e; letter-spacing: .02em; }
.td-card .product-body { display: flex; flex-direction: column; flex: 1; padding: 14px 16px 16px; }
.td-card .product-brand { font-size: 10.5px; letter-spacing: .1em; line-height: 1.4; margin-bottom: 6px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.td-card .product-name { font-size: 14px; line-height: 1.35; margin-bottom: 12px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.td-card-foot { margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; }
.td-card-foot .product-price { margin: 0; font-size: 15px; white-space: nowrap; }
.td-card-foot .stock-badge { margin: 0; white-space: nowrap; }
.td-price-request { color: var(--secondary, #3a3a3c) !important; font-weight: 500 !important; font-size: 13px !important; }
.stock-order { background: rgba(0,113,227,0.06) !important; border-color: rgba(0,113,227,0.18) !important; color: #0060c0 !important; }

/* скелетон */
.td-skeleton { border-radius: 24px; background: #fff; border: 1px solid rgba(0,0,0,0.05); overflow: hidden; }
.td-skeleton div { background: linear-gradient(90deg, #eef0f3 0%, #f6f7f9 50%, #eef0f3 100%); background-size: 200% 100%; animation: tdShimmer 1.2s linear infinite; }
@keyframes tdShimmer { to { background-position: -200% 0; } }

/* сайдбар разделов */
.td-cats { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.td-cat { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; text-align: left; border: 0; background: transparent; font: inherit; font-size: 14px; color: var(--secondary, #3a3a3c); padding: 8px 12px; border-radius: 12px; cursor: pointer; transition: background .15s, color .15s; text-decoration: none; }
.td-cat:hover { background: #f2f3f6; color: #111; }
.td-cat.active { background: #111827; color: #fff; }
.td-cat.active .td-count { color: rgba(255,255,255,.7); }
.td-cat-root { font-weight: 600; color: #1d1d1f; }
.td-subcats { list-style: none; margin: 2px 0 8px 10px; padding-left: 8px; border-left: 1px solid rgba(0,0,0,0.08); display: none; }
.td-subcats.open { display: block; }
.td-subcats .td-cat { font-size: 13px; padding: 6px 10px; }
.td-count { font-size: 11px; color: #8a8a8e; font-variant-numeric: tabular-nums; flex-shrink: 0; }
.td-sidebar-title { font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: #8a8a8e; margin: 4px 12px 8px; }

/* заголовок каталога */
.td-catalog-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.td-catalog-head .section-title { margin-bottom: 4px; }
.td-total { font-size: 14px; color: #8a8a8e; }
.td-crumbs { font-size: 13px; color: #8a8a8e; margin-bottom: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.td-crumbs a { color: #8a8a8e; text-decoration: none; }
.td-crumbs a:hover { color: #111; }

/* активные фильтры */
.td-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.td-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 5px 10px 5px 12px; border-radius: 999px; background: #eef4ff; color: #0060c0; border: 1px solid rgba(0,113,227,.18); cursor: pointer; }
.td-chip b { font-weight: 600; }
.td-chip:hover { background: #e2edff; }

/* пагинация */
.td-pager { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-top: 28px; }
.td-more { padding: 12px 28px; border-radius: 999px; border: 1px solid rgba(0,0,0,0.12); background: #fff; font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; transition: all .2s; }
.td-more:hover { border-color: var(--accent, #0071e3); color: var(--accent, #0071e3); }
.td-more:disabled { opacity: .5; cursor: default; }
.td-pages { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.td-page { min-width: 36px; height: 36px; padding: 0 10px; border-radius: 10px; border: 1px solid rgba(0,0,0,0.08); background: #fff; font: inherit; font-size: 13px; cursor: pointer; color: #3a3a3c; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.td-page.active { background: #111827; color: #fff; border-color: #111827; }
.td-page:hover:not(.active) { border-color: rgba(0,0,0,0.25); }
.td-ellipsis { align-self: center; color: #8a8a8e; padding: 0 4px; }

.td-empty { grid-column: 1/-1; text-align: center; padding: 56px 20px; color: #6e6e73; }
.td-empty b { display: block; font-size: 18px; color: #1d1d1f; margin-bottom: 8px; }
.td-empty button { margin-top: 16px; }

/* мобильный фильтр */
.td-filter-toggle { display: none; }
@media (max-width: 768px) {
  .td-filter-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: 999px; border: 1px solid rgba(0,0,0,0.12); background: #fff; font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; }
  .catalog-sidebar.td-collapsed { display: none; }
  .td-card .product-name { font-size: 13px; -webkit-line-clamp: 4; }
  .td-card-foot .product-price { font-size: 13px; }
  .td-card .product-body { padding: 12px; }
}

/* ── карточка товара: характеристики, описание, документы ── */
.td-section { margin-top: 56px; }
.td-section h2 { font-size: 26px; font-weight: 700; letter-spacing: -0.03em; margin-bottom: 18px; }
.td-specs { width: 100%; border-collapse: collapse; background: #fff; border-radius: 18px; overflow: hidden; border: 1px solid rgba(0,0,0,0.06); font-size: 14px; }
.td-specs th, .td-specs td { padding: 11px 18px; text-align: left; vertical-align: top; border-bottom: 1px solid rgba(0,0,0,0.05); }
.td-specs th { width: 42%; font-weight: 400; color: #6e6e73; }
.td-specs td { color: #1d1d1f; word-break: break-word; }
.td-specs tr.td-group td { background: #f5f6f8; font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: #6e6e73; padding: 9px 18px; }
.td-specs tr:last-child th, .td-specs tr:last-child td { border-bottom: 0; }
.td-specs-more { margin-top: 12px; }

.td-desc { background: #fff; border-radius: 18px; border: 1px solid rgba(0,0,0,0.06); padding: 28px 32px; font-size: 15px; line-height: 1.7; color: #3a3a3c; overflow-wrap: anywhere; }
.td-desc h2, .td-desc h3, .td-desc h4 { font-size: 18px; letter-spacing: -0.01em; color: #1d1d1f; margin: 22px 0 8px; }
.td-desc > div > h2:first-child, .td-desc > h2:first-child { display: none; }
.td-desc p { margin: 0 0 10px; }
.td-desc ul, .td-desc ol { margin: 0 0 12px 20px; }
.td-desc li { margin: 4px 0; }
.td-desc img { max-width: 100%; height: auto; border-radius: 12px; margin: 10px 0; }
.td-desc table { border-collapse: collapse; margin: 12px 0; font-size: 13px; display: block; overflow-x: auto; }
.td-desc td, .td-desc th { border: 1px solid rgba(0,0,0,0.08); padding: 6px 10px; }

.td-features { list-style: none; display: grid; gap: 8px; }
.td-features li { position: relative; padding-left: 22px; font-size: 15px; line-height: 1.55; color: #3a3a3c; }
.td-features li::before { content: ''; position: absolute; left: 4px; top: 9px; width: 7px; height: 7px; border-radius: 2px; background: var(--accent, #0071e3); }

.td-docs { display: grid; gap: 8px; }
.td-doc { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 14px; background: #fff; border: 1px solid rgba(0,0,0,0.06); text-decoration: none; color: #1d1d1f; font-size: 14px; transition: border-color .2s; }
.td-doc:hover { border-color: var(--accent, #0071e3); }
.td-doc span:first-child { font-size: 10px; font-weight: 700; color: #fff; background: #d93025; border-radius: 6px; padding: 3px 6px; }

.td-kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 13px; margin: 0 0 20px; }
.td-kv dt { color: #8a8a8e; }
.td-kv dd { color: #1d1d1f; font-variant-numeric: tabular-nums; }

.td-related { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 18px; }
@media (max-width: 1024px) { .td-related { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 768px) {
  .td-desc { padding: 20px; }
  .td-specs th, .td-specs td { padding: 10px 12px; display: block; width: 100%; }
  .td-specs th { padding-bottom: 0; border-bottom: 0; font-size: 12px; }
  .td-specs tr.td-group td { padding: 8px 12px; }
  .td-related { gap: 12px; }
}

/* ── главная: разделы каталога ── */
.td-home-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.td-home-cat { display: flex; flex-direction: column; justify-content: space-between; min-height: 132px; padding: 20px 22px; border-radius: 22px; background: #fff; border: 1px solid rgba(0,0,0,0.06); text-decoration: none; color: #1d1d1f; transition: transform .2s, box-shadow .2s, border-color .2s; }
.td-home-cat:hover { transform: translateY(-3px); box-shadow: 0 16px 40px rgba(0,0,0,0.08); border-color: rgba(0,113,227,.25); }
.td-home-cat b { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.3; }
.td-home-cat small { display: block; margin-top: 6px; font-size: 12.5px; color: #6e6e73; line-height: 1.45; }
.td-home-cat span { font-size: 13px; color: var(--accent, #0071e3); font-weight: 500; margin-top: 14px; }
.td-home-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 20px; }
@media (max-width: 1024px) { .td-home-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 768px) { .td-home-grid { gap: 12px; } .td-home-cats { grid-template-columns: 1fr 1fr; gap: 10px; } .td-home-cat { min-height: 116px; padding: 16px; } .td-home-cat b { font-size: 14px; } .td-home-cat small { display: none; } }
.td-home-actions { display: flex; justify-content: center; margin-top: 28px; }
@media (max-width: 768px) { .catalog-sidebar { position: static !important; max-height: none !important; } }
@media (min-width: 1025px) and (max-width: 1280px) { .catalog-grid { grid-template-columns: repeat(3, minmax(0,1fr)) !important; } }
.td-card .product-name { overflow-wrap: anywhere; hyphens: auto; -webkit-hyphens: auto; }
@media (max-width: 768px) {
  body main { padding-left: 10px !important; padding-right: 10px !important; }
  .catalog-shell { padding: 20px 12px 24px !important; border-radius: 20px !important; }
  .catalog-grid { gap: 10px !important; }
  .td-card { border-radius: 16px !important; }
  .td-card-media img { padding: 8px; }
  .filters { width: 100%; }
  .filters .filter-select { flex: 1 1 140px; }
  .td-catalog-head .section-title { font-size: 30px; }
}
