/* ============================================================
   Archive (shop / category) — Coffs Coast Drones
   Personality-page: chart backdrop faint, mono numbers, sidebar
   filter + 3-col grid. Depends on home.css (buttons, backdrop,
   tokens) — home CSS enqueues .ccd-hero__backdrop.
   ============================================================ */

/* Chart backdrop reuse for archive pages */
.ccd-archive { position: relative; background: var(--bg-page); }
.ccd-archive .ccd-hero__backdrop {
	position: absolute;
	background-image: var(--ccd-backdrop);
	background-repeat: repeat;
	background-size: 720px auto;
	pointer-events: none;
	will-change: transform;
}

.ccd-archive-head {
	position: relative;
	padding-block: clamp(32px, 5vw, 64px);
	border-bottom: 1px solid var(--border-subtle);
	overflow: hidden;
}
.ccd-archive-head__inner { position: relative; z-index: 1; }
.ccd-archive-head__title {
	font-family: var(--font-display, var(--font-heading));
	font-weight: 700;
	font-size: clamp(28px, 4vw, 48px);
	letter-spacing: -0.03em;
	color: var(--text-strong);
	margin: 0 0 12px;
	line-height: 1.05;
}
.ccd-archive-head__desc {
	max-width: 62ch;
	color: var(--text-body);
	font-size: 16px;
	line-height: 1.6;
}
.ccd-archive-head .ccd-eyebrow a {
	color: inherit; text-decoration: none;
}
.ccd-archive-head .ccd-eyebrow a:hover { color: var(--brand); text-decoration: underline; }

/* ---------- Grid ---------- */
.ccd-archive__grid {
	display: grid;
	gap: clamp(24px, 3vw, 40px);
	grid-template-columns: 260px minmax(0, 1fr);
	padding-block: clamp(32px, 5vw, 56px);
}
@media (max-width: 900px) {
	.ccd-archive__grid { grid-template-columns: 1fr; }
	.ccd-filters { position: static !important; }
}

/* ---------- Filters ---------- */
.ccd-filters {
	position: sticky;
	top: 24px;
	align-self: start;
}
.ccd-filters__form { display: grid; gap: 24px; }
.ccd-filter-group {}
.ccd-filter-group__title {
	font-family: var(--font-mono);
	text-transform: uppercase;
	letter-spacing: 0.14em;
	font-size: 12px;
	color: var(--text-muted);
	margin: 0 0 12px;
	font-weight: 500;
	padding-bottom: 8px;
	border-bottom: 1px solid var(--border-subtle);
}
.ccd-filter-group__list { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.ccd-filter-group__list a {
	display: flex; align-items: baseline; justify-content: space-between;
	gap: 12px;
	padding: 8px 10px;
	border-radius: var(--radius-sm, 3px);
	text-decoration: none;
	color: var(--text-body);
	font-size: 14px;
	transition: background-color .12s ease, color .12s ease;
}
.ccd-filter-group__list a:hover { background: var(--surface-card); color: var(--text-strong); }
.ccd-filter-group__list .ccd-num { color: var(--text-faint); font-size: 12px; }
.ccd-filter-group__list li.is-active > a {
	background: var(--sectional-50);
	color: var(--brand);
	font-weight: 600;
}
.ccd-filter-group__list li.is-active .ccd-num { color: var(--brand); }

.ccd-filter-group__list--chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ccd-chip {
	display: inline-flex; align-items: center;
	padding: 6px 12px;
	background: var(--surface-card);
	border: 1px solid var(--border-default);
	border-radius: 999px;
	font-family: var(--font-mono);
	font-size: 12px;
	color: var(--text-body);
	text-decoration: none;
	transition: background-color .12s ease, border-color .12s ease, color .12s ease;
}
.ccd-chip:hover { border-color: var(--brand); color: var(--brand); }
.ccd-chip--active {
	background: var(--brand);
	color: var(--brand-contrast);
	border-color: var(--brand);
}

.ccd-check {
	display: inline-flex; align-items: center; gap: 10px;
	font-size: 14px;
	color: var(--text-body);
	cursor: pointer;
}
.ccd-check input[type="checkbox"] {
	appearance: none;
	width: 16px; height: 16px;
	border: 1.5px solid var(--border-strong);
	border-radius: 2px;
	background: var(--surface-raised);
	cursor: pointer;
	position: relative;
	flex-shrink: 0;
}
.ccd-check input[type="checkbox"]:checked {
	background: var(--brand);
	border-color: var(--brand);
}
.ccd-check input[type="checkbox"]:checked::after {
	content: '';
	position: absolute; left: 4px; top: 1px;
	width: 4px; height: 8px;
	border: solid var(--brand-contrast);
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}
.ccd-check input[type="checkbox"]:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }

.ccd-btn--sm { padding: 8px 14px; font-size: 13px; }

/* ---------- Results column ---------- */
.ccd-results__head {
	display: flex; align-items: center; justify-content: space-between;
	gap: 16px; flex-wrap: wrap;
	padding: 12px 0 20px;
	border-bottom: 1px solid var(--border-subtle);
	margin-bottom: 24px;
}
.ccd-results__count {
	margin: 0;
	font-family: var(--font-body);
	font-size: 14px;
	color: var(--text-body);
}
.ccd-results__count .ccd-num {
	font-weight: 600;
	color: var(--text-strong);
	margin-right: 4px;
}
.ccd-results__sort form { margin: 0; }
.ccd-results__sort select.orderby {
	font-family: var(--font-body);
	font-size: 14px;
	padding: 8px 12px;
	border: 1px solid var(--border-default);
	border-radius: var(--radius-sm, 3px);
	background: var(--surface-raised);
	color: var(--text-strong);
	cursor: pointer;
}
.ccd-results__sort select.orderby:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }

