/* ==========================================================================
   All Products Page — her-ap-*
   Matches the design: hero → sidebar+grid layout → newsletter → footer
   ========================================================================== */

:root {
	--her-dark:       #2b2b2b;
	--her-accent:     #8b7355;
	--her-light-bg:   #f9f7f4;
	--her-border:     #e0dbd3;
	--her-text:       #555;
	--her-muted:      #888;
}

#her-all-products-page {
	background: #fff;
	min-height: 60vh;
}

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

.her-ap-hero {
	position: relative;
	background: var(--her-light-bg);
	min-height: 320px;
	display: flex;
	align-items: flex-end;
	overflow: hidden;
}

.her-ap-hero--has-image {
	min-height: 420px;
	background: var(--her-dark);
}

.her-ap-hero__bg {
	position: absolute;
	inset: 0;
}

.her-ap-hero__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.her-ap-hero__img--mobile { display: none; }

@media (max-width: 768px) {
	.her-ap-hero__img--desktop { display: none; }
	.her-ap-hero__img--mobile  { display: block; }
}

.her-ap-hero__overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(to right, rgba(0,0,0,.62) 0%, rgba(0,0,0,.2) 100%);
}

.her-ap-hero__inner {
	position: relative;
	z-index: 1;
	max-width: 1200px;
	width: 100%;
	margin: 0 auto;
	padding: 48px 40px;
}

.her-ap-hero--has-image .her-ap-hero__inner {
	color: #fff;
}

.her-ap-hero__breadcrumb {
	font-family: 'Montserrat', sans-serif;
	font-size: 0.7rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: inherit;
	opacity: 0.65;
	margin-bottom: 16px;
}

.her-ap-hero__breadcrumb a {
	color: inherit;
	text-decoration: none;
}

.her-ap-hero__breadcrumb a:hover { opacity: 1; }

.her-ap-hero__heading {
	font-family: 'Cormorant Garamond', serif;
	font-size: clamp(2rem, 5vw, 3.5rem);
	font-weight: 500;
	letter-spacing: 0.02em;
	line-height: 1.1;
	color: inherit;
	margin: 0 0 16px;
	text-transform: none;
}

.her-ap-hero__desc {
	font-family: 'Public Sans', sans-serif;
	font-size: 0.95rem;
	line-height: 1.7;
	color: inherit;
	opacity: 0.85;
	max-width: 600px;
	margin: 0;
}

/* ── Main layout (sidebar + content) ───────────────────────────────────────── */

.her-ap-main {
	display: grid;
	grid-template-columns: 240px 1fr;
	gap: 0 48px;
	max-width: 1200px;
	margin: 0 auto;
	padding: 48px 40px 64px;
	align-items: start;
}

/* ── Sidebar ────────────────────────────────────────────────────────────────── */

.her-ap-sidebar {
	position: sticky;
	top: 100px;
}

.her-ap-sidebar__header {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	margin-bottom: 6px;
}

.her-ap-sidebar__title {
	font-family: 'Montserrat', sans-serif;
	font-size: 0.7rem;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--her-dark);
}

.her-ap-sidebar__clear {
	font-family: 'Montserrat', sans-serif;
	font-size: 0.65rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--her-muted);
	text-decoration: underline;
}

.her-ap-sidebar__clear:hover { color: var(--her-accent); }

.her-ap-sidebar__count {
	font-family: 'Public Sans', sans-serif;
	font-size: 0.8rem;
	color: var(--her-muted);
	margin: 0 0 24px;
}

.her-ap-sidebar__form { display: flex; flex-direction: column; gap: 0; }

/* Filter panels */

.her-ap-filter {
	border-top: 1px solid var(--her-border);
	padding: 14px 0;
}

.her-ap-filter__toggle {
	width: 100%;
	background: none;
	border: none;
	padding: 0;
	display: flex;
	justify-content: space-between;
	align-items: center;
	cursor: pointer;
	font-family: 'Montserrat', sans-serif;
	font-size: 0.68rem;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--her-dark);
	text-align: left;
}

