/* ESDH Shop Template
 * Inherits Enfold's fonts. Colours follow the site tokens:
 * primary #015f9d, dark neutral #232c39, alternate background #f8f8f8, border #ebebeb.
 * Change the variables below to retheme. No padding-top on the first section.
 */

/* ---------- Enfold container override ---------- */

/* Desktop */
#top .container:has(.esdh-shop) {
    width: 94% !important;
    max-width: 1440px !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Tablet */
@media (max-width: 1024px) {
    #top .container:has(.esdh-shop) {
        width: 96% !important;
        max-width: 100% !important;
    }
}

/* Mobile */
@media (max-width: 767px) {
    #top .container:has(.esdh-shop) {
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
}

.esdh-shop {
	--esdh-primary: #015f9d;
	--esdh-primary-dark: #014a7b;
	--esdh-dark: #232c39;
	--esdh-bg-alt: #f8f8f8;
	--esdh-border: #ebebeb;
	--esdh-muted: #5c6470;
	--esdh-sticky-top: 120px;
	font-family: inherit;
	color: inherit;
}
.esdh-shop *,
.esdh-shop *::before,
.esdh-shop *::after { box-sizing: border-box; }

.esdh-shop h2,
.esdh-shop h3 { font-family: inherit; }

.esdh-shop-sr-only {
	position: absolute !important;
	width: 1px; height: 1px;
	margin: -1px; padding: 0;
	overflow: hidden; clip: rect(0, 0, 0, 0);
	white-space: nowrap; border: 0;
}
.esdh-shop-muted { color: var(--esdh-muted); }

/* ---------- Buttons ---------- */
#top .esdh-shop .esdh-shop-btn,
#top .esdh-shop .single_add_to_cart_button.esdh-shop-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 44px;
	margin: 0;
	padding: .7em 1em;
	border: 2px solid var(--esdh-primary);
	border-radius: 3px;
	background: var(--esdh-primary);
	color: #fff;
	font: inherit;
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition: background-color .15s, color .15s, border-color .15s;
}
#top .esdh-shop .esdh-shop-btn:hover,
#top .esdh-shop .esdh-shop-btn:focus-visible {
	background: var(--esdh-primary-dark);
	border-color: var(--esdh-primary-dark);
	color: #fff;
}
#top .esdh-shop .esdh-shop-btn--ghost {
	background: #fff;
	color: var(--esdh-primary);
}
#top .esdh-shop .esdh-shop-btn--ghost:hover,
#top .esdh-shop .esdh-shop-btn--ghost:focus-visible {
	background: var(--esdh-bg-alt);
	color: var(--esdh-primary-dark);
}
#top .esdh-shop .esdh-shop-btn.disabled,
#top .esdh-shop .esdh-shop-btn:disabled {
	opacity: .5;
	cursor: not-allowed;
}
#top .esdh-shop .esdh-shop-intro + .esdh-shop-hire .esdh-shop-btn,
#top .esdh-shop .esdh-shop-hire .esdh-shop-btn,
#top .esdh-shop .esdh-shop-help .esdh-shop-btn { width: auto; }
.esdh-shop :focus-visible { outline: 3px solid var(--esdh-primary); outline-offset: 2px; }
.esdh-shop a.loading { opacity: .6; }
.esdh-shop .added_to_cart {
	display: block;
	margin-top: 6px;
	font-size: .9em;
	color: var(--esdh-primary);
	text-decoration: underline !important;
}

/* ---------- Intro and banners (no padding-top on the first section) ---------- */
.esdh-shop-intro { margin: 0 0 24px; padding: 0; }
.esdh-shop-intro h2 { margin-top: 0; }
.esdh-shop-assure {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 24px;
	margin: 12px 0 0;
	padding: 0;
	list-style: none;
}
.esdh-shop-assure li {
	margin: 0;
	padding-left: 10px;
	border-left: 3px solid var(--esdh-primary);
}
.esdh-shop-hire,
.esdh-shop-help {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 16px 24px;
	padding: 24px;
	border: 1px solid var(--esdh-border);
	border-left: 5px solid var(--esdh-primary);
	border-radius: 4px;
	background: var(--esdh-bg-alt);
}
.esdh-shop-hire { margin: 0 0 32px; }
.esdh-shop-hire h2,
.esdh-shop-help h2 { margin: 0 0 6px; }
.esdh-shop-hire p,
.esdh-shop-help p { margin: 0; max-width: 85ch; }
.esdh-shop-hire > div,
.esdh-shop-hire > h2,
.esdh-shop-hire > p { flex: 1 1 100%; }
.esdh-shop-help { margin: 32px 0 0; }

