/* Shared surfaces for the catalog, account, product details and comparison. */

.erv-storefront {
	--erv-panel: #f3f9fb;
	--erv-panel-blue: #e6f4f7;
	--erv-panel-edge: #d7e8ee;
	--erv-card-radius: .75rem;
	--erv-card-padding: clamp(1.05rem, 3vw, 2rem);
}

.erv-storefront :is(#erv-comparison-heading, .woocommerce-products-header h1, .entry-header h1, .product_title) {
	letter-spacing: -.025em;
}

.erv-storefront:is(.erv-archive, .erv-account, .erv-product) #primary {
	float: none;
	width: 100%;
	margin-inline: 0;
}

.erv-storefront:is(.erv-archive, .erv-account, .erv-product) :is(#primary, #main.site-main) {
	margin-bottom: 0;
}

.erv-storefront:is(.erv-archive, .erv-account, .erv-product) .storefront-breadcrumb {
	margin-bottom: 0;
	padding-block: 1.05rem .2rem;
}

.erv-storefront:is(.erv-archive, .erv-account, .erv-product) .woocommerce-breadcrumb {
	color: var(--erv-muted);
}

.erv-storefront:is(.erv-archive, .erv-account, .erv-product) .woocommerce-breadcrumb a {
	color: var(--erv-teal);
	text-decoration: none;
}

/* Edition comparison on the home page. */

.erv-storefront .erv-shop-comparison {
	margin-top: clamp(2.5rem, 5vw, 4rem);
	padding: var(--erv-card-padding);
	border: 1px solid var(--erv-panel-edge);
	border-radius: 1rem;
	background: linear-gradient(118deg, #f1f8fb, #f7fbfd 66%, #eef4fa);
}

.erv-storefront #erv-comparison-heading {
	margin: 0 0 1.12rem;
	color: var(--erv-navy);
}

.erv-storefront .erv-shop-comparison .erv-shop-table-scroll {
	border: 1px solid var(--erv-panel-edge);
	border-radius: var(--erv-card-radius);
	background: #fff;
	overscroll-behavior-inline: contain;
}

.erv-storefront .erv-shop-comparison-table {
	min-width: 42rem;
}

.erv-storefront .erv-shop-comparison-table :is(th, td) {
	padding: .84rem .9rem;
	border-color: var(--erv-panel-edge);
	background: #fff;
	vertical-align: middle;
}

.erv-storefront .erv-shop-comparison-table thead th {
	border-bottom: 2px solid #1094ad;
	background: var(--erv-teal);
	color: #fff;
	font-size: .99rem;
}

.erv-storefront .erv-shop-comparison-table thead th:not(:last-child) {
	border-right: 1px solid rgb(255 255 255 / 14%);
}

.erv-storefront .erv-shop-comparison-table tbody th {
	width: 23%;
	background: #f1f8fb;
	color: var(--erv-navy);
}

.erv-storefront .erv-shop-comparison-table tbody td:not(:last-child) {
	border-right: 1px solid #e8f1f5;
}

.erv-storefront .erv-shop-comparison-table tbody tr:not(:last-child) td {
	background: #fff;
}

.erv-storefront .erv-shop-comparison-table tbody tr:last-child > * {
	background: #eaf6f8;
}

.erv-storefront .erv-shop-comparison-table td a {
	display: inline-flex;
	gap: .2rem;
	align-items: baseline;
	color: var(--erv-teal-dark);
	font-size: 1rem;
	text-decoration: none;
}

.erv-storefront .erv-shop-comparison-table td a:hover {
	text-decoration: underline;
}

.erv-storefront .erv-shop-comparison-table a small {
	font-weight: 400;
}

/* Product catalog and related product cards share the same treatment. */

