/* Shop archive layout — hero, toolbar, product grid.
   Uses the same design tokens as front-page.css. */

/* ── Tokens (mirrors front-page.css) ──────────────── */
.sp-wrap {
	--sp-ink:     #1c1c1a;
	--sp-muted:   #6b6b64;
	--sp-bg:      #faf8f4;
	--sp-bg-alt:  #f1efe8;
	--sp-accent:  #132040;
	--sp-accent-2: #c9a24b;
	--sp-line:    #e4e1d8;
	--sp-gradient: linear-gradient( 100deg, var( --sp-accent ) 0%, var( --sp-accent-2 ) 100% );
	color: var( --sp-ink );
	background: var( --sp-bg );
}

/* ── Container ────────────────────────────────────── */
.sp-container {
	max-width: 1160px;
	margin: 0 auto;
	padding: 0 24px;
}

/* ── Hero banner ──────────────────────────────────── */
.sp-hero {
	background: linear-gradient( 160deg, #060a14 0%, var( --sp-accent ) 60%, #060a14 100% );
	color: #fff;
	padding: 56px 0 48px;
}

.sp-hero__title {
	font-family: Georgia, 'Times New Roman', serif;
	font-size: clamp( 28px, 4vw, 44px );
	font-weight: 400;
	margin: 0 0 12px;
	line-height: 1.15;
	color: #fff;
}

.sp-hero__desc {
	font-size: 16px;
	color: rgba( 255, 255, 255, 0.65 );
	max-width: 60ch;
	margin: 0 0 24px;
	line-height: 1.6;
}

/* ── Shop ⇄ Build Your Pack toggle ────────────────────────────────────── */
/* Shared with page-pack.php via pp_render_shop_pack_toggle() (functions.php)
   — same markup/classes there, this file only supplies the on-dark colors
   this page's hero needs; pack-builder.css supplies the light-bg default. */

.pp-view-toggle {
	display: inline-flex;
	gap: 2px;
	padding: 4px;
	border-radius: 999px;
	background: rgba( 255, 255, 255, 0.1 );
}

.pp-view-toggle__option {
	padding: 10px 22px;
	border-radius: 999px;
	font-size: 14px;
	font-weight: 700;
	text-decoration: none;
	color: rgba( 255, 255, 255, 0.65 );
	transition: background 0.15s ease, color 0.15s ease;
}

.pp-view-toggle__option.is-active {
	background: #fff;
	color: var( --sp-accent );
}

/* ── Breadcrumb ───────────────────────────────────── */
.sp-breadcrumb {
	margin-bottom: 20px;
	font-size: 13px;
}

.sp-breadcrumb .woocommerce-breadcrumb {
	color: rgba( 255, 255, 255, 0.5 );
}

.sp-breadcrumb .woocommerce-breadcrumb a {
	color: rgba( 255, 255, 255, 0.7 );
	text-decoration: none;
}

.sp-breadcrumb .woocommerce-breadcrumb a:hover {
	color: var( --sp-accent-2 );
}

/* ── Eyebrow ──────────────────────────────────────── */
.sp-eyebrow {
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var( --sp-accent-2 );
	margin: 0 0 12px;
}

/* ── Sidebar + main two-column layout ────────────── */
.sp-main-grid {
	display: grid;
	grid-template-columns: 260px 1fr;
	gap: 40px;
	align-items: start;
	padding-top: 40px;
}

.sp-sidebar {
	position: sticky;
	top: 24px;
}

.sp-filters {
	background: #fff;
	border: 1px solid var( --sp-line );
	border-radius: 16px;
	padding: 24px;
}

.sp-filter-group {
	margin-bottom: 24px;
}

.sp-filter-group:last-of-type {
	margin-bottom: 20px;
}

.sp-filter-label {
	display: block;
	font-size: 13px;
	font-weight: 700;
	margin-bottom: 10px;
	color: var( --sp-ink );
}

.sp-search {
	position: relative;
}

.sp-search input[type="search"] {
	width: 100%;
	padding: 10px 14px;
	border: 1px solid var( --sp-line );
	border-radius: 999px;
	font-size: 14px;
	box-sizing: border-box;
}

/* Live search dropdown — see assets/js/shop-search.js. Queries Blocksy's
   own built-in live-search REST endpoint (wp/v2/search?ct_live_search=true),
   the same one the header's search icon uses, instead of a plain GET-form
   page reload. */
.sp-search__results {
	position: absolute;
	top: calc( 100% + 6px );
	inset-inline-start: 0;
	inset-inline-end: 0;
	background: #fff;
	border: 1px solid var( --sp-line );
	border-radius: 12px;
	box-shadow: 0 12px 28px rgba( 28, 28, 26, 0.12 );
	overflow: hidden;
	z-index: 20;
	max-height: 340px;
	overflow-y: auto;
}

.sp-search__item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 14px;
	text-decoration: none;
	color: var( --sp-ink );
	border-bottom: 1px solid var( --sp-line );
}