.her-ap-filter__toggle::after {
	content: '▾';
	font-size: 0.75rem;
	transition: transform 0.2s;
}

.her-ap-filter__toggle[aria-expanded='false']::after {
	transform: rotate(-90deg);
}

.her-ap-filter__body {
	margin-top: 12px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.her-ap-filter__body[hidden] { display: none; }

.her-ap-filter__option {
	display: flex;
	align-items: center;
	gap: 8px;
	font-family: 'Public Sans', sans-serif;
	font-size: 0.82rem;
	color: var(--her-text);
	cursor: pointer;
}

.her-ap-filter__option input { accent-color: var(--her-accent); cursor: pointer; }

/* Price inputs */

.her-ap-filter__body--price { flex-direction: column; gap: 10px; }

.her-ap-filter__price-label {
	display: flex;
	align-items: center;
	gap: 10px;
	font-family: 'Public Sans', sans-serif;
	font-size: 0.82rem;
	color: var(--her-text);
}

.her-ap-filter__price-label span { width: 24px; }

.her-ap-filter__price-input {
	flex: 1;
	border: 1px solid var(--her-border);
	border-radius: 0;
	padding: 6px 10px;
	font-family: 'Public Sans', sans-serif;
	font-size: 0.82rem;
	color: var(--her-dark);
	outline: none;
	transition: border-color 0.15s;
	width: 100%;
}

.her-ap-filter__price-input:focus { border-color: var(--her-accent); }

.her-ap-filter__apply {
	margin-top: 20px;
	background: var(--her-dark);
	color: #fff;
	border: none;
	padding: 11px 0;
	font-family: 'Montserrat', sans-serif;
	font-size: 0.68rem;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	cursor: pointer;
	transition: background 0.15s;
	width: 100%;
}

.her-ap-filter__apply:hover { background: var(--her-accent); }

/* ── Sort bar ───────────────────────────────────────────────────────────────── */

.her-ap-sort-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 28px;
	padding-bottom: 16px;
	border-bottom: 1px solid var(--her-border);
}

.her-ap-sort-bar__count {
	font-family: 'Public Sans', sans-serif;
	font-size: 0.82rem;
	color: var(--her-muted);
}

.her-ap-sort-bar__right {
	display: flex;
	align-items: center;
	gap: 10px;
}

.her-ap-sort-bar__label {
	font-family: 'Montserrat', sans-serif;
	font-size: 0.65rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--her-muted);
}

.her-ap-sort-bar__select {
	border: 1px solid var(--her-border);
	padding: 6px 28px 6px 10px;
	font-family: 'Public Sans', sans-serif;
	font-size: 0.82rem;
	color: var(--her-dark);
	background: #fff;
	appearance: auto;
	cursor: pointer;
	outline: none;
}

/* ── Product grid — override WooCommerce float layout ───────────────────────── */
/* WooCommerce injects a .woocommerce-notices-wrapper as the first child of
   any .woocommerce div. Since we apply the grid to .her-ap-grid (which IS
   the .woocommerce div), that notices div would consume the first grid cell.
   Fix: display:contents removes it from the grid flow; :empty hides it. */

.her-ap-grid .woocommerce-notices-wrapper {
	display: contents;
}

.her-ap-grid .woocommerce-notices-wrapper:empty {
	display: none;
}

/* WooCommerce default CSS uses float + percentage widths on ul.products and
   li.product. We must override with !important to enforce CSS Grid. */

.her-ap-grid ul.products,
.her-ap-grid ul.products.columns-3 {
	display: grid !important;
	grid-template-columns: repeat(3, 1fr) !important;
	gap: 40px 24px !important;
	float: none !important;
	width: 100% !important;
	list-style: none !important;
	margin: 0 !important;
	padding: 0 !important;
	clear: both !important;
}