.erv-archive .woocommerce-products-header {
	margin: 0 0 1.3rem;
	padding: clamp(1.2rem, 3vw, 2.2rem) var(--erv-card-padding);
	border: 1px solid var(--erv-panel-edge);
	border-radius: var(--erv-card-radius);
	background: linear-gradient(118deg, #f1f8fa, #eaf4f8 70%, #eff2fa);
}

.erv-archive .woocommerce-products-header h1 {
	margin: 0;
	color: var(--erv-navy);
	font-size: clamp(1.7rem, 4vw, 2.7rem);
}

.erv-archive .woocommerce-products-header .term-description {
	margin-top: .55rem;
	color: var(--erv-muted);
}

.erv-archive .woocommerce-products-header .term-description > :last-child {
	margin-bottom: 0;
}

.erv-archive .storefront-sorting {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: .65rem 1rem;
	flex-wrap: wrap;
	margin-bottom: 1rem;
}

.erv-archive .storefront-sorting::before,
.erv-archive .storefront-sorting::after {
	display: none;
}

.erv-archive .storefront-sorting :is(.woocommerce-ordering, .woocommerce-result-count, .woocommerce-pagination) {
	float: none;
	margin: 0;
}

.erv-archive .woocommerce-result-count {
	order: 1;
	flex: 1;
	font-size: .9rem;
	color: var(--erv-muted);
}

.erv-archive .storefront-sorting .woocommerce-ordering {
	order: 2;
}

.erv-archive .storefront-sorting .woocommerce-pagination {
	order: 3;
}

.erv-archive .erv-catalog-filter {
	order: -1;
	flex: 1 0 100%;
	margin: 0;
	padding: .8rem 1rem;
	border-color: var(--erv-panel-edge);
	border-radius: var(--erv-card-radius);
	background: var(--erv-panel);
}

.erv-archive :is(.woocommerce-ordering, .erv-catalog-filter) select {
	min-height: 2.55rem;
	max-width: 100%;
	padding: .34rem .55rem;
	border: 1px solid #a9cad5;
	border-radius: .4rem;
	background: #fff;
	color: var(--erv-ink);
}

.erv-archive .erv-catalog-filter button {
	min-height: 2.55rem;
	padding-inline: 1rem;
	border-radius: .4rem;
	background: var(--erv-teal);
	color: #fff;
	font-size: .9rem;
	font-weight: 700;
}

.erv-archive .erv-catalog-filter button:hover {
	background: var(--erv-teal-dark);
}

.erv-storefront:is(.erv-archive, .erv-product) ul.products {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
	gap: clamp(.85rem, 2vw, 1.4rem);
	margin: 0 0 1.25rem;
}

.erv-storefront:is(.erv-archive, .erv-product) ul.products::before,
.erv-storefront:is(.erv-archive, .erv-product) ul.products::after {
	display: none;
}

.erv-storefront:is(.erv-archive, .erv-product) #main ul.products > li.product {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	width: auto;
	min-width: 0;
	float: none;
	margin: 0;
	padding: .85rem;
	border: 1px solid var(--erv-panel-edge);
	border-radius: var(--erv-card-radius);
	background: #fff;
	text-align: left;
}

.erv-storefront:is(.erv-archive, .erv-product) li.product:hover {
	border-color: #9dcbd8;
}

.erv-storefront:is(.erv-archive, .erv-product) li.product .woocommerce-loop-product__link {
	display: flex;
	flex: 1;
	flex-direction: column;
	width: 100%;
	color: var(--erv-ink);
	text-decoration: none;
}

.erv-storefront:is(.erv-archive, .erv-product) li.product .woocommerce-loop-product__link img {
	width: 100%;
	height: clamp(8.7rem, 15vw, 10.3rem);
	margin: 0 0 .75rem;
	box-sizing: border-box;
	padding: .45rem;
	border-radius: .45rem;
	background: var(--erv-panel);
	object-fit: contain;
}

.erv-storefront:is(.erv-archive, .erv-product) li.product .woocommerce-loop-product__title {
	margin: 0 0 .55rem;
	font-size: clamp(1rem, 1.5vw, 1.13rem);
	line-height: 1.32;
}

.erv-storefront:is(.erv-archive, .erv-product) li.product .price {
	margin: auto 0 .8rem;
	color: var(--erv-teal-dark);
	font-size: 1.17rem;
	font-weight: 700;
}