/* ---------- Layout ---------- */
.esdh-shop-layout {
	display: grid;
	grid-template-columns: 260px minmax(0, 1fr);
	gap: 32px;
	align-items: start;
}
.esdh-shop-main { min-width: 0; }

/* ---------- Sidebar ---------- */
.esdh-shop-sidebar {
	position: sticky;
	top: var(--esdh-sticky-top);
}
.esdh-shop-filters-toggle { display: none; }
@media (min-width: 901px) {
	.esdh-shop-filters {
		max-height: calc(100vh - var(--esdh-sticky-top) - 16px);
		max-height: calc(100dvh - var(--esdh-sticky-top) - 16px);
		overflow-y: auto;
		overscroll-behavior-y: contain;
		scrollbar-gutter: stable;
		padding-right: 8px;
	}
}
.esdh-shop-filter {
	margin: 0 0 24px;
	padding: 0;
	border: 0;
	min-width: 0;
}
.esdh-shop-filter__title {
	display: block;
	margin: 0 0 8px;
	padding: 0;
	font-size: 1.1em;
	font-weight: 700;
	line-height: 1.2;
}
#top .esdh-shop .esdh-shop-filters input[type="search"] {
	width: 100%;
	margin: 0;
	padding: .65em .8em;
	border: 1px solid #a9b8c5;
	border-radius: 3px;
	background: #fff;
	font: inherit;
}
.esdh-shop-check {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin: 0;
	padding: 5px 0;
	cursor: pointer;
	line-height: 1.35;
}
.esdh-shop-check input {
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
	margin: 1px 0 0;
	accent-color: var(--esdh-primary);
}
.esdh-shop-check--depth-1 { padding-left: 18px; }
.esdh-shop-check--depth-2 { padding-left: 36px; }
.esdh-shop-check--depth-3 { padding-left: 54px; }
#top .esdh-shop .esdh-shop-clear {
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: var(--esdh-primary);
	font: inherit;
	text-decoration: underline;
	cursor: pointer;
}

/* ---------- Toolbar ---------- */
.esdh-shop-results { transition: opacity .15s; }
.esdh-shop-results[aria-busy="true"] { opacity: .5; pointer-events: none; }
.esdh-shop-results:focus { outline: none; }
.esdh-shop-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin: 0 0 16px;
}
.esdh-shop-count { margin: 0; color: var(--esdh-muted); }
.esdh-shop-sort { display: inline-flex; align-items: center; gap: 8px; margin: 0; }
#top .esdh-shop .esdh-shop-sort select {
	margin: 0;
	padding: .45em .7em;
	border: 1px solid #a9b8c5;
	border-radius: 3px;
	font: inherit;
}

/* ---------- Groups ---------- */
.esdh-shop-group {
	margin: 0 0 28px;
	border: 1px solid var(--esdh-border);
	border-radius: 6px;
	background: #fff;
	overflow: hidden;
	container-type: inline-size;
}
.esdh-shop-group__head {
	padding: 20px 24px;
	border-bottom: 1px solid var(--esdh-border);
	background: var(--esdh-bg-alt);
}
.esdh-shop-group__head h2 { margin: 0; }
.esdh-shop-group__cont { font-size: .6em; font-weight: 400; color: var(--esdh-muted); }
.esdh-shop-group__desc { margin-top: 6px; color: var(--esdh-muted); }
.esdh-shop-group__desc p { margin: 0; }

