/* Каталог/категория — стили из design/catalog.html. */
  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

  :root {
    --bg: #f5f5f5;
    --surface: #ffffff;
    --fg: #111111;
    --muted: #6b6b6b;
    --border: #e0e0e0;
    --accent: #0058a3;
    --accent-hover: #004080;
    --accent-light: #e6f0fa;
    --warning: #f5a623;
    --success: #00843d;
    --radius: 8px;
    --radius-sm: 4px;
    --font: -apple-system, BlinkMacSystemFont, 'Noto Sans', 'Segoe UI', system-ui, sans-serif;
  }

  html { font-size: 16px; scroll-behavior: smooth; }
  body { font-family: var(--font); background: var(--bg); color: var(--fg); line-height: 1.5; min-height: 100vh; display: flex; flex-direction: column; -webkit-font-smoothing: antialiased; }

  a { color: inherit; text-decoration: none; }
  button { cursor: pointer; border: none; background: none; font: inherit; }
  input, select { font: inherit; }
  img { display: block; max-width: 100%; }
  ul { list-style: none; }

  /* ─── HEADER ───────────────────────────────── */
  .header { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }
  .header-top { max-width: 1280px; margin: 0 auto; padding: 0 24px; height: 64px; display: flex; align-items: center; gap: 20px; }

  .logo { display: flex; flex-direction: column; line-height: 1; flex-shrink: 0; }
  .logo-name { font-size: 18px; font-weight: 800; letter-spacing: -0.3px; color: var(--accent); line-height: 1.1; }

  .header-search { flex: 1; max-width: 560px; position: relative; }
  .header-search input { width: 100%; height: 40px; border: 1.5px solid var(--border); border-radius: 20px; padding: 0 44px 0 16px; font-size: 14px; background: var(--bg); color: var(--fg); outline: none; transition: border-color .2s; }
  .header-search input:focus { border-color: var(--accent); background: var(--surface); }
  .header-search input::placeholder { color: var(--muted); }
  .header-search-btn { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); display: flex; align-items: center; background: none; border: none; cursor: pointer; padding: 0; }

  .header-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
  .header-icon-btn { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 10px; border-radius: var(--radius-sm); color: var(--muted); transition: color .2s, background .2s; position: relative; font-size: 10px; cursor: pointer; }
  .header-icon-btn:hover { color: var(--accent); background: var(--accent-light); }
  .cart-badge { position: absolute; top: 2px; right: 6px; background: var(--accent); color: #fff; font-size: 9px; font-weight: 700; min-width: 16px; height: 16px; border-radius: 8px; display: flex; align-items: center; justify-content: center; padding: 0 3px; }

  .hamburger { display: none; padding: 8px; border-radius: var(--radius-sm); cursor: pointer; }

  /* ─── CATEGORY NAV ─────────────────────────── */
  .cat-nav { border-top: 1px solid var(--border); }
  .cat-nav-inner { max-width: 1280px; margin: 0 auto; padding: 0 24px; display: flex; gap: 0; overflow-x: auto; scrollbar-width: none; }
  .cat-nav-inner::-webkit-scrollbar { display: none; }
  .cat-nav-inner a { white-space: nowrap; padding: 10px 16px; font-size: 14px; color: var(--muted); border-bottom: 2px solid transparent; transition: color .2s, border-color .2s; display: block; }
  .cat-nav-inner a:hover { color: var(--fg); }
  .cat-nav-inner a.active { color: var(--accent); border-bottom-color: var(--accent); }

  /* .main и .breadcrumbs — единый источник в app.css (дубли удалены, чтобы не перебивать). */

  /* ─── CATALOG LAYOUT ───────────────────────── */
  .catalog-header { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
  .catalog-header h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.5px; }
  .catalog-count { font-size: 14px; color: var(--muted); }

  .catalog-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
  .sort-select { margin-left: auto; height: 36px; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); font-size: 13px; color: var(--fg); cursor: pointer; outline: none; }
  .sort-select:focus { border-color: var(--accent); }

  .view-toggle { display: flex; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
  .view-toggle button { padding: 6px 10px; background: var(--surface); color: var(--muted); display: flex; align-items: center; transition: all .15s; }
  .view-toggle button.active { background: var(--accent); color: #fff; }
  .view-toggle button + button { border-left: 1px solid var(--border); }

  .filter-toggle-mobile { display: none; height: 36px; padding: 0 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); font-size: 13px; color: var(--fg); align-items: center; gap: 6px; }

  .catalog-body { display: grid; grid-template-columns: 260px 1fr; gap: 24px; align-items: start; }

  /* ─── FILTERS SIDEBAR ──────────────────────── */
  .filters { background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border); padding: 20px; position: sticky; top: 84px; }
  .filters-title { font-size: 16px; font-weight: 700; margin-bottom: 20px; display: flex; align-items: center; justify-content: space-between; }
  .filters-reset { font-size: 12px; color: var(--accent); cursor: pointer; font-weight: 400; }
  .filters-reset:hover { text-decoration: underline; }

  .filter-group { margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
  .filter-group:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
  .filter-group-title { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); margin-bottom: 12px; cursor: pointer; display: flex; align-items: center; justify-content: space-between; }
  .filter-group-title svg { transition: transform .2s; }
  .filter-group.collapsed .filter-group-body { display: none; }
  .filter-group.collapsed .filter-group-title svg { transform: rotate(-90deg); }

  .filter-check { display: flex; align-items: center; gap: 8px; padding: 4px 0; cursor: pointer; font-size: 14px; }
  .filter-check input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; flex-shrink: 0; }
  .filter-check-count { margin-left: auto; font-size: 12px; color: var(--muted); }

  /* Price range */
  .price-inputs { display: flex; gap: 8px; align-items: center; }
  .price-inputs input { width: 100%; height: 36px; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0 10px; font-size: 13px; text-align: center; outline: none; }
  .price-inputs input:focus { border-color: var(--accent); }
  .price-inputs span { color: var(--muted); font-size: 13px; flex-shrink: 0; }
  .price-slider { margin-top: 12px; position: relative; height: 4px; background: var(--border); border-radius: 2px; }
  .price-slider-fill { position: absolute; left: 10%; right: 30%; height: 100%; background: var(--accent); border-radius: 2px; }

  /* Color swatches */
  .color-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
  .color-swatch { width: 28px; height: 28px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; transition: border-color .15s; position: relative; }
  .color-swatch:hover, .color-swatch.active { border-color: var(--accent); }
  .color-swatch.active::after { content: ''; position: absolute; inset: 3px; border-radius: 50%; border: 2px solid var(--surface); }

  .filter-apply-btn { width: 100%; height: 40px; background: var(--accent); color: #fff; font-size: 14px; font-weight: 600; border-radius: var(--radius-sm); margin-top: 16px; transition: background .2s; }
  .filter-apply-btn:hover { background: var(--accent-hover); }

  /* Active filters tags */
  .active-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
  .active-filter-tag { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; background: var(--accent-light); color: var(--accent); font-size: 12px; font-weight: 600; border-radius: 12px; cursor: pointer; transition: background .15s; }
  .active-filter-tag:hover { background: #cce0f0; }
  .active-filter-tag svg { width: 12px; height: 12px; }

  /* ─── PRODUCT GRID ─────────────────────────── */
  .product-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .product-grid.list-view { grid-template-columns: 1fr; }

  .product-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: box-shadow .2s, border-color .2s; cursor: pointer; }
  .product-card:hover { border-color: transparent; box-shadow: 0 4px 20px rgba(0,0,0,0.08); }

  .product-card-img { aspect-ratio: 1; background: #e8e8e8; position: relative; overflow: hidden; }
  .product-card-img .placeholder-icon { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--border); }
  .product-card-badge { position: absolute; top: 8px; left: 8px; display: flex; gap: 4px; z-index: 2; }
  .badge { padding: 3px 8px; border-radius: 3px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px; }
  .badge-new { background: var(--success); color: #fff; }
  .badge-sale { background: var(--warning); color: #fff; }
  .badge-popular { background: var(--accent); color: #fff; }
  .product-card-wishlist { position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; background: var(--surface); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--muted); cursor: pointer; transition: color .15s; z-index: 2; border: 1px solid var(--border); }
  .product-card-wishlist:hover { color: #e44; }
  .product-card-wishlist.active { color: #e44; }

  .product-card-body { padding: 12px 14px 14px; }
  .product-card-name { font-size: 13px; font-weight: 600; margin-bottom: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .product-card-desc { font-size: 12px; color: var(--muted); margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
  .product-card-price { display: flex; align-items: baseline; gap: 6px; }
  .price-current { font-size: 16px; font-weight: 700; }
  .price-old { font-size: 13px; color: var(--muted); text-decoration: line-through; }
  .product-card-rating { display: flex; align-items: center; gap: 4px; margin-top: 6px; font-size: 12px; color: var(--muted); }
  .stars { color: var(--warning); letter-spacing: 1px; }

  .product-card-actions { display: flex; gap: 8px; margin-top: 10px; }
  .btn-add-cart { flex: 1; height: 36px; background: var(--accent); color: #fff; font-size: 13px; font-weight: 600; border-radius: var(--radius-sm); transition: background .2s; display: flex; align-items: center; justify-content: center; gap: 6px; }
  .btn-add-cart:hover { background: var(--accent-hover); }

  /* List view overrides */
  .list-view .product-card { display: grid; grid-template-columns: 200px 1fr; gap: 0; }
  .list-view .product-card-img { aspect-ratio: 1; }
  .list-view .product-card-body { padding: 16px 20px; display: flex; flex-direction: column; justify-content: center; }
  .list-view .product-card-name { font-size: 15px; }
  .list-view .product-card-desc { font-size: 13px; -webkit-line-clamp: 2; }
  .list-view .price-current { font-size: 18px; }

  /* ─── PAGINATION ───────────────────────────── */
  .pagination { display: flex; align-items: center; justify-content: center; gap: 4px; margin-top: 32px; }
  .pagination button { width: 36px; height: 36px; border-radius: var(--radius-sm); font-size: 14px; color: var(--fg); display: flex; align-items: center; justify-content: center; transition: all .15s; }
  .pagination button:hover { background: var(--accent-light); color: var(--accent); }
  .pagination button.active { background: var(--accent); color: #fff; }
  .pagination button.disabled { color: var(--border); pointer-events: none; }
  .pagination .dots { padding: 0 4px; color: var(--muted); }

  /* ─── FOOTER ───────────────────────────────── */
  .footer { background: #1a1a1a; color: #ccc; padding: 48px 24px 24px; margin-top: auto; }
  .footer-inner { max-width: 1280px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; }
  .footer-col-title { font-size: 14px; font-weight: 700; color: #fff; margin-bottom: 12px; text-transform: uppercase; letter-spacing: 0.5px; }
  .footer-col a { display: block; font-size: 13px; color: #999; padding: 3px 0; transition: color .2s; }
  .footer-col a:hover { color: #fff; }
  .footer-bottom { max-width: 1280px; margin: 24px auto 0; padding-top: 20px; border-top: 1px solid #333; font-size: 12px; color: #666; text-align: center; }

  /* ─── MOBILE FILTER OVERLAY ────────────────── */
  .filter-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 200; }
  .filter-overlay.open { display: block; }
  .filter-drawer { position: fixed; left: 0; bottom: 0; right: 0; max-height: 85vh; background: var(--surface); border-radius: 16px 16px 0 0; z-index: 201; transform: translateY(100%); transition: transform .3s ease; overflow-y: auto; padding: 20px 20px 32px; }
  .filter-drawer.open { transform: translateY(0); }
  .filter-drawer-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
  .filter-drawer-header h3 { font-size: 18px; font-weight: 700; }
  .filter-drawer-close { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; color: var(--muted); border-radius: 50%; background: var(--bg); }
  .filter-drawer-actions { display: flex; gap: 8px; margin-top: 16px; position: sticky; bottom: 0; background: var(--surface); padding-top: 12px; }
  .filter-drawer-actions button { flex: 1; height: 44px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600; }
  .filter-drawer-actions .btn-reset { border: 1px solid var(--border); color: var(--fg); }
  .filter-drawer-actions .btn-apply { background: var(--accent); color: #fff; }

  /* ─── RESPONSIVE ───────────────────────────── */
  @media (max-width: 1024px) {
    .catalog-body { grid-template-columns: 1fr; }
    .filters { display: none; }
    .filter-toggle-mobile { display: flex; }
    .product-grid { grid-template-columns: repeat(3, 1fr); }
  }

  @media (max-width: 768px) {
    .header-search { display: none; }
    .hamburger { display: block; }
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .product-grid.list-view { grid-template-columns: 1fr; }
    .list-view .product-card { grid-template-columns: 140px 1fr; }
    .catalog-header h1 { font-size: 22px; }
    .footer-inner { grid-template-columns: repeat(2, 1fr); }
  }

  @media (max-width: 480px) {
    .header-top { padding: 0 16px; height: 56px; }
    .logo-name { font-size: 15px; }
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .product-card-body { padding: 8px 10px 10px; }
    .product-card-name { font-size: 12px; }
    .price-current { font-size: 14px; }
    .btn-add-cart { height: 32px; font-size: 12px; }
    .pagination button { width: 32px; height: 32px; font-size: 13px; }
    .footer-inner { grid-template-columns: 1fr; }
  }

/* ── Адаптация под наши данные ── */
.product-card-img { aspect-ratio:3/4; background:var(--bg); }
.product-card-img img { width:100%; height:100%; object-fit:cover; display:block; }
.product-card-name { color:var(--fg); }
.product-card-name:hover { color:var(--accent); }
.product-card.oos { opacity:.65; }
.product-card.oos .product-card-img img { filter:grayscale(1); }
.badge-oos { background:#666; color:#fff; }
.product-card-body { display:flex; flex-direction:column; gap:8px; }
.product-card-price.muted .price-current { font-size:13px; color:var(--muted); font-weight:400; }
.catalog-title { font-size:26px; font-weight:800; letter-spacing:-.4px; margin:18px 0 4px; }
.subcats { display:flex; flex-wrap:wrap; gap:8px; margin:10px 0 4px; }
.subcat-chip { padding:6px 14px; border:1px solid var(--border); border-radius:20px; font-size:13px; color:var(--fg); background:var(--surface); transition:border-color .15s,color .15s; }
.subcat-chip:hover { border-color:var(--accent); color:var(--accent); }
.catalog-empty { padding:60px 0; text-align:center; color:var(--muted); }
.price-inputs { display:flex; align-items:center; gap:6px; }
.price-inputs input { width:100%; height:34px; border:1px solid var(--border); border-radius:var(--radius-sm); padding:0 8px; font-size:13px; outline:none; }
.price-inputs input:focus { border-color:var(--accent); }
.filter-apply-btn { width:100%; margin-top:14px; height:40px; background:var(--accent); color:#fff; border-radius:var(--radius); font-weight:600; font-size:14px; }
.filter-apply-btn:hover { background:var(--accent-hover); }

/* Сворачивание групп фильтров */
.filter-group-title { cursor:pointer; user-select:none; }
.filter-group-title svg { transition:transform .15s; }
.filter-group.collapsed .filter-group-body { display:none; }
.filter-group.collapsed .filter-group-title svg { transform:rotate(-90deg); }

/* Мобильный показ фильтров */
@media (min-width:861px){ .filter-toggle-mobile { display:none; } }
@media (max-width:860px){
  .catalog-body { display:block; }
  .filters { display:none; }
  .filters.open { display:block; margin-bottom:20px; }
  .filter-toggle-mobile { display:inline-flex; align-items:center; gap:6px; }
}

/* Плитки категорий (страница /catalog) */
.cat-tiles { display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:16px; margin-top:10px; }
.cat-tile { position:relative; display:flex; aspect-ratio:4/3; border-radius:var(--radius); overflow:hidden; background:var(--bg); border:1px solid var(--border); transition:box-shadow .2s,border-color .2s; }
.cat-tile:hover { border-color:transparent; box-shadow:0 6px 24px rgba(0,0,0,.1); }
.cat-tile img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; transition:transform .4s; }
.cat-tile:hover img { transform:scale(1.05); }
.cat-tile-overlay { position:absolute; inset:0; background:linear-gradient(to top,rgba(0,0,0,.62),rgba(0,0,0,.05) 55%,transparent); }
.cat-tile-cap { position:relative; margin-top:auto; padding:14px 16px; width:100%; }
.cat-tile-name { font-weight:700; font-size:16px; line-height:1.2; color:#fff; }
.cat-tile-count { font-size:12px; color:rgba(255,255,255,.85); margin-top:2px; }
.cat-tile.noimg .cat-tile-name { color:var(--fg); }
.cat-tile.noimg .cat-tile-count { color:var(--muted); }
.cat-tile-ph { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; color:var(--border); }

/* ── Поиск / избранное (пустые состояния, бренд, пагинация) ── */
.cart-empty { text-align:center; padding:70px 20px; color:var(--muted); }
.cart-empty svg { margin:0 auto 14px; display:block; }
.cart-empty p { font-size:15px; margin-bottom:20px; }
.search-summary { font-size:14px; color:var(--muted); margin:-4px 0 20px; }
.search-summary strong { color:var(--fg); font-weight:600; }
.product-card-brand { font-size:10px; letter-spacing:.04em; text-transform:uppercase; color:var(--muted); margin-bottom:3px; }
.card-img-link { display:block; width:100%; height:100%; }
.pagination { display:flex; justify-content:center; gap:6px; margin-top:32px; flex-wrap:wrap; }
.page-link { min-width:34px; height:34px; display:inline-flex; align-items:center; justify-content:center; padding:0 8px; border-radius:var(--radius-sm); font-size:13px; color:var(--muted); transition:background .15s,color .15s; }
.page-link:hover { background:var(--accent-light); color:var(--accent); }
.page-link.active { background:var(--accent); color:#fff; }

/* ── Главная: преимущества + карусели подборок ── */
.advantages { display:grid; grid-template-columns:repeat(4,1fr); gap:16px; margin:6px 0 38px; }
.adv-item { display:flex; align-items:center; gap:13px; padding:16px 18px; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); }
.adv-item svg { width:30px; height:30px; color:var(--accent); flex:0 0 auto; }
.adv-title { font-size:14px; font-weight:700; line-height:1.2; }
.adv-sub { font-size:12px; color:var(--muted); margin-top:2px; }
@media (max-width:900px) { .advantages { grid-template-columns:repeat(2,1fr); } }
@media (max-width:480px) { .advantages { grid-template-columns:1fr; } }

.prod-scroll { display:flex; gap:16px; overflow-x:auto; padding-bottom:10px; scroll-snap-type:x proximity; -webkit-overflow-scrolling:touch; }
.prod-scroll > .product-card { flex:0 0 220px; scroll-snap-align:start; }
.prod-scroll::-webkit-scrollbar { height:7px; }
.prod-scroll::-webkit-scrollbar-thumb { background:var(--border); border-radius:4px; }
@media (max-width:640px) { .prod-scroll > .product-card { flex-basis:165px; } }

/* Кнопка «убрать из избранного» (мусорка) на странице /wishlist */
.wish-remove-btn { color: var(--muted); }
.wish-remove-btn:hover { color: #e44; background: #fef2f2; }

/* ── Swiper-карусель «Хиты продаж» на главной ── */
.hits-swiper { --swiper-navigation-size: 20px; --swiper-navigation-color: var(--accent); padding: 2px 0 10px; }
.hits-swiper .swiper-slide { width: 220px; height: auto; }
.hits-swiper .swiper-button-prev, .hits-swiper .swiper-button-next { width: 38px; height: 38px; border-radius: 50%; background: var(--surface); box-shadow: 0 2px 12px rgba(0,0,0,.14); top: 38%; }
.hits-swiper .swiper-button-disabled { opacity: 0; }
@media (max-width: 640px) { .hits-swiper .swiper-slide { width: 165px; } .hits-swiper .swiper-button-prev, .hits-swiper .swiper-button-next { display: none; } }

/* ── Двойной range-slider цены ── */
.price-range { position: relative; height: 28px; margin-bottom: 14px; }
.price-range-track { position: absolute; top: 12px; left: 0; right: 0; height: 4px; background: var(--border); border-radius: 2px; }
.price-range-fill { position: absolute; top: 0; bottom: 0; background: var(--accent); border-radius: 2px; }
.price-range-input { position: absolute; top: 6px; left: 0; width: 100%; height: 16px; margin: 0; background: none; pointer-events: none; -webkit-appearance: none; appearance: none; }
.price-range-input::-webkit-slider-thumb { pointer-events: auto; -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--accent); border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.3); cursor: pointer; }
.price-range-input::-moz-range-thumb { pointer-events: auto; width: 16px; height: 16px; border-radius: 50%; background: var(--accent); border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.3); cursor: pointer; }

/* ── Full-width сетки (избранное / поиск / акции) — больше колонок, меньше карточки ── */
.product-grid-wide { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 1100px) { .product-grid-wide { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 820px)  { .product-grid-wide { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 520px)  { .product-grid-wide { grid-template-columns: repeat(2, 1fr); } }