.erv-storefront:is(.erv-archive, .erv-product) li.product :is(.button, .added_to_cart) {
	display: inline-flex;
	align-items: center;
	min-height: 2.6rem;
	margin: 0;
	padding: .46rem .8rem;
	border: 1px solid #bddbe4;
	border-radius: .42rem;
	background: var(--erv-panel);
	color: var(--erv-teal-dark);
	font-size: .9rem;
	font-weight: 700;
	line-height: 1.35;
	text-decoration: none;
}

.erv-storefront:is(.erv-archive, .erv-product) li.product :is(.button, .added_to_cart):hover {
	border-color: var(--erv-teal);
	background: var(--erv-teal);
	color: #fff;
}

.erv-storefront:is(.erv-archive, .erv-product) li.product .added_to_cart {
	margin-top: .35rem;
}

.erv-storefront:is(.erv-archive, .erv-product) :is(.woocommerce-price-suffix, del) {
	color: var(--erv-muted);
	font-weight: 400;
}

/* The account keeps WooCommerce's own forms and endpoints. */

.erv-account #primary article.page {
	margin-bottom: 0;
}

.erv-account #primary .entry-header {
	margin-bottom: clamp(1rem, 3vw, 1.6rem);
	padding: 1.35rem var(--erv-card-padding);
	border: 1px solid var(--erv-panel-edge);
	border-radius: var(--erv-card-radius);
	background: linear-gradient(122deg, #eaf6f8, #f1f6fc);
}

.erv-account .entry-header h1 {
	margin: 0;
	color: var(--erv-navy);
	font-size: clamp(1.85rem, 4vw, 2.65rem);
}

.erv-account #customer_login {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: clamp(.9rem, 3vw, 1.55rem);
	align-items: start;
	float: none;
	width: 100%;
	margin: 0;
}

.erv-account #customer_login::before,
.erv-account #customer_login::after {
	display: none;
}

.erv-storefront.erv-account .woocommerce #customer_login > :is(.col-1, .col-2) {
	float: none;
	width: 100%;
	min-width: 0;
	max-width: none;
	margin: 0;
}

.erv-account :is(#customer_login > div, .woocommerce-MyAccount-content, form.lost_reset_password, form.woocommerce-ResetPassword, form.login:not(#customer_login form)) {
	padding: var(--erv-card-padding);
	border: 1px solid var(--erv-panel-edge);
	border-radius: var(--erv-card-radius);
	background: #fff;
}

.erv-account #customer_login h2 {
	margin: 0 0 .95rem;
	color: var(--erv-navy);
	font-size: 1.45rem;
}

.erv-account #customer_login form {
	margin: 0;
	padding: 0;
	border: 0;
}

.erv-account :is(form.lost_reset_password, form.woocommerce-ResetPassword, form.login:not(#customer_login form)) {
	max-width: 37rem;
}

.erv-account .woocommerce form :is(.input-text, select) {
	min-height: 2.8rem;
	padding: .57rem .72rem;
	border: 1px solid #a9c5cf;
	border-radius: .42rem;
	background: #fbfdfe;
	color: var(--erv-ink);
	box-shadow: none;
}

.erv-account .woocommerce form label {
	font-weight: 700;
}

.erv-account .woocommerce form .show-password-input {
	border-radius: 0 .42rem .42rem 0;
	background: var(--erv-panel-blue);
	color: var(--erv-teal-dark);
}

.erv-account .woocommerce-form-login .form-row:has(> button[name="login"]) {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: .6rem .9rem;
}

.erv-account .woocommerce-form-login button[name="login"] {
	order: -1;
	margin: 0;
}

.erv-account .woocommerce :is(button[name="login"], button[name="register"], button[name="save_account_details"], button[name="save_address"], form.lost_reset_password button) {
	min-height: 2.65rem;
	padding: .55rem 1.15rem;
	border-radius: .42rem;
	background: var(--erv-teal);
	color: #fff;
}

.erv-account .woocommerce :is(button[name="login"], button[name="register"], button[name="save_account_details"], button[name="save_address"], form.lost_reset_password button):hover {
	background: var(--erv-teal-dark);
}

.erv-account .entry-content .woocommerce:has(> .woocommerce-MyAccount-navigation) {
	display: grid;
	grid-template-columns: minmax(11.5rem, 15rem) minmax(0, 1fr);
	gap: 1.15rem;
	align-items: start;
}

.erv-account .entry-content .woocommerce:has(> .woocommerce-MyAccount-navigation)::before,
.erv-account .entry-content .woocommerce:has(> .woocommerce-MyAccount-navigation)::after {
	display: none;
}

.erv-account .woocommerce > :is(.woocommerce-notices-wrapper, .woocommerce-message, .woocommerce-info, .woocommerce-error) {
	grid-column: 1 / -1;
}

.erv-account .woocommerce > .woocommerce-notices-wrapper:empty {
	display: none;
}

.erv-account :is(.woocommerce-MyAccount-navigation, .woocommerce-MyAccount-content) {
	float: none;
	width: auto;
	min-width: 0;
	margin: 0;
}

.erv-account .woocommerce-MyAccount-navigation ul {
	display: grid;
	gap: .25rem;
	margin: 0;
	padding: .48rem;
	border: 1px solid var(--erv-panel-edge);
	border-radius: var(--erv-card-radius);
	background: var(--erv-panel);
	list-style: none;
}

.erv-storefront.erv-account .woocommerce-MyAccount-navigation ul li {
	margin: 0;
	border: 0;
}

.erv-account #primary .woocommerce-MyAccount-navigation ul li a {
	display: block;
	padding: .63rem .72rem;
	border-radius: .42rem;
	color: var(--erv-navy);
	font-weight: 700;
	line-height: 1.35;
	text-decoration: none;
}

