/* ═══════════════════════════════════════════════════════════════
   ЛабраДОРС · Каталог — слой поверх studio.css
   Приводит каталог/фильтры/карточки к эстетике главной (AI Door Studio).
   Подключается ПОСЛЕ css/studio.css. Классы/ID не меняются — JS цел.
═══════════════════════════════════════════════════════════════ */

/* Фиксированная шапка → отступ под контент */
body { padding-top: var(--nav-h); }

/* Активный пункт меню (каталог использует .active, а не --active) */
.nav__link.active { color: var(--text); font-weight: 600; }

/* ── Шапка: иконки-действия (поиск/избранное/корзина) ─────────── */
.nav__actions .icon-btn {
  position: relative;
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r-full);
  color: var(--text);
  transition: background .2s var(--ease), color .2s var(--ease);
}
.nav__actions .icon-btn:hover { background: rgba(0,0,0,.05); color: var(--accent-dark); }
.nav__actions .icon-btn svg { width: 20px; height: 20px; }
.cart-badge {
  position: absolute; top: 2px; right: 2px;
  min-width: 17px; height: 17px; padding: 0 4px;
  display: none; align-items: center; justify-content: center;
  background: var(--accent); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 1;
  border-radius: var(--r-full);
}
.cart-badge.visible { display: inline-flex; }

/* ── Выпадающая строка поиска в шапке ─────────────────────────── */
.search-bar {
  position: fixed; top: var(--nav-h); left: 0; right: 0; z-index: 99;
  background: rgba(250,250,248,.92);
  backdrop-filter: blur(20px) saturate(1.8);
  -webkit-backdrop-filter: blur(20px) saturate(1.8);
  border-bottom: 1px solid var(--border);
  max-height: 0; overflow: hidden;
  transition: max-height .3s var(--ease), padding .3s var(--ease);
  padding: 0 0;
}
.search-bar.open { max-height: 80px; padding: var(--sp-4) 0; }
.search-inner {
  display: flex; align-items: center; gap: var(--sp-3);
  background: var(--white);
  border: 1px solid var(--border-dark);
  border-radius: var(--r-full);
  padding: 10px 16px;
}
.search-inner .search-icon { color: var(--text-light); flex-shrink: 0; }
.search-inner input {
  flex: 1; border: none; outline: none; background: none;
  font-family: inherit; font-size: 15px; color: var(--text);
}

/* ── Хлебные крошки ───────────────────────────────────────────── */
.breadcrumb {
  display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-2);
  padding: var(--sp-6) 0 0;
  font-size: 13px; color: var(--text-muted);
}
.breadcrumb a { color: var(--text-muted); transition: color .2s var(--ease); }
.breadcrumb a:hover { color: var(--accent-dark); }
.breadcrumb-sep { color: var(--text-light); }

/* ── Заголовок каталога ───────────────────────────────────────── */
.catalog-hero {
  display: flex; align-items: flex-end; justify-content: space-between;
  flex-wrap: wrap; gap: var(--sp-6);
  padding-top: var(--sp-8); padding-bottom: var(--sp-8);
}
.catalog-hero__text h1,
h1.display {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 500;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.05; letter-spacing: -.02em;
  color: var(--text);
}
.catalog-hero__text p { margin-top: var(--sp-3); font-size: 15px; }

/* Фильтр по стилю (сайдбар) */
.style-filters { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.style-chip {
  padding: 7px 13px;
  border: 1px solid var(--border-dark);
  border-radius: var(--r-full);
  background: var(--white);
  font-size: 13px; color: var(--text-muted);
  transition: all .2s var(--ease);
}
.style-chip:hover { border-color: var(--text); color: var(--text); }
.style-chip.active { background: var(--text); color: #fff; border-color: var(--text); }

/* Быстрые фильтры-пилюли */
.quick-filters { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.qfilter {
  padding: 9px 20px;
  border: 1px solid var(--border-dark);
  border-radius: var(--r-full);
  background: var(--white);
  font-size: 14px; font-weight: 500; color: var(--text-muted);
  transition: all .2s var(--ease);
}
.qfilter:hover { border-color: var(--text); color: var(--text); }
.qfilter.active {
  background: var(--text); color: var(--white); border-color: var(--text);
}

/* ── Раскладка: сайдбар + сетка ───────────────────────────────── */
.catalog-layout {
  display: grid;
  grid-template-columns: 268px 1fr;
  gap: var(--sp-10);
  align-items: start;
  padding-bottom: var(--sp-24);
}

/* ── Сайдбар-фильтры ──────────────────────────────────────────── */
.catalog-sidebar {
  position: sticky; top: calc(var(--nav-h) + var(--sp-6));
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-6);
  box-shadow: var(--shadow-sm);
}
.sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: var(--sp-4);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--sp-5);
}
.sidebar-header .h5, h2.h5, h3.h5 {
  font-size: 16px; font-weight: 600; letter-spacing: -.01em; color: var(--text);
}
.filter-group { margin-bottom: var(--sp-6); }
.filter-group__title {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text-light);
  margin-bottom: var(--sp-3);
}
.price-inputs {
  display: flex; align-items: center; gap: var(--sp-2);
  margin-bottom: var(--sp-3);
}
.price-inputs span { color: var(--text-light); }
.form-control {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-dark);
  border-radius: var(--r-sm);
  background: var(--white);
  font-family: inherit; font-size: 14px; color: var(--text);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.form-control:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}