/* ---------- Product grid ---------- */
.ccd-products__grid--3 {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: clamp(16px, 2vw, 24px);
	list-style: none; padding: 0; margin: 0;
}
@media (max-width: 900px) { .ccd-products__grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .ccd-products__grid--3 { grid-template-columns: 1fr; } }

/* Product tile — matches ProductTile.dc.html reference */
.ccd-product-tile { display: flex; }
.ccd-product-tile__link {
	display: flex; flex-direction: column; flex: 1;
	text-decoration: none; color: inherit;
	background: var(--surface-card);
	border: 1px solid var(--border-subtle);
	border-radius: var(--radius-md, 4px);
	overflow: hidden;
	box-shadow: var(--shadow-sm, 0 1px 2px rgba(20, 23, 26, .06));
	transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.ccd-product-tile__link:hover {
	transform: translateY(-3px);
	box-shadow: 0 10px 24px rgba(20, 23, 26, .12);
	border-color: var(--border-strong);
}
.ccd-product-tile__link:focus-visible {
	outline: 2px solid var(--focus-ring); outline-offset: 2px;
}
.ccd-product-tile__well {
	position: relative;
	aspect-ratio: 4 / 3;
	background: linear-gradient(150deg, var(--sectional-100), var(--paper-150));
	display: grid; place-items: center;
	overflow: hidden;
	padding: 16px;
}
.ccd-product-tile__img,
.ccd-product-tile__well img {
	width: 100%; height: 100%; object-fit: contain;
	display: block;
}
.ccd-product-tile__meta {
	padding: 16px;
	display: flex; flex-direction: column; gap: 6px;
	flex: 1;
}
.ccd-product-tile__cat {
	font-family: var(--font-heading);
	font-size: 11px;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--text-faint);
	margin: 0;
}
.ccd-product-tile__title {
	font-family: var(--font-heading);
	font-weight: 600;
	font-size: 16px;
	line-height: 1.3;
	color: var(--text-strong);
	margin: 0;
	display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
	overflow: hidden;
	min-height: 2.6em;
}
.ccd-product-tile__intro {
	display: inline-flex; align-items: center; gap: 6px;
	font-size: 12px;
	color: var(--accent-2);
	font-weight: 500;
	margin: 4px 0 0;
}
.ccd-product-tile__intro svg { flex-shrink: 0; }
.ccd-product-tile__bottom {
	margin-top: auto; padding-top: 12px;
	display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
}
.ccd-product-tile__price {
	font-family: var(--font-mono);
	font-size: 18px;
	font-weight: 600;
	color: var(--text-strong);
}
.ccd-product-tile__price .amount { color: inherit; }
.ccd-product-tile__price ins { text-decoration: none; color: var(--accent); }
.ccd-product-tile__price del { color: var(--text-muted); font-weight: 400; margin-right: 6px; font-size: 14px; }
.ccd-product-tile__price .ccd-num { display: inline; }

.ccd-badge {
	position: absolute; top: 12px; left: 12px;
	z-index: 1;
	font-family: var(--font-mono);
	text-transform: uppercase;
	letter-spacing: 0.08em;
	font-size: 11px;
	font-weight: 600;
	padding: 4px 10px;
	border-radius: 999px;
	background: var(--accent);
	color: var(--accent-contrast);
}
.ccd-badge--sale { background: var(--accent); }
.ccd-badge--muted { background: var(--paper-700); color: var(--white); }

/* ---------- Empty state + pagination ---------- */
.ccd-empty {
	background: var(--surface-card);
	border: 1px dashed var(--border-default);
	border-radius: var(--radius-md, 4px);
	padding: 40px;
	text-align: center;
}
.ccd-empty h2 {
	font-family: var(--font-heading);
	font-size: 18px;
	margin: 0 0 8px;
	color: var(--text-strong);
}
.ccd-empty p { margin: 0; color: var(--text-body); }
.ccd-empty a { color: var(--brand); }

/* Woo pagination — a light polish, not custom */
.woocommerce-pagination {
	margin-top: 32px; padding-top: 24px;
	border-top: 1px solid var(--border-subtle);
	text-align: center;
}
.woocommerce-pagination ul.page-numbers {
	display: inline-flex; gap: 4px; list-style: none; padding: 0; margin: 0;
}
.woocommerce-pagination .page-numbers {
	display: inline-flex; align-items: center; justify-content: center;
	min-width: 36px; height: 36px;
	padding: 0 10px;
	font-family: var(--font-mono);
	font-size: 14px;
	color: var(--text-body);
	background: var(--surface-card);
	border: 1px solid var(--border-default);
	border-radius: var(--radius-sm, 3px);
	text-decoration: none;
}
.woocommerce-pagination .page-numbers:hover { border-color: var(--brand); color: var(--brand); }
.woocommerce-pagination .page-numbers.current {
	background: var(--brand); color: var(--brand-contrast); border-color: var(--brand);
}