.erv-account .woocommerce-MyAccount-navigation li a::before {
	color: inherit;
	opacity: .68;
}

.erv-account #primary .woocommerce-MyAccount-navigation li a:hover {
	background: #dfedf3;
}

.erv-account #primary .woocommerce-MyAccount-navigation ul li.is-active a {
	background: var(--erv-teal);
	color: #fff;
}

.erv-account .woocommerce-MyAccount-content > :last-child {
	margin-bottom: 0;
}

.erv-account .erv-account-downloads {
	margin-top: 1.15rem;
}

.erv-account .woocommerce-MyAccount-content table :is(th, td) {
	border-color: var(--erv-panel-edge);
	background: #fff;
	overflow-wrap: anywhere;
}

.erv-account .woocommerce-MyAccount-content table thead th {
	background: var(--erv-panel-blue);
	color: var(--erv-navy);
}

/* Storefront retains the standard WooCommerce single-product templates. */

.erv-product .site-main > .product.type-product {
	position: relative;
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
	gap: clamp(1.1rem, 3vw, 2rem);
	align-items: start;
}

.erv-product .site-main > .product.type-product::before,
.erv-product .site-main > .product.type-product::after {
	display: none;
}

.erv-product .site-main > .product.type-product > :not(.woocommerce-product-gallery, .entry-summary, .onsale) {
	grid-column: 1 / -1;
}

.erv-product .site-main > .product.type-product > .onsale {
	position: absolute;
	top: .75rem;
	left: .75rem;
	z-index: 1;
	background: #fff;
}

.erv-product .product.type-product > :is(.woocommerce-product-gallery, .summary.entry-summary) {
	float: none;
	width: auto;
	min-width: 0;
	margin: 0;
	padding: var(--erv-card-padding);
	border: 1px solid var(--erv-panel-edge);
	border-radius: var(--erv-card-radius);
}

