/* === ЭТАП 2: Магазин (page-shop.php) === */

/* --- Категории магазина --- */
.stl2-shop-categories-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 16px;
}
.stl2-shop-category-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 20px 16px;
	background: #fff;
	border: 1px solid var(--stl2-border);
	border-radius: 12px;
	text-decoration: none;
	color: #1a1a1a;
	text-align: center;
	transition: box-shadow .2s;
}
.stl2-shop-category-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); }
.stl2-shop-category-card__icon {
	width: 80px; height: 80px;
	background: #f5f5f5 center/cover;
	border-radius: 10px;
	display: flex; align-items: center; justify-content: center;
	margin-bottom: 12px;
	font-size: 32px; color: #F34423;
}
.stl2-shop-category-card strong {
	font-size: 13px; font-weight: 700; font-family: Montserrat, sans-serif; line-height: 1.4;
}

/* --- Layout: сайдбар + контент --- */
.stl2-shop-layout {
	display: grid;
	grid-template-columns: 280px 1fr;
	gap: 32px;
	align-items: start;
}
.stl2-shop-sidebar {
	background: #fff;
	border: 1px solid var(--stl2-border);
	border-radius: 14px;
	padding: 20px;
}

/* --- Поиск по артикулу --- */
.stl2-shop-search { display: flex; gap: 10px; margin-bottom: 20px; }
.stl2-shop-search__input {
	flex: 1;
	padding: 10px 16px;
	border: 1px solid var(--stl2-border);
	border-radius: 8px;
	font-family: Montserrat, sans-serif;
	font-size: 14px;
}

/* --- Тулбар --- */
.stl2-shop-toolbar {
	display: flex; align-items: center; justify-content: space-between;
	margin-bottom: 20px; font-family: Montserrat, sans-serif;
}
.stl2-shop-toolbar__count { font-size: 13px; color: var(--stl2-text-muted); }

