/**
 * HALINK C8 — Shop / collection page (Dola match)
 */

.c8-shop-page {
	padding: 0 0 60px;
	background: var(--c8-bg, #f0efeb);
}

.c8-shop-page__layout {
	display: grid;
	grid-template-columns: 280px minmax(0, 1fr);
	gap: 1.75rem;
	align-items: start;
}

/* ---------- Filters ---------- */
.c8-shop-filters {
	padding: 16px;
	background: #f7f5f0;
	border: 1px solid #d6cfc4;
	border-radius: 8px;
}

.c8-shop-filters__selected {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	margin-bottom: 1rem;
	padding: 0.5rem 0.75rem;
	background: #121f38;
	border-radius: 6px;
	color: #fff;
}

.c8-shop-filters__selected-title {
	font-weight: 700;
	font-size: 0.9375rem;
}

.c8-shop-filters__clear {
	color: #fff;
	font-size: 0.8125rem;
	text-decoration: underline;
}

.c8-shop-filters__group {
	margin-bottom: 1.25rem;
}

.c8-shop-filters__heading {
	margin: 0 0 0.65rem;
	font-family: var(--c8-font-display, Lora, Georgia, serif);
	font-size: 1.125rem;
	font-weight: 700;
	color: #121f38;
}

.c8-shop-filters__list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.c8-shop-filters__list li {
	margin: 0 0 0.4rem;
}

.c8-shop-filters__check {
	display: flex;
	align-items: flex-start;
	gap: 0.5rem;
	cursor: pointer;
	font-size: 0.9375rem;
	color: #222;
	line-height: 1.35;
}

.c8-shop-filters__check input {
	margin-top: 0.2rem;
	accent-color: #121f38;
}

.c8-shop-filters__submit {
	display: block;
	width: 100%;
	margin-top: 0.5rem;
	padding: 0.65rem 1rem;
	border: 0;
	border-radius: 999px;
	background: #121f38;
	color: #fff;
	font-weight: 700;
	font-size: 0.875rem;
	cursor: pointer;
}

.c8-shop-filters__submit:hover {
	background: #9a563a;
}

/* ---------- Sort pills ---------- */
.c7-shop-sort {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem 0.65rem;
	margin-bottom: 1.25rem;
}

.c7-shop-sort__label {
	font-size: 0.875rem;
	font-weight: 600;
	color: #121f38;
	margin-right: 0.25rem;
}

.c7-shop-sort__pills {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
}

.c7-shop-sort__pill {
	display: inline-flex;
	align-items: center;
	padding: 0.35rem 0.85rem;
	border-radius: 999px;
	border: 1px solid #d1cfc8;
	background: #fff;
	color: #121f38;
	font-size: 0.8125rem;
	font-weight: 500;
	text-decoration: none;
	white-space: nowrap;
	transition:
		background 0.15s ease,
		border-color 0.15s ease,
		color 0.15s ease;
}

.c7-shop-sort__pill:hover {
	border-color: #121f38;
}

.c7-shop-sort__pill.is-active {
	background: #121f38;
	border-color: #121f38;
	color: #fff;
}

/* ---------- Product grid ---------- */
.c8-shop-grid.products {
	display: grid !important;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 1.25rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.c8-shop-grid__item,
.c8-shop-grid .product {
	margin: 0 !important;
	padding: 0 !important;
	width: auto !important;
	float: none !important;
	list-style: none;
	height: 100%;
}

/* Match home product card in category / shop grid */
.c8-shop-grid .c8-hp-card,
.c8-shop-page .c8-hp-card {
	height: 100%;
	margin: 0;
	background: transparent;
	border: 0;
	box-shadow: none;
}

.c8-shop-grid .c8-hp-card__inner,
.c8-shop-page .c8-hp-card__inner {
	display: flex;
	flex-direction: column;
	height: 100%;
	padding: 10px;
	background: #fff;
	border-radius: 30px 10px;
	text-align: center;
	box-shadow: 0 2px 14px rgba(18, 31, 56, 0.05);
}

.c8-shop-grid .c8-hp-card__thumb,
.c8-shop-page .c8-hp-card__thumb {
	position: relative;
	margin-bottom: 0.75rem;
}

.c8-shop-grid .c8-hp-card__media,
.c8-shop-page .c8-hp-card__media {
	position: relative;
	display: block;
	overflow: hidden;
	width: 100%;
	padding-bottom: 100%;
	background: #fff;
	border-radius: 50px 10px 10px 10px;
}

.c8-shop-grid .c8-hp-card__img,
.c8-shop-grid .c8-hp-card__ph,
.c8-shop-page .c8-hp-card__img,
.c8-shop-page .c8-hp-card__ph {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: auto;
	object-fit: contain;
}

.c8-shop-grid .c8-hp-card__actions,
.c8-shop-page .c8-hp-card__actions {
	position: absolute;
	left: 50%;
	bottom: 14px;
	z-index: 3;
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: center;
	gap: 8px;
	opacity: 0;
	visibility: hidden;
	transform: translate(-50%, 10px);
	transition: all 0.3s ease;
}

.c8-shop-grid .c8-hp-card:hover .c8-hp-card__actions,
.c8-shop-grid .c8-hp-card:focus-within .c8-hp-card__actions,
.c8-shop-page .c8-hp-card:hover .c8-hp-card__actions,
.c8-shop-page .c8-hp-card:focus-within .c8-hp-card__actions {
	opacity: 1;
	visibility: visible;
	transform: translate(-50%, 0);
}

.c8-shop-grid .c8-hp-card__action,
.c8-shop-page .c8-hp-card__action {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #121f38;
	color: #fff !important;
	cursor: pointer;
	text-decoration: none;
	box-shadow: 0 4px 10px rgba(18, 31, 56, 0.2);
}

.c8-shop-grid .c8-hp-card__action:hover,
.c8-shop-page .c8-hp-card__action:hover {
	background: #9a563a;
}

.c8-shop-grid .c8-hp-card__body,
.c8-shop-page .c8-hp-card__body {
	padding: 0 0.35rem 0.5rem;
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
}

.c8-shop-grid .c8-hp-card__title,
.c8-shop-page .c8-hp-card__title {
	margin: 0 0 0.45rem;
	font-family: var(--c8-font-display, Lora, Georgia, serif);
	font-size: 1.05rem;
	font-weight: 700;
	line-height: 1.35;
	color: #121f38;
	text-align: center;
}

.c8-shop-grid .c8-hp-card__title a,
.c8-shop-page .c8-hp-card__title a {
	color: inherit;
	text-decoration: none;
}

.c8-shop-grid .c8-hp-card__price,
.c8-shop-page .c8-hp-card__price {
	margin-top: auto;
	font-size: 1.05rem;
	font-weight: 700;
	color: #9a563a;
	text-align: center;
}

@media (max-width: 991px) {
	.c8-shop-grid .c8-hp-card__actions,
	.c8-shop-page .c8-hp-card__actions {
		opacity: 1 !important;
		visibility: visible !important;
		pointer-events: auto;
		transform: translate(-50%, 0) !important;
	}
}

/* ---------- Pagination ---------- */
.c8-shop-page .woocommerce-pagination {
	margin-top: 2rem;
	text-align: center;
}

.c8-shop-page .woocommerce-pagination ul {
	display: inline-flex;
	gap: 0.4rem;
	margin: 0;
	padding: 0;
	list-style: none;
	border: 0;
}

.c8-shop-page .woocommerce-pagination li {
	border: 0 !important;
	float: none !important;
}

.c8-shop-page .woocommerce-pagination a,
.c8-shop-page .woocommerce-pagination span {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	min-width: 38px;
	height: 38px;
	padding: 0 0.55rem !important;
	border-radius: 6px !important;
	background: #fff !important;
	border: 1px solid #d1cfc8 !important;
	color: #121f38 !important;
	font-weight: 600;
	text-decoration: none;
}

.c8-shop-page .woocommerce-pagination .current {
	background: #121f38 !important;
	border-color: #121f38 !important;
	color: #fff !important;
}

/* ---------- Mobile filter ---------- */
.c8-shop-page__filter-toggle {
	display: none;
	position: fixed;
	right: 16px;
	bottom: calc(72px + env(safe-area-inset-bottom, 0px));
	z-index: 440;
	padding: 0.7rem 1.1rem;
	border: 0;
	border-radius: 999px;
	background: #121f38;
	color: #fff;
	font-weight: 700;
	font-size: 0.875rem;
	box-shadow: 0 6px 16px rgba(18, 31, 56, 0.25);
	cursor: pointer;
}

.c8-shop-page__filter-overlay {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 460;
	background: rgba(18, 31, 56, 0.45);
}

/* Override generic WC ul.products 4-col on this page */
.c8-shop-page ul.products.columns-3,
.c8-shop-page ul.products.columns-4,
.c8-shop-page .woocommerce ul.products {
	display: grid !important;
	grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

@media (max-width: 991px) {
	.c8-shop-page__layout {
		grid-template-columns: 1fr;
	}

	.c8-shop-page__sidebar {
		position: fixed;
		top: 0;
		left: 0;
		bottom: 0;
		z-index: 470;
		width: min(320px, 88vw);
		padding: 1rem;
		background: #fff;
		transform: translateX(-105%);
		transition: transform 0.25s ease;
		overflow-y: auto;
		box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
	}

	.c8-shop-page.is-filters-open .c8-shop-page__sidebar {
		transform: translateX(0);
	}

	.c8-shop-page.is-filters-open .c8-shop-page__filter-overlay {
		display: block;
	}

	.c8-shop-page__filter-toggle {
		display: inline-flex;
	}

	.c8-shop-grid.products,
	.c8-shop-page ul.products {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
	}
}

@media (max-width: 575px) {
	.c8-shop-grid.products,
	.c8-shop-page ul.products {
		grid-template-columns: 1fr !important;
	}

	.c7-shop-sort__pill {
		font-size: 0.75rem;
		padding: 0.3rem 0.65rem;
	}
}