.price-presets { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.price-preset {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  background: var(--bg-section);
  font-size: 12px; color: var(--text-muted);
  transition: all .2s var(--ease);
}
.price-preset:hover, .price-preset.active {
  background: var(--accent-light); border-color: var(--accent); color: var(--accent-dark);
}
.sidebar-cta {
  margin-top: var(--sp-6); padding-top: var(--sp-5);
  border-top: 1px solid var(--border);
  text-align: center;
}
.sidebar-cta p { font-size: 14px; color: var(--text-muted); }

/* ── Тулбар ───────────────────────────────────────────────────── */
.catalog-main { min-width: 0; }
.catalog-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: var(--sp-3);
  margin-bottom: var(--sp-6);
}
.catalog-count { font-size: 14px; color: var(--text-muted); }
.catalog-count strong { color: var(--text); font-weight: 600; }
.toolbar-right { display: flex; align-items: center; gap: var(--sp-3); }
.sort-select { width: auto; min-width: 190px; cursor: pointer; }
.filter-mobile-btn { display: none; }

/* ── Сетка товаров ────────────────────────────────────────────── */
.products-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-6);
}

/* ── Карточка товара ──────────────────────────────────────────── */
.product-card {
  display: flex; flex-direction: column;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s var(--ease);
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-dark);
}
.product-card__img-link { display: block; }
.product-card__img {
  position: relative;
  aspect-ratio: 3 / 4;
  background: var(--bg-section);
  overflow: hidden;
}
.product-card__img img, .pcard-img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .5s var(--ease);
}
.product-card:hover .product-card__img img { transform: scale(1.04); }

.product-card__badge {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  padding: 5px 11px;
  border-radius: var(--r-full);
  font-size: 11px; font-weight: 600; letter-spacing: .02em;
  color: #fff;
  backdrop-filter: blur(4px);
}
.badge-new   { background: var(--text); }
.badge-order { background: var(--accent-dark); }
.badge-sale  { background: #c0392b; }

.product-card__actions {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  display: flex; flex-direction: column; gap: var(--sp-2);
  opacity: 0; transform: translateX(8px);
  transition: opacity .25s var(--ease), transform .25s var(--ease);
}
.product-card:hover .product-card__actions { opacity: 1; transform: none; }
.product-card__actions .icon-btn {
  width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.92);
  border-radius: var(--r-full);
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: background .2s var(--ease), color .2s var(--ease);
}
.product-card__actions .icon-btn:hover { background: var(--accent); color: #fff; }

.product-card__body {
  display: flex; flex-direction: column;
  padding: var(--sp-5) var(--sp-5) 0;
  flex: 1;
}
.product-card__category {
  font-size: 11px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--text-light); margin-bottom: var(--sp-2);
}
.product-card__name {
  font-size: 16px; font-weight: 600; line-height: 1.35; letter-spacing: -.01em;
  margin-bottom: var(--sp-3);
}
.product-card__name a { color: var(--text); transition: color .2s var(--ease); }
.product-card__name a:hover { color: var(--accent-dark); }
.product-card__price {
  margin-top: auto;
  display: flex; align-items: baseline; gap: var(--sp-2); flex-wrap: wrap;
}
.price-current { font-size: 18px; font-weight: 700; color: var(--text); letter-spacing: -.01em; }
.price-current.price-sale { color: #c0392b; }
.price-old { font-size: 13px; color: var(--text-light); text-decoration: line-through; }

.product-card__footer { padding: var(--sp-4) var(--sp-5) var(--sp-5); }

/* ── Кнопки карточек (старые имена .btn-primary/.btn-outline) ──── */
.btn-primary {
  background: var(--text); color: var(--white);
}
.btn-primary:hover { background: #2a2a2a; box-shadow: 0 4px 16px rgba(0,0,0,.2); transform: translateY(-1px); }
.btn-outline {
  background: var(--white); color: var(--text);
  border: 1px solid var(--border-dark);
}
.btn-outline:hover { border-color: var(--text); background: rgba(0,0,0,.03); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-dark); box-shadow: 0 4px 16px rgba(199,162,106,.4); transform: translateY(-1px); }
.btn-ghost {
  background: none; color: var(--text-muted);
  padding: 6px 10px; font-size: 13px; font-weight: 500;
  border-radius: var(--r-sm);
  transition: color .2s var(--ease), background .2s var(--ease);
}
.btn-ghost:hover { color: var(--text); background: rgba(0,0,0,.04); }
.btn-sm { padding: 9px 18px; font-size: 13px; }

/* ── Пустой результат ─────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: var(--sp-20) var(--sp-6);
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--r-lg);
}
.empty-state.hidden { display: none; }
.empty-state__icon { font-size: 48px; margin-bottom: var(--sp-4); }
.empty-state h3 { font-size: 20px; font-weight: 600; margin-bottom: var(--sp-2); }
.empty-state p { color: var(--text-muted); }

/* ── Пагинация ────────────────────────────────────────────────── */
.pagination {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
  gap: var(--sp-2); margin-top: var(--sp-12);
}
.page-btn, .page-dots {
  min-width: 42px; height: 42px; padding: 0 12px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r-full);
  font-size: 14px; font-weight: 500; color: var(--text);
}
.page-btn {
  border: 1px solid var(--border-dark);
  background: var(--white);
  transition: all .2s var(--ease);
}
.page-btn:hover:not(:disabled):not(.active) { border-color: var(--text); }
.page-btn.active { background: var(--text); color: var(--white); border-color: var(--text); }
.page-btn:disabled { opacity: .4; cursor: not-allowed; }
.page-dots { color: var(--text-light); }