/* --- Сетка товаров --- */
.stl2-shop-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 20px;
}
.stl2-product-card {
	background: #fff;
	border: 1px solid var(--stl2-border);
	border-radius: 10px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	transition: box-shadow .2s;
}
.stl2-product-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); }
.stl2-product-card__img {
	display: flex; align-items: center; justify-content: center;
	height: 160px; background: #fff center/contain no-repeat; /* stl2-product-img-white-bg */
	color: rgba(0,0,0,.1); font-size: 40px;
}
.stl2-product-card__body { padding: 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.stl2-product-card__name {
	font-size: 13px; font-weight: 600; color: #1a1a1a; text-decoration: none;
	font-family: Montserrat, sans-serif; line-height: 1.4;
}
.stl2-product-card__name:hover { color: #F34423; }
.stl2-product-card__meta { display: flex; flex-direction: column; gap: 2px; }
.stl2-product-card__meta span { font-size: 11px; color: var(--stl2-text-muted); font-family: Montserrat, sans-serif; }
.stl2-product-card__price { font-size: 18px; font-weight: 800; color: #F34423; font-family: Montserrat, sans-serif; }
.stl2-product-card__min { font-size: 11px; color: #9ca3af; }
.stl2-product-card__actions { display: flex; flex-direction: row; align-items: center; gap: 8px; margin-top: auto; padding: 0 16px 16px; }
.stl2-product-card__actions .stl2-btn { flex: 1 1 auto; padding: 9px 6px; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stl2-product-card__actions .stl2-btn i { display: none; }
.stl2-stepper { width: 120px; flex-shrink: 0; }

/* --- Степпер количества --- */
.stl2-stepper { display: flex; align-items: center; border: 1px solid var(--stl2-border); border-radius: 8px; overflow: hidden; }
.stl2-stepper__btn { background: #f5f5f5; border: none; width: 32px; height: 32px; cursor: pointer; font-size: 16px; color: #444; flex-shrink: 0; }
.stl2-stepper__input { flex: 1; min-width: 0; border: none; text-align: center; font-family: Montserrat, sans-serif; font-size: 13px; -moz-appearance: textfield; }
.stl2-stepper__input::-webkit-outer-spin-button,
.stl2-stepper__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* --- Пагинация --- */
.stl2-pagination { display: flex; gap: 8px; margin-top: 32px; flex-wrap: wrap; }
.stl2-pagination .page-numbers {
	display: flex; align-items: center; justify-content: center;
	width: 36px; height: 36px; border: 1px solid var(--stl2-border); border-radius: 8px;
	font-size: 13px; font-weight: 600; color: #444; text-decoration: none;
	font-family: Montserrat, sans-serif;
}
.stl2-pagination .page-numbers.current,
.stl2-pagination .page-numbers:hover { background: #F34423; border-color: #F34423; color: #fff; }
.stl2-pagination .page-numbers.dots { border: none; }

/* --- Filter Everything PRO: переодеваем wpc-* классы --- */
.wpc-filters-section {
	background: transparent !important;
	border: none !important;
	border-radius: 0 !important;
	padding: 0 0 20px !important;
	margin-bottom: 20px;
	border-bottom: 1px solid var(--stl2-border) !important;
}
.wpc-filters-section:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.wpc-filters-main-wrap, .wpc-filters-main-wrap * { font-family: Montserrat, sans-serif !important; }
.wpc-filters-open-button-container { display: none; }
.wpc-filter-header .widget-title,
.wpc-filter-title {
	font-size: 13px; font-weight: 700; color: #1a1a1a; text-transform: none;
	margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--stl2-border);
}
.wpc-filters-section { margin-bottom: 20px; }
.wpc-filters-ul-list { list-style: none; margin: 0; padding: 0; }
.wpc-checkbox-item { margin-bottom: 8px; }
.wpc-term-item-content-wrapper { display: flex; align-items: center; gap: 8px; }
.wpc-term-item-content-wrapper label {
	font-size: 13px; color: #444; cursor: pointer; display: flex; align-items: center; gap: 6px; width: 100%;
}
.wpc-filter-link { color: #444; text-decoration: none; }
.wpc-filter-link:hover { color: #F34423; }
.wpc-term-count { font-size: 11px; color: var(--stl2-text-muted); margin-left: auto; }
.wpc-checkbox-item input[type="checkbox"] { accent-color: #F34423; width: 16px; height: 16px; cursor: pointer; }

/* Range-фильтры (ширина/длина/диаметр/цена и т.д.) */
.wpc-filters-range-wrapper { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.wpc-filters-range-min, .wpc-filters-range-max {
	width: 100%; padding: 8px 10px; border: 1px solid var(--stl2-border); border-radius: 6px;
	font-family: Montserrat, sans-serif; font-size: 13px;
}
.ui-slider.ui-slider-horizontal,
.wpc-filters-range-slider-control.ui-slider {
	background: #fff !important;
	border: 1px solid #e5e7eb !important;
	height: 4px !important;
	border-radius: 4px !important;
}
.ui-slider .ui-slider-range,
.wpc-filters-range-slider-control .ui-slider-range {
	background: #F34423 !important;
	height: 5px !important;
	top: 0 !important;
}
.ui-slider-handle,
.ui-slider-handle.ui-corner-all,
.ui-slider-handle.ui-state-default,
.wpc-filters-range-slider-control .ui-slider-handle {
	width: 15px !important;
	height: 15px !important;
	background: #1a1a1a !important;
	border: none !important;
	border-radius: 50% !important;
	box-shadow: none !important;
	top: -6px !important;
	cursor: pointer !important;
}

/* Кнопка "Show (N)" внутри виджета — стилизуем под наш красный btn */
.wpc-filters-apply-button {
	display: inline-block; background: #F34423; color: #fff !important; padding: 10px 20px;
	border-radius: 6px; font-size: 13px; font-weight: 700; text-decoration: none;
	font-family: Montserrat, sans-serif;
}
.wpc-filters-apply-button:hover { background: #D63516; }
.wpc-filters-close-button { display: none; } /* актуально только для мобильного попапа плагина */
.wpc-edit-filter-set { display: none; } /* служебная ссылка редактирования фильтра в админке, скрываем на фронте */

@media (max-width: 900px) {
	.stl2-shop-layout { grid-template-columns: 1fr; }
	.stl2-shop-categories-grid { grid-template-columns: 1fr; }
	.stl2-shop-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
	.stl2-shop-grid { grid-template-columns: 1fr; }
}

/* --- Список/плитка: сортировка и переключатель вида --- */
.stl2-sort-select {
	padding: 8px 14px;
	border: 1px solid var(--stl2-border);
	border-radius: 8px;
	font-family: Montserrat, sans-serif;
	font-size: 13px;
	color: #444;
	background: #fff;
	cursor: pointer;
}
.stl2-view-toggle { display: flex; border: 1px solid var(--stl2-border); border-radius: 8px; overflow: hidden; }
.stl2-view-btn {
	width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
	background: #fff; border: none; cursor: pointer; color: #9ca3af; font-size: 14px;
	border-right: 1px solid var(--stl2-border);
}
.stl2-view-btn:last-child { border-right: none; }
.stl2-view-btn.active { background: #F34423; color: #fff; }

/* --- Режим "Списком" (по прототипу: img 140px | body 1fr | actions auto, три колонки грида) --- */
.stl2-shop-grid.list-view { grid-template-columns: 1fr; }
.stl2-shop-grid.list-view .stl2-product-card {
	display: grid;
	grid-template-columns: 140px 1fr auto;
	gap: 0;
}
.stl2-shop-grid.list-view .stl2-product-card__img { width: 140px; height: auto; min-height: 120px; padding: 20px; box-sizing: border-box; background-origin: content-box; background-clip: content-box; }
.stl2-shop-grid.list-view .stl2-product-card__body {
	padding: 16px 20px;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 6px;
}
.stl2-shop-grid.list-view .stl2-product-card__meta { display: none; }
.stl2-shop-grid.list-view .stl2-product-card__name { font-size: 14px; }
.stl2-shop-grid.list-view .stl2-product-card__price { font-size: 20px; }
.stl2-shop-grid.list-view .stl2-product-card__actions {
	padding: 16px;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	gap: 10px;
	border-left: 1px solid #f0f0f0;
	min-width: 152px;
	margin-top: 0;
}
.stl2-shop-grid.list-view .stl2-product-card__actions .stl2-btn { width: 120px; flex: none; white-space: nowrap; }

/* --- Тулбар v2: поиск -> сортировка -> плитка -> список --- */
.stl2-shop-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
	margin-bottom: 20px;
}
.stl2-shop-search {
	display: flex;
	align-items: stretch;
	flex: 1 1 auto;
	height: 40px;
	gap: 0;
	margin: 0;
	border: 1px solid var(--stl2-border);
	border-radius: 8px;
	overflow: hidden;
	box-sizing: border-box;
}
.stl2-shop-search__input {
	flex: 1;
	border: none;
	outline: none;
	box-shadow: none;
	background: #fff;
	padding: 0 16px;
	font-family: Montserrat, sans-serif;
	font-size: 13px;
	min-width: 0;
}
.stl2-shop-search__input:focus { outline: none; box-shadow: none; }
.stl2-shop-search__btn {
	background: #F34423;
	border: none;
	outline: none;
	appearance: none;
	-webkit-appearance: none;
	margin: 0;
	padding: 0;
	border-radius: 0;
	box-sizing: border-box;
	width: 48px;
	height: 100%;
	flex-shrink: 0;
	color: #fff;
	cursor: pointer;
	font-size: 15px;
	line-height: 1;
	display: flex;
	align-items: center;
	justify-content: center;
}
.stl2-shop-search__btn:hover { background: #D63516; }

.stl2-toolbar-controls { display: flex; align-items: center; gap: 8px; }
.stl2-toolbar-btn {
	width: 40px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 1px solid var(--stl2-border);
	border-radius: 8px;
	background: #fff;
	color: #9ca3af;
	cursor: pointer;
	font-size: 14px;
	flex-shrink: 0;
}
.stl2-toolbar-btn.active { background: #F34423; border-color: #F34423; color: #fff; }
.stl2-toolbar-btn:not(.active):hover { border-color: #F34423; color: #F34423; }

.stl2-sort-form { position: relative; display: inline-flex; }
.stl2-sort-select {
	position: absolute;
	inset: 0;
	opacity: 0;
	width: 40px;
	height: 40px;
	cursor: pointer;
}

/* --- Кастомное выпадающее меню сортировки --- */
.stl2-sort-form { position: relative; display: inline-block; }
.stl2-sort-menu {
	display: none;
	position: absolute;
	top: calc(100% + 8px);
	right: 0;
	background: #fff;
	border: 1px solid var(--stl2-border);
	border-radius: 8px;
	box-shadow: 0 8px 24px rgba(0,0,0,.12);
	min-width: 200px;
	padding: 6px;
	z-index: 50;
}
.stl2-sort-menu.open { display: block; }
.stl2-sort-menu__item {
	display: block;
	padding: 10px 14px;
	border-radius: 6px;
	font-family: Montserrat, sans-serif;
	font-size: 13px;
	color: #444;
	text-decoration: none;
	white-space: nowrap;
}
.stl2-sort-menu__item:hover { background: #f5f5f5; }
.stl2-sort-menu__item.active { background: #F34423; color: #fff; font-weight: 600; }