.sp-search__item:last-child {
	border-bottom: none;
}

.sp-search__item:hover,
.sp-search__item.is-active {
	background: var( --sp-bg-alt );
}

.sp-search__item img,
.sp-search__item-noimg {
	width: 36px;
	height: 36px;
	object-fit: contain;
	flex: none;
	border-radius: 8px;
	background: var( --sp-bg-alt );
}

.sp-search__item-title {
	font-size: 13.5px;
	font-weight: 600;
	line-height: 1.35;
}

.sp-search__empty {
	margin: 0;
	padding: 14px;
	font-size: 13px;
	color: var( --sp-muted );
	text-align: center;
}

.sp-cat-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.sp-cat-list a {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 6px 8px;
	border-radius: 8px;
	color: var( --sp-muted );
	text-decoration: none;
	font-size: 14px;
}

.sp-cat-list a:hover {
	background: var( --sp-bg-alt );
	color: var( --sp-ink );
}

.sp-cat-list li.is-active a {
	background: var( --sp-accent );
	color: #fff;
}

.sp-cat-list li.is-active a .sp-cat-count {
	color: rgba( 255, 255, 255, 0.7 );
}

.sp-cat-count {
	font-size: 12px;
	color: var( --sp-muted );
}

.sp-price-inputs {
	display: flex;
	align-items: center;
	gap: 8px;
}

.sp-price-inputs input {
	width: 0;
	flex: 1;
	padding: 8px 10px;
	border: 1px solid var( --sp-line );
	border-radius: 8px;
	font-size: 13px;
	box-sizing: border-box;
}

.sp-price-sep {
	color: var( --sp-muted );
	font-size: 13px;
}

.sp-checkbox {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
	cursor: pointer;
}

.sp-checkbox input {
	width: 16px;
	height: 16px;
	accent-color: var( --sp-accent );
}

.sp-filter-submit {
	width: 100%;
	background: var( --sp-accent );
	color: #fff;
	border: none;
	border-radius: 999px;
	padding: 12px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
}

.sp-filter-submit:hover {
	opacity: 0.9;
}

.sp-filter-clear {
	display: block;
	text-align: center;
	margin-top: 12px;
	font-size: 13px;
	color: var( --sp-muted );
	text-decoration: underline;
}

/* ── Main content area ────────────────────────────── */
.sp-main {
	padding: 0 0 80px;
}

/* ── Toolbar (result count + ordering) ───────────── */
.sp-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 12px;
	margin-bottom: 32px;
	padding-bottom: 20px;
	border-bottom: 1px solid var( --sp-line );
}

.sp-toolbar .woocommerce-result-count {
	font-size: 13px;
	color: var( --sp-muted );
	margin: 0;
}

.sp-toolbar .woocommerce-ordering {
	margin: 0;
}

.sp-toolbar .woocommerce-ordering select {
	font-size: 13px;
	padding: 8px 14px;
	border: 1px solid var( --sp-line );
	border-radius: 8px;
	background: #fff;
	color: var( --sp-ink );
	cursor: pointer;
	appearance: auto;
}