/* ── SEO-блок ─────────────────────────────────────────────────── */
.catalog-seo { background: var(--bg-section); }
.seo-text-grid {
  display: grid; grid-template-columns: 2fr 1fr; gap: var(--sp-12);
}
.seo-text-main h2, h2.h3 {
  font-family: 'Playfair Display', Georgia, serif; font-weight: 500;
  font-size: clamp(24px, 3vw, 34px); line-height: 1.15; letter-spacing: -.015em;
  margin-bottom: var(--sp-5);
}
.seo-text-main p { color: var(--text-muted); font-size: 15px; line-height: 1.7; }
.seo-text-main strong { color: var(--text); font-weight: 600; }
.seo-link { color: var(--accent-dark); border-bottom: 1px solid var(--accent-light); transition: border-color .2s; }
.seo-link:hover { border-color: var(--accent); }
.seo-text-links .h5 { margin-bottom: var(--sp-4); }
.seo-links-list { display: flex; flex-direction: column; gap: var(--sp-3); }
.seo-links-list a {
  color: var(--text-muted); font-size: 14px;
  transition: color .2s var(--ease);
  border-bottom: 1px solid transparent; padding-bottom: 2px;
}
.seo-links-list a:hover { color: var(--accent-dark); }

/* ── Тосты ────────────────────────────────────────────────────── */
.toast-container {
  position: fixed; bottom: var(--sp-6); right: var(--sp-6); z-index: 200;
  display: flex; flex-direction: column; gap: var(--sp-3);
}
.toast {
  display: flex; align-items: center; gap: var(--sp-3);
  background: var(--text); color: var(--white);
  padding: 14px 18px; border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  font-size: 14px; max-width: 340px;
  animation: toastIn .3s var(--ease-spring) both;
}
.toast-success { background: #1f7a44; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ── Оверлей мобильного сайдбара ──────────────────────────────── */
.sidebar-overlay {
  position: fixed; inset: 0; z-index: 150;
  background: rgba(0,0,0,.4);
  opacity: 0; visibility: hidden;
  transition: opacity .3s var(--ease), visibility .3s var(--ease);
}
.sidebar-overlay.visible { opacity: 1; visibility: visible; }

/* ── Адаптив ──────────────────────────────────────────────────── */
/* У каталога в шапке больше элементов, чем на главной → бургер раньше */
@media (max-width: 980px) {
  .nav__links { display: none; }
  .nav__burger { display: flex; }
  .nav__actions .btn--accent { display: none; } /* CTA → в мобильном меню; иконки остаются */
}

@media (max-width: 1024px) {
  .products-grid { grid-template-columns: repeat(2, 1fr); }
  .seo-text-grid { grid-template-columns: 1fr; gap: var(--sp-8); }
}

@media (max-width: 860px) {
  .catalog-layout { grid-template-columns: 1fr; }
  .filter-mobile-btn { display: inline-flex; }
  .catalog-sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 160;
    width: min(86vw, 340px);
    border-radius: 0; border: none;
    transform: translateX(-100%);
    transition: transform .35s var(--ease);
    overflow-y: auto;
  }
  .catalog-sidebar.open { transform: none; }
}

@media (max-width: 560px) {
  /* В шапке оставляем корзину + бургер, чтобы влезло на узких экранах */
  .nav__actions .icon-btn[aria-label="Поиск"],
  .nav__actions .icon-btn[aria-label="Избранное"] { display: none; }
  .products-grid { grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
  .product-card__body { padding: var(--sp-4) var(--sp-4) 0; }
  .product-card__footer { padding: var(--sp-3) var(--sp-4) var(--sp-4); }
  .product-card__name { font-size: 14px; }
  .price-current { font-size: 16px; }
  .catalog-hero { padding-bottom: var(--sp-6); }
  .toolbar-right .sort-select { min-width: 150px; }
}
