/* ==========================================================================
   Dream Lashes — glue-слой каталога (зона C).
   Маппинг WooCommerce-маркапа на классы макета catalog.html / brands.html.
   Базовые классы (.card, .cat-grid, .filters, .fgroup, .szgrid, .pagination,
   .brand-hub, .bcard) описаны в theme.css. Здесь только связки и правки Woo.
   ========================================================================== */

/* Сетка товаров: WooCommerce-класс .products рядом с .cat-grid не ломает верстку. */
.cat-grid.products { list-style: none; margin: 0; padding: 0; }
.cat-grid .card { margin: 0; }
.cat-column .card .ph {
	background: #fff;
}
.cat-column .card .ph img {
	object-fit: contain;
	object-position: center;
	padding: 8%;
	background: #fff;
	mix-blend-mode: normal;
}

/* Карточка: цена из get_price_html() -> вид .price/.old макета. */
.card .price { display: inline-flex; align-items: baseline; flex-wrap: wrap; gap: 0 2px; }
.card .price del,
.card .price ins { text-decoration: none; }
.card .price del {
	font-family: var(--sans);
	font-size: 13px;
	color: var(--ink-faint);
	text-decoration: line-through;
	margin-right: 8px;
	font-weight: 500;
	order: -1;
}
.card .price ins { background: none; color: inherit; }
.card .price .woocommerce-Price-currencySymbol {
	font-family: var(--sans);
	font-size: 12px;
	font-weight: 600;
	color: var(--ink-soft);
	text-decoration: none;
	margin-left: 3px;
}
.card .price .woocommerce-Price-amount { white-space: nowrap; }

/* Вариативная подпись под названием. */
.card .card-variated {
	font-size: 12px;
	color: var(--ink-faint);
	margin: -8px 0 12px;
	font-weight: 600;
	letter-spacing: .01em;
}

/* Кнопка .add как ссылка/кнопка AJAX add-to-cart. */
.card .add { text-decoration: none; }
.card .add.loading { opacity: .6; pointer-events: none; }
/* Ссылку «Просмотреть корзину», добавляемую Woo после AJAX, в карточке прячем (есть тост). */
.card .foot .added_to_cart { display: none !important; }

/* Сортировка: нативная форма woocommerce-ordering внутри .select макета. */
.sortbar .woocommerce-ordering { margin: 0; }
.sortbar .select select { margin: 0; }
.sortbar { flex-wrap: wrap; justify-content: flex-end; }
.dl-per-page-field {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: var(--ink-soft);
	font-size: 12px;
	font-weight: 800;
	white-space: nowrap;
}
.dl-per-page-select select {
	min-width: 88px;
	padding-left: 12px;
	padding-right: 34px;
	font-variant-numeric: tabular-nums;
}