.erv-product .product.type-product > .woocommerce-product-gallery {
	grid-area: 1 / 1;
	background: linear-gradient(136deg, #f2f8fb, #eaf5f8);
}

.erv-product .product.type-product .woocommerce-product-gallery__image a img {
	display: block;
	width: 100%;
	max-width: min(100%, 25rem);
	margin-inline: auto;
}

.erv-product .summary.entry-summary {
	grid-area: 1 / 2;
	background: #fff;
}

.erv-product .summary .product_title {
	margin: 0 0 .85rem;
	color: var(--erv-navy);
	font-size: clamp(1.65rem, 3.2vw, 2.55rem);
	line-height: 1.13;
	text-wrap: pretty;
}

.erv-storefront.erv-product .product.type-product .summary > .price {
	margin: 0 0 1rem;
	color: var(--erv-teal-dark);
	font-size: clamp(1.4rem, 2.5vw, 1.85rem);
	font-weight: 700;
}

.erv-product .summary .price small {
	font-size: .85rem;
}

.erv-product .summary .woocommerce-product-details__short-description {
	color: var(--erv-muted);
}

.erv-product .summary form.cart {
	margin: 1.12rem 0 0;
	padding: .95rem 0 0;
	border: 0;
	border-top: 1px solid var(--erv-panel-edge);
}

.erv-product .summary form.cart :is(.single_add_to_cart_button, input.qty) {
	min-height: 2.85rem;
	border-radius: .42rem;
}

.erv-product .summary form.cart input.qty {
	border: 1px solid #a9c5cf;
	background: var(--erv-panel);
	color: var(--erv-ink);
	box-shadow: none;
}

.erv-product .product_meta {
	margin-top: 1rem;
	padding-top: .75rem;
	border-top: 1px solid var(--erv-panel-edge);
	color: var(--erv-muted);
	font-size: .88rem;
}

.erv-product .storefront-product-pagination {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: .75rem;
}

.erv-product .storefront-product-pagination a[rel] {
	position: static;
	display: flex;
	align-items: center;
	gap: .65rem;
	width: auto;
	min-width: 0;
	max-width: none;
	padding: .6rem;
	border: 1px solid var(--erv-panel-edge);
	border-radius: .5rem;
	background: var(--erv-panel);
	color: var(--erv-teal-dark);
	text-decoration: none;
}

.erv-product .storefront-product-pagination a[rel] img {
	position: static;
	float: none;
	width: 2.8rem;
	margin: 0;
}

.erv-product .storefront-product-pagination__title {
	line-height: 1.35;
}

.erv-product .storefront-sticky-add-to-cart {
	border-bottom: 1px solid var(--erv-panel-edge);
	background: #fff;
}

.erv-product .woocommerce-tabs {
	padding: var(--erv-card-padding);
	border: 1px solid var(--erv-panel-edge);
	border-radius: var(--erv-card-radius);
	background: #fff;
}

.erv-product .woocommerce-tabs ul.tabs {
	float: none;
	display: flex;
	width: auto;
	margin: 0 0 1.2rem;
	padding: 0;
	border: 0;
	border-bottom: 1px solid var(--erv-panel-edge);
	gap: .4rem;
	flex-wrap: wrap;
	list-style: none;
}

.erv-product .woocommerce-tabs ul.tabs li {
	margin: 0;
	border: 0;
}

.erv-product .woocommerce-tabs ul.tabs li::after {
	display: none;
}

.erv-product .woocommerce-tabs ul.tabs li a {
	display: block;
	padding: .55rem .65rem;
	border-bottom: 2px solid transparent;
	color: var(--erv-teal-dark);
	font-weight: 700;
	text-decoration: none;
}

.erv-product .woocommerce-tabs ul.tabs li.active a {
	border-bottom-color: var(--erv-accent);
}

.erv-product .woocommerce-tabs .panel {
	float: none;
	clear: both;
	width: auto;
	margin: 0;
}

.erv-product .woocommerce-tabs .panel > :last-child {
	margin-bottom: 0;
}

.erv-product :is(.related.products, .upsells.products) > h2 {
	margin: 0 0 1rem;
	text-align: left;
}

@media (max-width: 759px) {
	.erv-storefront .erv-shop-comparison {
		padding: 1rem;
	}

	.erv-storefront .erv-shop-comparison-table tbody th {
		width: auto;
	}

	.erv-storefront .erv-shop-comparison-table th:first-child {
		position: sticky;
		left: 0;
		z-index: 1;
	}

	.erv-account #customer_login,
	.erv-account .entry-content .woocommerce:has(> .woocommerce-MyAccount-navigation),
	.erv-product .site-main > .product.type-product,
	.erv-product .storefront-product-pagination {
		grid-template-columns: minmax(0, 1fr);
	}

	.erv-account .woocommerce-MyAccount-navigation ul {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.erv-product .product.type-product > :is(.woocommerce-product-gallery, .summary.entry-summary) {
		grid-area: auto;
	}
}