/* WooCommerce adds clearfix ::before/::after to ul.products (display:table).
   In a CSS Grid these become real grid items and create empty cells. Nullify them. */
.her-ap-grid ul.products::before,
.her-ap-grid ul.products::after,
.her-ap-grid ul.products.columns-3::before,
.her-ap-grid ul.products.columns-3::after {
	content: none !important;
	display: none !important;
}

.her-ap-grid ul.products li.product,
.her-ap-grid ul.products.columns-3 li.product {
	float: none !important;
	width: auto !important;
	margin: 0 !important;
	clear: none !important;
	display: flex !important;
	flex-direction: column !important;
	position: relative !important;
}

/* Product image */
.her-ap-grid .product .woocommerce-loop-product__link,
.her-ap-grid .product > a:first-child {
	display: block;
	overflow: hidden;
	/* aspect-ratio creates a fixed 3:4 box before the image loads so
	   lazy-loaded images never cause a gray placeholder gap */
	/* aspect-ratio: 3 / 4; */
	/* background-color: var(--her-light-bg); */
}

.her-ap-grid .product .woocommerce-loop-product__link img,
.her-ap-grid .product > a:first-child img,
.her-ap-grid .product img {
	width: 100% !important;
	/* height: 100% !important; */
	object-fit: cover !important;
	display: block !important;
	transition: transform 0.35s;
}
/* h2.woocommerce-loop-product__title {
    text-align: center;
}
span.price {
    text-align: center;
	font-weight: 600;
} */
.her-ap-grid .product a:hover img { transform: scale(1.03); }

/* Product title */
.her-ap-grid .woocommerce-loop-product__title {
	font-family: 'Montserrat', sans-serif !important;
	font-size: 0.65rem !important;
	font-weight: 600 !important;
	letter-spacing: 0.1em !important;
	text-transform: uppercase !important;
	color: var(--her-dark) !important;
	margin: 14px 0 6px !important;
	padding: 0 !important;
	line-height: 1.4 !important;
}

/* Price */
.her-ap-grid .price {
	font-family: 'Public Sans', sans-serif !important;
	font-size: 0.88rem !important;
	color: var(--her-text) !important;
	margin-bottom: 10px !important;
}

.her-ap-grid .price del { color: var(--her-muted) !important; margin-right: 4px; }
.her-ap-grid .price ins { text-decoration: none !important; color: var(--her-dark) !important; }

/* Sale badge */
.her-ap-grid .onsale {
	font-family: 'Montserrat', sans-serif !important;
	font-size: 0.58rem !important;
	font-weight: 600 !important;
	letter-spacing: 0.08em !important;
	text-transform: uppercase !important;
	background: var(--her-accent) !important;
	color: #fff !important;
	padding: 3px 8px !important;
	border-radius: 0 !important;
	min-height: auto !important;
	min-width: auto !important;
	position: absolute !important;
	top: 10px !important;
	left: 10px !important;
	z-index: 1 !important;
	line-height: 1.4 !important;
}

/* Add to cart button — constrained so long Norwegian text stays single line */
.her-ap-grid .button,
.her-ap-grid a.button,
.her-ap-grid button.button {
	margin-top: auto !important;
	padding: 10px 8px !important;
	font-family: 'Montserrat', sans-serif !important;
	font-size: 0.6rem !important;
	font-weight: 600 !important;
	letter-spacing: 0.06em !important;
	text-transform: uppercase !important;
	background: none !important;
	border: 1px solid var(--her-border) !important;
	color: var(--her-dark) !important;
	text-decoration: none !important;
	text-align: center !important;
	cursor: pointer !important;
	transition: background 0.15s, color 0.15s, border-color 0.15s !important;
	display: block !important;
	width: 100% !important;
	box-sizing: border-box !important;
	line-height: 1.4 !important;
}

.her-ap-grid .button:hover,
.her-ap-grid a.button:hover {
	background: var(--her-dark) !important;
	color: #fff !important;
	border-color: var(--her-dark) !important;
}

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