/* Тулбар: активные фильтры — ссылки удаления в стиле макета (.afilter button). */
.active-filters .afilter a {
	background: none;
	border: none;
	cursor: pointer;
	width: 18px;
	height: 18px;
	display: grid;
	place-items: center;
	border-radius: 50%;
	color: inherit;
	text-decoration: none;
	transition: background .18s, color .18s;
}
.active-filters .afilter a:hover { background: var(--wine); color: #fff; }
.active-filters .afilter a svg { width: 11px; height: 11px; stroke: currentColor; stroke-width: 2.4; fill: none; }

/* Фолбэк-фасеты: ссылка-«чекбокс» (.dl-facet-link) вместо label.check + input. */
.filters .dl-facet-link {
	text-decoration: none;
	position: relative;
	padding-left: 28px;
}
.filters .dl-facet-link::before {
	content: "";
	position: absolute;
	left: 0;
	top: 50%;
	transform: translateY(-50%);
	width: 18px;
	height: 18px;
	border: 1.5px solid var(--line);
	border-radius: 5px;
	background: #fff;
	transition: .15s;
}
.filters .dl-facet-link.is-active::before { background: var(--wine); border-color: var(--wine); }
.filters .dl-facet-link.is-active::after {
	content: "";
	position: absolute;
	left: 6px;
	top: 50%;
	width: 5px;
	height: 9px;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	transform: translateY(-70%) rotate(45deg);
}
.filters .dl-facet-link.is-active { color: var(--ink); }

/* Кнопка «Показать товары» в фолбэк-форме. */
.filters .dl-filter-actions { padding: 16px 0; }

/* Заголовок фасетов (виден только когда .filters работает как мобильный drawer). */
.dl-filters-head {
	display: none;
	align-items: center;
	justify-content: space-between;
	padding: 18px 0 12px;
	border-bottom: 1px solid var(--line);
	margin-bottom: 6px;
}
.dl-filters-head strong { font-family: var(--serif); font-size: 20px; font-weight: 600; }
.dl-filters-head .close {
	width: 38px;
	height: 38px;
	border-radius: 10px;
	border: 1px solid var(--line);
	background: #fff;
	display: grid;
	place-items: center;
	cursor: pointer;
}
.dl-filters-head .close svg { width: 18px; height: 18px; stroke: var(--ink); stroke-width: 2; fill: none; }

/* Низ каталога: пагинация/«Показать ещё» + селектор количества на странице. */
.cat-foot {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 22px;
	margin-top: 46px;
}
.cat-foot .dl-pagination-wrap { margin-top: 0; }
.cat-foot .dl-per-page-form { display: flex; justify-content: center; margin: 0; }

/* Пагинация из paginate_links() + lazy-load кнопка каталога. */
.dl-pagination-wrap {
	display: grid;
	justify-items: center;
	gap: 16px;
	margin-top: 46px;
}
.dl-pagination-wrap .pagination { margin: 0; }
.dl-pagination-wrap .pagination .nav-links,
.dl-pagination-wrap .woocommerce-pagination ul,
.dl-pagination-wrap.woocommerce nav.woocommerce-pagination ul { margin: 0; }
.pagination .page-numbers {
	min-width: 42px;
	height: 42px;
	padding: 0 6px;
	display: grid;
	place-items: center;
	border: 1px solid var(--line);
	border-radius: 12px;
	font-weight: 700;
	font-size: 14px;
	color: var(--ink);
	text-decoration: none;
	transition: border-color .2s, color .2s, background .2s, transform .2s, box-shadow .2s;
	background: rgba(255, 253, 249, .78);
	box-shadow: 0 1px 0 rgba(255, 255, 255, .78) inset, 0 16px 28px -26px rgba(74, 20, 32, .32);
}
.pagination a.page-numbers:hover { border-color: var(--wine); color: var(--wine); transform: translateY(-1px); }
.pagination a.page-numbers:focus-visible,
.dl-load-more-btn:focus-visible { outline: 2px solid rgba(122, 32, 53, .32); outline-offset: 3px; }
.pagination .page-numbers.current { background: var(--wine); color: #fff; border-color: var(--wine); box-shadow: 0 18px 34px -24px rgba(74, 20, 32, .72); }
.pagination .page-numbers.dots { border: none; background: none; box-shadow: none; pointer-events: none; }
.pagination .nav-arrow { display: grid; place-items: center; }
.pagination .nav-arrow svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 2; fill: none; }
/* Стрелки постранички — из глифа 'chev' (шеврон вниз): поворачиваем в ‹ / ›.
   Классы .prev/.next стоят на том же span, что и .nav-arrow. */
.pagination .nav-arrow.prev svg { transform: rotate(90deg); }
.pagination .nav-arrow.next svg { transform: rotate(-90deg); }
.dl-load-more {
	display: grid;
	justify-items: center;
	gap: 9px;
}
.dl-load-more[hidden] { display: none; }
.dl-load-more-btn {
	min-width: min(280px, calc(100vw - 32px));
	justify-content: center;
	gap: 12px;
	box-shadow: 0 22px 44px -30px rgba(74, 20, 32, .62);
}
.dl-load-more-label { line-height: 1; }
.dl-load-more-meta {
	padding-left: 12px;
	border-left: 1px solid rgba(255, 255, 255, .34);
	font-size: 12px;
	font-weight: 800;
	font-variant-numeric: tabular-nums;
	opacity: .78;
}
.dl-load-more-btn.is-loading { pointer-events: none; }
.dl-load-more-btn.is-loading::before {
	content: "";
	width: 15px;
	height: 15px;
	border: 2px solid rgba(255, 255, 255, .48);
	border-top-color: #fff;
	border-radius: 50%;
	animation: dl-spin .72s linear infinite;
}
.dl-load-status {
	min-height: 18px;
	margin: 0;
	color: var(--ink-soft);
	font-size: 13px;
	font-weight: 600;
	text-align: center;
}
.cat-grid .card.dl-card-enter {
	opacity: 0;
	transform: translateY(18px);
	transition: opacity .32s ease, transform .32s ease;
	transition-delay: calc(var(--dl-enter-index, 0) * 35ms);
}
.cat-grid .card.dl-card-enter.is-visible {
	opacity: 1;
	transform: none;
}
@keyframes dl-spin {
	to { transform: rotate(360deg); }
}

/* Пустое состояние каталога. */
.dl-empty {
	grid-column: 1 / -1;
	text-align: center;
	padding: 60px 24px 72px;
	background: rgba(255, 253, 249, .7);
	border: 1px solid rgba(225, 210, 191, .74);
	border-radius: 22px;
	box-shadow: 0 24px 52px -44px rgba(74, 20, 32, .3);
}
.dl-empty .dl-empty-mark {
	width: 66px;
	height: 66px;
	border-radius: 50%;
	background: var(--panel-2);
	display: grid;
	place-items: center;
	margin: 0 auto 18px;
}
.dl-empty .dl-empty-mark svg { width: 28px; height: 28px; stroke: var(--wine); stroke-width: 1.6; fill: none; }
.dl-empty h3 { font-size: clamp(22px, 3vw, 30px); margin-bottom: 8px; }
.dl-empty p { color: var(--ink-soft); max-width: 46ch; margin: 0 auto 20px; }

/* Шапка бренда (taxonomy-product_brand). */
.brand-head .brand-head-top {
	display: flex;
	align-items: center;
	gap: 22px;
	flex-wrap: wrap;
}
.brand-head .blogo {
	flex: none;
	min-width: 120px;
	min-height: 84px;
	padding: 14px 20px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #fff;
	border: 1px solid rgba(225, 210, 191, .8);
	border-radius: 16px;
	box-shadow: var(--shadow-sm);
}
.brand-head .blogo img { max-height: 66px; max-width: 160px; object-fit: contain; }
.brand-head .blogo.wordmark { font-family: var(--serif); font-size: 26px; font-weight: 600; color: var(--ink); }
.brand-head .brand-head-title h1 { margin: 4px 0 6px; }
.brand-head > p { margin-top: 16px; color: var(--ink-soft); max-width: 62ch; }

/* Брендов на выбранную букву нет. */
.dl-brands-none { grid-column: 1 / -1; color: var(--ink-soft); padding: 20px 0; }

/* Активная буква alpha-bar (brands.html) — в духе .sz.on/чипов (в макете .on нет). */
.alpha-bar a.on {
	background: var(--wine);
	border-color: var(--wine);
	color: #fff;
}

/* Мобильный режим: .filters становится drawer'ом (макет: ≤960px) — показываем шапку с закрытием. */
@media (max-width: 960px) {
	.dl-filters-head { display: flex; }
	.sortbar { width: 100%; justify-content: flex-start; gap: 10px; }
	.dl-per-page-field { flex: none; }
	.dl-pagination-wrap { gap: 14px; margin-top: 34px; }
	.pagination .page-numbers { min-width: 38px; height: 38px; font-size: 13px; border-radius: 11px; }
}

/* Длинные списки значений фасета (30+ цветов) — прокрутка внутри группы,
   чтобы сайдбар не вылезал ниже сетки товаров. */
.filters .fbody-scroll { max-height: 300px; overflow-y: auto; overscroll-behavior: contain; padding-right: 6px; scrollbar-width: thin; }