/* ---------- Card ---------- */
.esdh-shop-card {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	grid-template-areas: "media" "copy" "buy" "details";
	gap: 14px 24px;
	padding: clamp(16px, 2.5vw, 28px);
	border-top: 1px solid var(--esdh-border);
}
.esdh-shop-group__head + .esdh-shop-card { border-top: 0; }
.esdh-shop-card__media { grid-area: media; min-width: 0; }
.esdh-shop-card__copy { grid-area: copy; min-width: 0; }
.esdh-shop-card__buy { grid-area: buy; min-width: 0; }
.esdh-shop-details { grid-area: details; min-width: 0; }

.esdh-shop-card__image-link,
.esdh-shop-card__placeholder {
	display: grid;
	place-items: center;
	width: 100%;
	height: 240px;
	padding: 14px;
	border: 1px solid var(--esdh-border);
	border-radius: 8px;
	background: #fff;
	overflow: hidden;
}
.esdh-shop-card__image {
	display: block;
	width: 100%;
	height: 100%;
	max-width: 100%;
	object-fit: contain;
}
.esdh-shop-card__placeholder {
	text-align: center;
	font-size: .85em;
	font-weight: 500;
	line-height: 1.4;
	color: var(--esdh-muted);
}

.esdh-shop-card__title { margin: 0 0 10px; font-size: 1.6em; line-height: 1.15; }
.esdh-shop-card__title a { color: inherit; text-decoration: none; }
.esdh-shop-card__title a:hover { color: var(--esdh-primary); }
.esdh-shop-card__desc { color: var(--esdh-muted); line-height: 1.55; }
.esdh-shop-card__desc > :first-child { margin-top: 0; }
.esdh-shop-card__desc > :last-child { margin-bottom: 0; }

.esdh-shop-card__sku { margin: 0 0 6px; font-size: .85em; color: var(--esdh-muted); }
.esdh-shop-card__sku[hidden] { display: none; }
.esdh-shop-price { margin: 0 0 12px; font-size: 1.35em; font-weight: 700; line-height: 1.2; }
.esdh-shop-price .price { font: inherit; }
.esdh-shop-price .woocommerce-price-suffix,
.esdh-shop-price small { display: block; font-size: .6em; font-weight: 400; color: var(--esdh-muted); }
.esdh-shop-price__request { font-size: .75em; font-weight: 600; color: var(--esdh-muted); }
.esdh-shop-card__actions { display: grid; gap: 8px; }
.esdh-shop-stock { margin: 0; font-weight: 600; color: var(--esdh-muted); }

/* Variation dropdowns */
.esdh-shop-variations { margin: 0; }
.esdh-shop-variations__fields { display: grid; gap: 8px; margin: 0 0 8px; }
.esdh-shop-field label { display: block; margin: 0 0 3px; font-size: .85em; font-weight: 600; }
#top .esdh-shop .esdh-shop-field select {
	width: 100%;
	margin: 0;
	padding: .55em .7em;
	border: 1px solid #a9b8c5;
	border-radius: 3px;
	background-color: #fff;
	font: inherit;
}
.esdh-shop .reset_variations { font-size: .85em; text-decoration: underline !important; }
.esdh-shop .single_variation_wrap { display: grid; gap: 8px; }
.esdh-shop .woocommerce-variation-price,
.esdh-shop .woocommerce-variation-description { display: none; }
.esdh-shop .woocommerce-variation-availability { font-size: .85em; }
.esdh-shop .woocommerce-variation-availability p { margin: 0; }
.esdh-shop .woocommerce-variation-add-to-cart { display: grid; gap: 8px; }

