/* Clearance page — [hhd_clearance] shortcode */

/* ── Page wrapper spacing reset ──────────────────────────────────────────────
   Blocksy adds 60px padding via data-vertical-spacing on the ct-container-full
   wrapping this page. Gutenberg adds 1.5em margin-block-end on the shortcode
   root div. Zero both for consistent header/footer spacing. */
[class*="ct-container"][data-vertical-spacing] {
	padding-top: 0 !important;
	padding-bottom: 0 !important;
}

.entry-content > .hhd-clearance-wrap {
	margin-block-end: 0;
}

/* ── Hero ──────────────────────────────────────────────────────────────────── */

.hhd-clearance-wrap {
	max-width: 1290px;
	margin: 0 auto;
	padding: 0;
}

.hhd-clearance-hero {
	background: linear-gradient(135deg, #b01e1e 0%, #d94f2c 60%, #e8611a 100%);
	color: #fff;
	border-radius: 4px;
	margin-bottom: 32px;
	overflow: hidden;
	position: relative;
}

.hhd-clearance-hero::before {
	content: '';
	position: absolute;
	inset: 0;
	background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") repeat;
	pointer-events: none;
}

.hhd-clearance-hero__inner {
	position: relative;
	text-align: center;
	padding: 48px 24px 52px;
}

.hhd-clearance-badge {
	display: inline-block;
	background: #fff;
	color: #b01e1e;
	font-weight: 900;
	font-size: 11px;
	letter-spacing: 2.5px;
	padding: 4px 14px;
	border-radius: 2px;
	margin-bottom: 18px;
}

.hhd-clearance-hero h1 {
	font-size: 2.6rem;
	font-weight: 800;
	margin: 0 0 12px;
	color: #fff;
	line-height: 1.1;
}

.hhd-clearance-hero p {
	font-size: 1.1rem;
	margin: 0;
	opacity: 0.9;
	color: #fff;
}

/* ── Body / meta ───────────────────────────────────────────────────────────── */

.hhd-clearance-body {
	padding: 0 16px;
}

/* Inner hhd-catalog-shell is already inside hhd-clearance-body which provides
   horizontal padding — zero out catalog.css's mobile padding to avoid doubling */
#hhd-clearance-grid-wrap {
	padding: 0;
}

.hhd-clearance-meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 20px;
	padding-bottom: 16px;
	border-bottom: 1px solid #e5eaee;
}

