/**
 * RS Catalog Client — Catalog page styles.
 *
 * Supplements the steinbergwp theme's shop CSS without overriding core selectors.
 * All plugin-specific classes are prefixed with .rcc- to avoid collisions.
 *
 * Sections:
 *  0. Visual parity — dark header (mirrors theme's equipment archive)
 *  1. Brand filter
 *  2. Product card overrides (spare parts context)
 *  3. Pagination
 *  4. Per-page switcher
 *  5. Empty state
 *  6. Mobile filter overlay
 */

/* ==========================================================================
   0. Visual parity — dark header
   ========================================================================== */

/*
 * The theme adds dark header styles inline via custom_header_background_class()
 * for is_singular('equipment') || is_post_type_archive('equipment'). The plugin
 * catalog route does not match those conditions, so we supply the same rules here.
 * This stylesheet is only loaded on the catalog route, so the scope is implicit.
 */

.header-wrap__nav a {
	color: #fff;
}

/* ==========================================================================
   1. Brand filter
   ========================================================================== */

.rcc-brand-filter {
	width: 100%;
}

.rcc-brand-filter__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 12px;
	gap: 12px;
}

.rcc-brand-filter__title {
	margin: 0;
}

.rcc-brand-filter__clear {
	font-size: 12px;
	text-decoration: underline;
	color: inherit;
	opacity: 0.7;
}

.rcc-brand-filter__clear:hover {
	opacity: 1;
}

.rcc-brand-filter__active-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 12px;
}

.rcc-brand-filter__tag {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 3px 8px;
	border: 1px solid currentColor;
	border-radius: 3px;
	font-size: 12px;
	text-decoration: none;
	color: inherit;
}

.rcc-brand-filter__tag-remove {
	font-size: 10px;
	opacity: 0.7;
}

.rcc-brand-filter__list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.rcc-brand-filter__item {
	margin-bottom: 8px;
}

.rcc-brand-checkbox {
	cursor: pointer;
}

/* ==========================================================================
   2. Product card — spare parts context
   ========================================================================== */

/* Spare-parts cards are rendered as full-card links, matching the origin DOM */
.prdct[data-product-type="spare_part"] {
	display: block;
	text-decoration: none;
	color: inherit;
}

.prdct[data-product-type="spare_part"] .prdct-content__title {
	min-height: 3.2em;
}

/* Placeholder image fill */
.prdct-image img[src*="placeholder"] {
	object-fit: contain;
	background: #f5f5f5;
}

/* ==========================================================================
   3. Pagination
   ========================================================================== */

.rcc-pagination {
	margin-top: 30px;
}

.rcc-pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	justify-content: center;
}

.rcc-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 36px;
	height: 36px;
	padding: 0 8px;
	border: 1px solid #ddd;
	text-decoration: none;
	color: inherit;
	font-size: 14px;
	border-radius: 3px;
	transition: background 0.15s, color 0.15s;
}

.rcc-pagination .page-numbers:hover {
	background: #444;
	color: #fff;
	border-color: #444;
}

.rcc-pagination .page-numbers.current {
	background: #444;
	color: #fff;
	border-color: #444;
	font-weight: 600;
}

.rcc-pagination .dots {
	border-color: transparent;
	pointer-events: none;
}

/* ==========================================================================
   4. Per-page switcher
   ========================================================================== */

.shop-wrap__list--top-flex_count .rcc-per-page-btn {
	cursor: pointer;
}

/* ==========================================================================
   5. Empty state
   ========================================================================== */

.rcc-empty-state {
	padding: 40px 0;
	text-align: center;
}

.rcc-empty-state h2 {
	margin: 0;
	font-size: 20px;
	opacity: 0.6;
}

/* ==========================================================================
   6. Mobile filter overlay — controlled by rcc-catalog.js
   ========================================================================== */

@media (max-width: 768px) {
	.shop-wrap__filters.shop-wrap__filters--active {
		display: block;
		position: fixed;
		inset: 0;
		z-index: 9000;
		overflow-y: auto;
		background: #fff;
		padding: 20px;
	}
}

@media (max-width: 550px) {
	.single-product .related-wrap__list {
		display: block;
	}

	.single-product .related-wrap__list .prdct {
		width: 100% !important;
		flex: 0 0 100%;
		margin: 0 0 30px;
	}

	.single-product .related-wrap__list .prdct:last-child {
		margin-bottom: 0;
	}
}

/* ==========================================================================
   7. Single product page
   ========================================================================== */

/* Placeholder fill for single-product gallery when no images provided. */
.single-wrap__gallery--main .item img[src*="placeholder"],
.single-wrap__gallery--list .item img[src*="placeholder"] {
	object-fit: contain;
	background: #f5f5f5;
}

.rcc-route-single .single-wrap__gallery--main .item img,
.rcc-route-single .single-wrap__gallery--list .item img{
	object-position: center;
}

/* ==========================================================================
   8. Service message — 503 fallback
   ========================================================================== */

.rcc-route-service {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 40vh;
	padding: 40px 0;
}

.rcc-service-message {
	text-align: center;
	max-width: 520px;
	margin: 0 auto;
}

.rcc-service-message__title {
	font-size: 22px;
	font-weight: 600;
	margin: 0 0 12px;
	color: #333;
}

.rcc-service-message__text {
	font-size: 15px;
	line-height: 1.6;
	color: #666;
	margin: 0;
}