/* Grouped products */
.esdh-shop-grouped { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.esdh-shop-grouped__item { display: grid; gap: 4px; margin: 0; padding: 0 0 10px; border-bottom: 1px solid var(--esdh-border); }
.esdh-shop-grouped__name { font-weight: 600; color: inherit; text-decoration: none; }
.esdh-shop-grouped__price { font-size: .95em; }

/* Specifications */
.esdh-shop-details {
	padding-top: 12px;
	border-top: 1px solid var(--esdh-border);
	font-size: .95em;
}
.esdh-shop-details summary { cursor: pointer; font-weight: 600; color: var(--esdh-primary); }
.esdh-shop-specs { margin: 10px 0 0; }
.esdh-shop-specs__row {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
	gap: 8px;
	padding: 6px 0;
	overflow-wrap: anywhere;
}
.esdh-shop-specs__row + .esdh-shop-specs__row { border-top: 1px solid var(--esdh-border); }
.esdh-shop-specs dt { font-weight: 600; }
.esdh-shop-specs dd { margin: 0; }
.esdh-shop-datasheet { margin: 10px 0 0; }
.esdh-shop-details p { margin: 10px 0 0; }

@container (min-width: 540px) {
	.esdh-shop-card {
		grid-template-columns: minmax(150px, 190px) minmax(0, 1fr);
		grid-template-areas: "media copy" "media buy" "media details";
		grid-template-rows: auto auto 1fr;
	}
	.esdh-shop-card__image-link,
	.esdh-shop-card__placeholder { height: 280px; }
}
@container (min-width: 760px) {
	.esdh-shop-card {
		grid-template-columns: minmax(190px, 240px) minmax(0, 1fr) minmax(170px, 210px);
		grid-template-areas: "media copy buy" "media details details";
		grid-template-rows: auto 1fr;
	}
	.esdh-shop-card__image-link,
	.esdh-shop-card__placeholder { height: 300px; }
}

/* ---------- Empty state ---------- */
.esdh-shop-empty {
	padding: 40px 24px;
	border: 1px dashed var(--esdh-border);
	border-radius: 6px;
	text-align: center;
}
.esdh-shop-empty h2 { margin-top: 0; }
#top .esdh-shop .esdh-shop-empty .esdh-shop-btn { width: auto; }

/* ---------- Pagination ---------- */
.esdh-shop-pagination ul {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 6px;
	margin: 8px 0 0;
	padding: 0;
	list-style: none;
}
.esdh-shop-pagination li { margin: 0; padding: 0; }
.esdh-shop-page-gap { align-self: center; padding: 0 4px; color: var(--esdh-muted); }
#top .esdh-shop .esdh-shop-page {
	min-width: 40px;
	min-height: 40px;
	margin: 0;
	padding: .4em .8em;
	border: 1px solid var(--esdh-border);
	border-radius: 3px;
	background: #fff;
	color: inherit;
	font: inherit;
	cursor: pointer;
}
#top .esdh-shop .esdh-shop-page:hover { border-color: var(--esdh-primary); color: var(--esdh-primary); }
#top .esdh-shop .esdh-shop-page.is-current {
	border-color: var(--esdh-primary);
	background: var(--esdh-primary);
	color: #fff;
	cursor: default;
}

/* ---------- Toast (placeholder buttons) ---------- */
.esdh-shop-toast {
	position: fixed;
	left: 50%;
	bottom: 24px;
	z-index: 9999;
	max-width: calc(100% - 32px);
	padding: 12px 18px;
	border-radius: 3px;
	background: var(--esdh-dark, #232c39);
	color: #fff;
	opacity: 0;
	pointer-events: none;
	transform: translate(-50%, 20px);
	transition: opacity .2s, transform .2s;
}
.esdh-shop-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Mobile ---------- */
@media (max-width: 900px) {
	.esdh-shop-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; }
	.esdh-shop-sidebar { position: static; }
	#top .esdh-shop .esdh-shop-filters-toggle {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 100%;
		min-height: 44px;
		margin: 0;
		padding: .6em 1em;
		border: 1px solid var(--esdh-primary);
		border-radius: 3px;
		background: #fff;
		color: var(--esdh-primary);
		font: inherit;
		font-weight: 600;
		cursor: pointer;
	}
	.esdh-shop-filters { display: none; padding-top: 16px; }
	.esdh-shop-sidebar.is-open .esdh-shop-filters { display: block; }
}
@media (max-width: 480px) {
	.esdh-shop-hire,
	.esdh-shop-help { padding: 18px; }
	#top .esdh-shop .esdh-shop-hire .esdh-shop-btn,
	#top .esdh-shop .esdh-shop-help .esdh-shop-btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
	.esdh-shop-results,
	.esdh-shop-toast,
	#top .esdh-shop .esdh-shop-btn { transition: none; }
}