.hhd-clearance-count {
	font-size: 14px;
	color: var(--hhd-muted, #6b7b8a);
}

/* ── Empty state ───────────────────────────────────────────────────────────── */

.hhd-clearance-empty {
	text-align: center;
	padding: 64px 24px;
	color: var(--hhd-muted, #6b7b8a);
}

.hhd-clearance-empty p {
	font-size: 1.1rem;
	margin-bottom: 24px;
}

.hhd-clearance-browse-btn {
	display: inline-block;
	background: var(--hhd-green, #1a7d3c);
	color: #fff;
	font-weight: 700;
	font-size: 14px;
	padding: 12px 28px;
	border-radius: 4px;
	text-decoration: none;
}

.hhd-clearance-browse-btn:hover {
	background: var(--hhd-green-dark, #145f2e);
	color: #fff;
}

/* ── Pagination ────────────────────────────────────────────────────────────── */

.hhd-clearance-pagination {
	margin-top: 40px;
	display: flex;
	justify-content: center;
}

.hhd-clearance-pagination .page-numbers {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
	justify-content: center;
}

.hhd-clearance-pagination .page-numbers li a,
.hhd-clearance-pagination .page-numbers li span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 36px;
	height: 36px;
	padding: 0 10px;
	border-radius: 3px;
	font-size: 14px;
	font-weight: 600;
	border: 1px solid #d0d8e0;
	text-decoration: none;
	color: var(--hhd-ink, #0e1a22);
	transition: background 0.15s, border-color 0.15s;
}

.hhd-clearance-pagination .page-numbers li a:hover {
	background: #f0f4f7;
	border-color: #b0bec8;
}

.hhd-clearance-pagination .page-numbers li span.current {
	background: var(--hhd-green, #1a7d3c);
	border-color: var(--hhd-green, #1a7d3c);
	color: #fff;
}

/* ── Toolbar ────────────────────────────────────────────────────────────────── */

.hhd-clearance-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	margin: 22px 0 12px;
}

.hhd-clearance-toolbar__left {
	display: flex;
	align-items: center;
	gap: 10px;
}

.hhd-clearance-toolbar__right {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-shrink: 0;
}

/* ── Off-canvas panel ────────────────────────────────────────────────────────
   Panel CSS is in special-offers.css on that page. Replicated here since
   special-offers.css is not loaded on the clearance page.
──────────────────────────────────────────────────────────────────────────── */

.hhd-offers-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.38);
	z-index: 9998;
}

.hhd-offers-panel {
	position: fixed;
	top: 0;
	left: 0;
	height: 100%;
	width: 320px;
	max-width: 90vw;
	background: #fff;
	z-index: 9999;
	display: flex;
	flex-direction: column;
	box-shadow: 4px 0 24px rgba(0, 0, 0, 0.14);
	transform: translateX(-100%);
	transition: transform 0.26s ease;
}

.hhd-offers-panel.is-open {
	transform: translateX(0);
}

.hhd-offers-panel__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 20px;
	border-bottom: 1px solid #e5eaee;
	flex-shrink: 0;
}

.hhd-offers-panel__title {
	font-size: 15px;
	font-weight: 700;
	margin: 0;
	color: var(--hhd-ink, #0e1a22);
}

.hhd-offers-panel__close {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	padding: 0;
	border: none;
	background: none;
	cursor: pointer;
	color: var(--hhd-muted, #6b7b8a);
	border-radius: 4px;
}

.hhd-offers-panel__close:hover {
	background: #f0f4f7;
	color: var(--hhd-ink, #0e1a22);
}

.hhd-offers-panel__body {
	flex: 1;
	overflow-y: auto;
	padding: 8px 0;
}

.hhd-offers-panel__foot {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 14px 20px;
	border-top: 1px solid #e5eaee;
	flex-shrink: 0;
}

.hhd-offers-panel__foot .hhd-filter-clear-all {
	flex: 0 0 auto;
}

.hhd-offers-panel__foot .hhd-filter-apply {
	flex: 1;
}

/* Filter section padding inside the panel */
.hhd-offers-panel__body .hhd-filter-section__head {
	padding: 12px 20px;
}

.hhd-offers-panel__body .hhd-filter-list {
	padding: 4px 20px 12px;
}

.hhd-offers-panel__body .hhd-filter-item {
	padding: 4px 0;
}

/* Hierarchical layout */
.hhd-filter-item--has-children {
	flex-wrap: wrap;
}

.hhd-filter-item--has-children > .hhd-filter-label {
	font-weight: 700;
}

.hhd-filter-children {
	width: 100%;
	margin: 0 0 6px 20px;
	padding: 0;
	list-style: none;
}

/* ── Active filter tags ──────────────────────────────────────────────────────── */

.hhd-offers-active-tags {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	padding: 10px 0 4px;
}

.hhd-offers-tag {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 4px 10px;
	background: var(--hhd-ink, #0e1a22);
	color: #fff;
	border-radius: 3px;
	font-size: 13px;
	font-weight: 500;
}

.hhd-offers-tag-remove {
	background: none;
	border: none;
	color: rgba(255,255,255,0.75);
	cursor: pointer;
	padding: 0;
	font-size: 15px;
	line-height: 1;
}

.hhd-offers-tag-remove:hover {
	color: #fff;
}

.hhd-offers-clear-link {
	background: none;
	border: none;
	color: var(--hhd-muted, #6b7b8a);
	cursor: pointer;
	font-size: 13px;
	padding: 0;
	text-decoration: underline;
}

.hhd-offers-clear-link:hover {
	color: var(--hhd-ink, #0e1a22);
}

/* ── Load more ───────────────────────────────────────────────────────────────── */

.hhd-load-more-wrap {
	text-align: center;
	margin-top: 32px;
}

.hhd-load-more {
	display: inline-block;
	padding: 12px 32px;
	background: var(--hhd-ink, #0e1a22);
	color: #fff;
	font-size: 14px;
	font-weight: 700;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	transition: background 0.15s;
}

.hhd-load-more:hover {
	background: #1a2f3a;
}

.hhd-load-more:disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

/* ── Loading indicator ───────────────────────────────────────────────────────── */

.hhd-offers-loading {
	font-size: 13px;
	color: var(--hhd-muted, #6b7b8a);
}

/* ── Square thumbnails ───────────────────────────────────────────────────────── */

#hhd-clearance-grid .ct-media-container {
	aspect-ratio: 1;
	overflow: hidden;
}

#hhd-clearance-grid .ct-media-container img.ct-swap {
	display: none;
}

#hhd-clearance-grid .ct-media-container img.wp-post-image {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

/* ── SEO copy ────────────────────────────────────────────────────────────────── */

.hhd-clearance-wrap .hhd-seo-copy__inner {
	max-width: 1290px;
}

/* ── Responsive ────────────────────────────────────────────────────────────── */

@media (max-width: 760px) {
	.hhd-clearance-hero__inner {
		padding: 36px 16px 40px;
	}

	.hhd-clearance-hero h1 {
		font-size: 1.9rem;
	}

	.hhd-clearance-hero p {
		font-size: 1rem;
	}

	.hhd-clearance-toolbar {
		flex-wrap: wrap;
		gap: 10px;
		margin: 16px 0 10px;
	}

	.hhd-clearance-toolbar__left {
		flex: 1 1 100%;
		justify-content: space-between;
	}

	.hhd-clearance-toolbar__right {
		flex: 1 1 100%;
		justify-content: flex-start;
	}

	.hhd-filter-trigger {
		flex: 1;
		justify-content: center;
	}

	.hhd-offers-panel {
		width: 100%;
		max-width: 100%;
	}
}

@media (max-width: 480px) {
	.hhd-clearance-hero h1 {
		font-size: 1.6rem;
	}

	.hhd-clearance-body {
		padding: 0 8px;
	}
}