/* ── Product grid ─────────────────────────────────── */
.sp-products ul.products {
	display: grid;
	grid-template-columns: repeat( auto-fill, minmax( 240px, 1fr ) );
	gap: 28px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.sp-products ul.products li.product {
	background: #fff;
	border: 1px solid var( --sp-line );
	border-radius: 16px;
	overflow: hidden;
	transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
	display: flex;
	flex-direction: column;
	margin: 0;
}

.sp-products ul.products li.product:hover {
	transform: translateY( -4px );
	border-color: transparent;
	box-shadow: 0 16px 32px rgba( 28, 28, 26, 0.1 );
}

/* product image — Blocksy's own markup wraps the image in a.ct-media-container,
   NOT a.woocommerce-loop-product__link (that class wraps the title text only,
   see below) — styling the wrong one made the title render as an empty box. */
.sp-products ul.products li.product a.ct-media-container {
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 1 / 1;
	background: linear-gradient( 165deg, var( --sp-bg-alt ), #fff );
	padding: 20px;
	overflow: hidden;
}

.sp-products ul.products li.product img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	transition: transform 0.3s ease;
}

.sp-products ul.products li.product:hover img {
	transform: scale( 1.05 );
}

/* product body — .woocommerce-loop-product__link IS the title element here */
.sp-products ul.products li.product .woocommerce-loop-product__title,
.sp-products ul.products li.product a.woocommerce-loop-product__link,
.sp-products ul.products li.product h2 {
	display: block;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.3;
	margin: 0 0 8px;
	padding: 20px 20px 0;
	color: var( --sp-ink );
	text-decoration: none;
}

/* Category label sits in Blocksy's .entry-meta flex row; with only one
   item (no author/date shown here) it defaults to flex-start, which reads
   as the right edge in RTL instead of centered under the title/price. */
.sp-products ul.products li.product .entry-meta {
	justify-content: center;
	padding: 0 20px;
}

.sp-products ul.products li.product .price {
	font-size: 16px;
	font-weight: 700;
	color: var( --sp-accent );
	padding: 0 20px 16px;
	display: block;
}

.sp-products ul.products li.product .price del {
	color: var( --sp-muted );
	font-weight: 400;
	opacity: 0.7;
	margin-inline-end: 6px;
	font-size: 14px;
}

/* sale badge */
.sp-products ul.products li.product .onsale {
	background: var( --sp-accent );
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.04em;
	border-radius: 999px;
	padding: 5px 12px;
	top: 14px;
	inset-inline-start: 14px;
	margin: 0;
}

/* add to cart button — Blocksy wraps it in a flex container
   (.ct-woo-card-actions), so the button needs to fill THAT, not just
   have its own width/margin set (a flex child ignores block margin
   auto-centering and sizes to content by default). */
.sp-products ul.products li.product .ct-woo-card-actions {
	display: block;
	width: auto;
	padding: 0 20px 20px;
	margin-top: auto;
}

.sp-products ul.products li.product .button {
	display: block;
	width: 100%;
	box-sizing: border-box;
	margin: 0;
	text-align: center;
	background: var( --sp-ink );
	color: #fff;
	font-weight: 600;
	font-size: 14px;
	padding: 12px 20px;
	border-radius: 999px;
	text-decoration: none;
	border: none;
	cursor: pointer;
	transition: opacity 0.15s ease;
}

.sp-products ul.products li.product .button:hover {
	opacity: 0.85;
	color: #fff;
}

.sp-products ul.products li.product .added_to_cart {
	display: block;
	text-align: center;
	margin: 8px 0 0;
	font-size: 13px;
	font-weight: 600;
	color: var( --sp-accent );
	text-decoration: none;
}

/* ── Pagination ───────────────────────────────────── */
.woocommerce-pagination {
	margin-top: 48px;
	text-align: center;
}

.woocommerce-pagination ul.page-numbers {
	display: inline-flex;
	gap: 6px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.woocommerce-pagination ul.page-numbers li {
	margin: 0;
}

.woocommerce-pagination ul.page-numbers a,
.woocommerce-pagination ul.page-numbers span {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 8px;
	border: 1px solid var( --sp-line );
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	color: var( --sp-ink );
	transition: background 0.15s ease, color 0.15s ease;
}

.woocommerce-pagination ul.page-numbers a:hover {
	background: var( --sp-ink );
	color: #fff;
	border-color: var( --sp-ink );
}

.woocommerce-pagination ul.page-numbers .current {
	background: var( --sp-accent );
	color: #fff;
	border-color: var( --sp-accent );
}

/* ── Empty state ──────────────────────────────────── */
.sp-empty {
	text-align: center;
	padding: 60px 0;
	color: var( --sp-muted );
}

/* ── Responsive ───────────────────────────────────── */
@media ( max-width: 900px ) {
	.sp-main-grid {
		grid-template-columns: 1fr;
	}

	.sp-sidebar {
		position: static;
	}

	.sp-products ul.products {
		grid-template-columns: repeat( 2, 1fr );
	}
}

@media ( max-width: 560px ) {
	.sp-hero {
		padding: 40px 0 32px;
	}

	.sp-toolbar {
		flex-direction: column;
		align-items: flex-start;
	}
}