.her-ap-pagination {
	display: flex;
	justify-content: center;
	gap: 4px;
	margin-top: 48px;
	font-family: 'Montserrat', sans-serif;
	font-size: 0.7rem;
	letter-spacing: 0.08em;
}

.her-ap-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 36px;
	height: 36px;
	padding: 0 8px;
	border: 1px solid var(--her-border);
	color: var(--her-dark);
	text-decoration: none;
	transition: background 0.15s, color 0.15s;
}

.her-ap-pagination .page-numbers.current,
.her-ap-pagination .page-numbers:hover {
	background: var(--her-dark);
	color: #fff;
	border-color: var(--her-dark);
}

.her-ap-empty {
	font-family: 'Public Sans', sans-serif;
	font-size: 1rem;
	color: var(--her-muted);
	padding: 48px 0;
	text-align: center;
	grid-column: 1 / -1;
}

/* ── Newsletter section ─────────────────────────────────────────────────────── */

.her-ap-newsletter {
	position: relative;
	background: var(--her-light-bg);
	padding: 64px 40px;
	text-align: center;
	overflow: hidden;
}

.her-ap-newsletter--has-image {
	min-height: 340px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 80px 40px;
}

.her-ap-newsletter__bg {
	position: absolute;
	inset: 0;
}

.her-ap-newsletter__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.her-ap-newsletter__overlay {
	position: absolute;
	inset: 0;
	background: rgba(0,0,0,.45);
}

.her-ap-newsletter__inner {
	position: relative;
	z-index: 1;
	max-width: 480px;
	margin: 0 auto;
}

.her-ap-newsletter--has-image .her-ap-newsletter__inner { color: #fff; }

.her-ap-newsletter__heading {
	font-family: 'Cormorant Garamond', serif;
	font-size: clamp(1.6rem, 3vw, 2.4rem);
	font-weight: 500;
	letter-spacing: 0.04em;
	margin: 0 0 12px;
}

.her-ap-newsletter__desc {
	font-family: 'Public Sans', sans-serif;
	font-size: 0.88rem;
	line-height: 1.7;
	opacity: 0.85;
	margin: 0 0 24px;
}

.her-ap-newsletter__form {
	display: flex;
	gap: 0;
	max-width: 380px;
	margin: 0 auto;
}

.her-ap-newsletter__input {
	flex: 1;
	border: 1px solid rgba(255,255,255,0.4);
	border-right: none;
	padding: 11px 16px;
	font-family: 'Public Sans', sans-serif;
	font-size: 0.85rem;
	background: rgba(255,255,255,0.12);
	color: #fff;
	outline: none;
}

.her-ap-newsletter__input::placeholder { color: rgba(255,255,255,0.6); }

.her-ap-newsletter__btn {
	background: var(--her-accent);
	color: #fff;
	border: none;
	padding: 11px 20px;
	font-family: 'Montserrat', sans-serif;
	font-size: 0.65rem;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	cursor: pointer;
	transition: background 0.15s;
	white-space: nowrap;
}

.her-ap-newsletter__btn:hover { background: var(--her-dark); }

/* ── Mobile ─────────────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
	.her-ap-hero__inner { padding: 32px 20px; }

	.her-ap-main {
		grid-template-columns: 1fr;
		padding: 24px 20px 48px;
		gap: 32px;
	}

	.her-ap-sidebar { position: static; }

	.her-ap-grid ul.products,
	.her-ap-grid ul.products.columns-3 {
		grid-template-columns: repeat(2, 1fr) !important;
		gap: 24px 12px !important;
	}

	.her-ap-grid .product img {
		height: 200px !important;
	}

	.her-ap-newsletter { padding: 48px 20px; }

	.her-ap-newsletter__form { flex-direction: column; }

	.her-ap-newsletter__input { border-right: 1px solid rgba(255,255,255,0.4); }
}
