/*
 * Shop page styles, ported from norsan-theme/scss/mobile.scss (.udi_* blocks).
 *
 * Values are the .cz ones, including its Dosis headings and 1860px container.
 */

/* Dosis, copied from norsan-theme/fonts — the heading face the .cz shop uses. */
@font-face {
	font-family: 'Dosis';
	font-style: normal;
	font-weight: 300;
	font-display: swap;
	src: url('fonts/dosis-v34-latin_latin-ext-300.woff2') format('woff2');
}
@font-face {
	font-family: 'Dosis';
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url('fonts/dosis-v34-latin_latin-ext-regular.woff2') format('woff2');
}
@font-face {
	font-family: 'Dosis';
	font-style: normal;
	font-weight: 500;
	font-display: swap;
	src: url('fonts/dosis-v34-latin_latin-ext-500.woff2') format('woff2');
}
@font-face {
	font-family: 'Dosis';
	font-style: normal;
	font-weight: 600;
	font-display: swap;
	src: url('fonts/dosis-v34-latin_latin-ext-600.woff2') format('woff2');
}
@font-face {
	font-family: 'Dosis';
	font-style: normal;
	font-weight: 700;
	font-display: swap;
	src: url('fonts/dosis-v34-latin_latin-ext-700.woff2') format('woff2');
}

.norsan-shop-layout .norsan_shop {
	--norsan-shop-width: 1860px;
	--norsan-brand: #004272;
	--norsan-brand-soft: #5994b9;
	--norsan-border: #eef2f4;
	--norsan-button: #025188;
	--norsan-price: #d95f23;
	--norsan-card-title-size: 26px;
	--norsan-heading-font: 'Dosis', sans-serif;

	flex: 1 1 100%;
	min-width: 0;
}

/*
 * GeneratePress wraps content in a 1400px .grid-container and lays #content out with flex.
 * Both horizontal paddings go to zero: #page is already inset to the same width the .cz
 * body reaches with its own 30px padding, so any extra here narrows every card.
 */
.norsan-shop-layout #page.grid-container {
	max-width: 100%;
	padding-left: 0;
	padding-right: 0;
}

/* GeneratePress leaves vertical rhythm to the page templates, which this one replaces. */
.norsan-shop-layout .site-content {
	padding: 40px 0 0;
}

/* --- Header ------------------------------------------------------------------------- */

.norsan_shop .udi_breadcrumbs {
	color: var(--norsan-brand);
	font-size: 19px;
	display: flex;
	gap: 8px;
	align-items: center;
	max-width: var(--norsan-shop-width);
	margin: 0 auto 50px;
}

.norsan_shop .udi_breadcrumbs a {
	color: inherit;
	text-decoration: none;
}

.norsan_shop .h1-wrapper {
	max-width: var(--norsan-shop-width);
	width: 100%;
	margin: auto;
}

.norsan_shop .shop-h1 {
	color: #5994b969;
	font-size: 55px;
	font-family: var(--norsan-heading-font);
	line-height: 1.1;
	margin: 0 0 20px;
}

.norsan_shop .udi_products_main {
	display: grid;
	grid-template-columns: 1fr 4fr;
	grid-gap: 30px;
	max-width: var(--norsan-shop-width);
	margin: 0 auto 110px;
}

/* --- Sidebar ----------------------------------------------------------------------- */

.norsan_shop .udi_products_main_sidebar {
	padding: 40px 30px;
	border: 1px solid var(--norsan-border);
	border-radius: 10px;
	height: fit-content;
	/*
	 * Rides along with the page. align-self keeps the grid item from stretching, so the
	 * sticky box is short enough to actually move inside its full-height grid area.
	 */
	position: sticky;
	top: 30px;
	align-self: start;
	max-height: calc(100vh - 60px);
	overflow-y: auto;
}

.norsan_shop .udi_products_main_sidebar h2 {
	margin: 0 0 50px;
	color: var(--norsan-brand-soft);
	font-family: var(--norsan-heading-font);
	font-weight: 600;
	font-size: 21px;
}

.norsan_shop .udi_products_main_sidebar ul {
	padding: 0;
	margin: 0;
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.norsan_shop .udi_products_main_sidebar li a,
.norsan_shop .udi_products_main_sidebar li span {
	font-size: 19px;
	color: var(--norsan-brand);
	font-weight: 400;
	text-decoration: none;
}

.norsan_shop .udi_products_main_sidebar li.active a,
.norsan_shop .udi_products_main_sidebar li.active span {
	font-weight: 600;
}

/* --- Grid -------------------------------------------------------------------------- */

/* Four across, so each row is the category tile plus three product cards. */
.norsan_shop .udi_products_main_grid__cat {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	grid-gap: 30px;
	margin-bottom: 30px;
}

.norsan_shop .grid_elem {
	position: relative;
	border-radius: 10px;
	border: 1px solid var(--norsan-border);
	display: flex;
	flex-direction: column;
	justify-content: space-between;
}

.norsan_shop .grid_elem__link {
	display: block;
	text-decoration: none;
}

/*
 * Section hero tile: one grid cell alongside the products, background photo, oversized
 * title. Deliberately not grid-column: 1 / -1 — it only spans the row below 900px.
 */
.norsan_shop .grid_elem.cat_elem {
	position: relative;
	overflow: hidden;
	padding: 70px 60px;
	background-size: cover;
	background-repeat: no-repeat;
	background-position: center;
	border: 0;
	/* .pl leaves the tile a plain block; only product cards get the flex column. */
	display: block;
}

/*
 * Not in the .pl stylesheet: the photos here are bright, and .pl's white 53px title needs
 * contrast to stay readable. Drop this block to get the untouched photo back.
 */
.norsan_shop .grid_elem.cat_elem.has-image::before {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(0, 40, 70, 0.65) 0%, rgba(0, 40, 70, 0.3) 60%, rgba(0, 40, 70, 0.55) 100%);
	pointer-events: none;
}

.norsan_shop .grid_elem.cat_elem > * {
	position: relative;
	z-index: 1;
}

.norsan_shop .grid_elem.cat_elem h3 {
	text-align: left;
	color: #fff;
	font-size: 53px;
	line-height: 1;
	font-family: var(--norsan-heading-font);
	font-weight: 600;
	display: flex;
	flex-direction: column;
	margin: 0 0 30px;
}

.norsan_shop .grid_elem.cat_elem h3 span {
	color: #6099c0;
}

.norsan_shop .grid_elem.cat_elem > span {
	font-size: 18px;
	line-height: 27px;
	font-weight: 300;
	color: #fff;
}

/* --- Card ------------------------------------------------------------------------- */

.norsan_shop .grid_elem_image {
	display: flex;
	justify-content: center;
	aspect-ratio: 100 / 90;
	padding: 33px;
}

.norsan_shop .grid_elem_image img {
	aspect-ratio: 100 / 90;
	object-fit: contain;
	width: 100%;
	height: 100%;
}

.norsan_shop h3.prod_title {
	font-family: var(--norsan-heading-font);
	font-weight: 600;
	margin: 0 0 6px;
	text-align: center;
	color: var(--norsan-brand);
	font-size: var(--norsan-card-title-size);
	line-height: 1;
	padding: 0 20px;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
	overflow: hidden;
	min-height: calc(var(--norsan-card-title-size) * 3);
}

.norsan_shop .short_description {
	margin: 8px 32px;
	font-size: 17px;
	line-height: 25px;
	color: #094579;
	display: block;
	font-weight: 300;
}

/* Plain discs, like the <ul> the .cz short descriptions already carry. */
.norsan_shop .short_description ul {
	margin: 0 0 12px;
	padding-left: 18px;
	list-style: disc;
}

.norsan_shop .short_description li {
	margin: 0;
}

.norsan_shop .short_description .link_to_prod {
	font-size: 19px;
	font-weight: 400;
	text-decoration: underline;
	display: block;
}

.norsan_shop .bottom {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 25px;
	margin: 18px 0 50px;
}

.norsan_shop .grid_elem .bottom span.price {
	font-size: 25px;
	line-height: 20px;
	color: var(--norsan-price);
	font-weight: 600;
	text-align: center;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	flex-wrap: wrap;
	gap: 10px;
}

.norsan_shop .grid_elem .bottom span.price del {
	font-weight: 300;
	font-size: 22px;
	color: #919191;
	text-decoration-color: #919191;
}

.norsan_shop .grid_elem .bottom span.price ins {
	text-decoration: none;
}

/* WooCommerce loop add-to-cart button, styled like the .cz .add_to_cart span. */
.norsan_shop .grid_elem .bottom a.button {
	color: var(--norsan-button);
	font-size: 18px;
	line-height: 20px;
	font-weight: 400;
	background: #fff;
	border-radius: 10px;
	border: 1px solid var(--norsan-button);
	/* GenerateBlocks forces 5px on every .button with !important. */
	border-radius: 10px !important;
	padding: 17px 21px;
	cursor: pointer;
	width: fit-content;
	margin: 0 auto;
	text-align: center;
	text-decoration: none;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.norsan_shop .grid_elem .bottom a.button:hover,
.norsan_shop .grid_elem .bottom a.button:focus-visible {
	background: var(--norsan-button);
	color: #fff;
}

/* --- Breakpoints, descending ------------------------------------------------------- */

@media (max-width: 1800px) {
	.norsan_shop .grid_elem.cat_elem {
		padding: 49px 35px;
	}

	/*
	 * Four across makes each card ~260px here, where the .cz 32px side margins would eat a
	 * quarter of it. Above 1800px the cards are as wide as .cz's, so the original holds.
	 */
	.norsan_shop .short_description {
		margin: 8px 20px;
	}

	.norsan_shop h3.prod_title {
		padding: 0 12px;
	}
}

@media (max-width: 1300px) {
	.norsan-shop-layout .site-content {
		padding-left: 20px;
		padding-right: 20px;
	}

	/* Sidebar moves above the grid, so it has nothing left to stick to. */
	.norsan_shop .udi_products_main {
		grid-template-columns: 1fr;
	}

	.norsan_shop .udi_products_main_sidebar {
		position: static;
		max-height: none;
		overflow-y: visible;
	}
}

/* Below this the four cards get too narrow to read. */
@media (max-width: 1200px) {
	.norsan_shop .udi_products_main_grid__cat {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (max-width: 900px) {
	.norsan_shop .udi_products_main_grid__cat {
		grid-template-columns: repeat(2, 1fr);
	}

	.norsan_shop .grid_elem.cat_elem {
		grid-column: 1 / -1;
		height: auto;
	}

	.norsan_shop .shop-h1 {
		font-size: 38px;
	}

	.norsan_shop .udi_breadcrumbs {
		margin-bottom: 25px;
	}
}

@media (max-width: 700px) {
	.norsan_shop .udi_products_main_grid__cat {
		grid-template-columns: 1fr;
	}

	.norsan_shop .udi_products_main {
		margin-bottom: 50px;
	}

	.norsan_shop .grid_elem_image {
		padding: 20px;
	}

	.norsan_shop .bottom {
		margin-bottom: 30px;
	}

	/* Single column, so there is no neighbouring card left to line the title up with. */
	.norsan_shop h3.prod_title {
		min-height: 0;
	}
}

body.norsan-product-tabs.woocommerce div.product .woocommerce-tabs ul.tabs {
	flex-wrap: wrap;
}

body.norsan-product-tabs.woocommerce div.product .woocommerce-tabs ul.tabs li {
	border-left-width: 1px;
	margin-right: -1px;
	padding: 0 16px;
}

@media (max-width: 768px) {
	body.norsan-product-tabs.woocommerce div.product .woocommerce-tabs ul.tabs li {
		flex: 1 0 100%;
		margin-right: 0;
		border-width: 1px 1px 0 1px;
	}

	body.norsan-product-tabs.woocommerce div.product .woocommerce-tabs ul.tabs li:last-child {
		border-bottom-width: 1px;
	}

	body.norsan-product-tabs.woocommerce div.product .woocommerce-tabs ul.tabs li a {
		display: block;
	}
}

.udi_qty_bundles {
	max-width: 420px;
	margin: 22px 0 26px;
	font-family: 'Dosis', sans-serif;
}

.udi_qty_bundles .udi_qty_bundles__title {
	display: block;
	color: #094579;
	font-size: 18px;
	font-weight: 600;
	line-height: 22px;
	margin-bottom: 10px;
}

.udi_qty_bundles .udi_qty_bundles__grid {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

.udi_qty_bundles .udi_qty_bundle {
	flex: 1 1 0;
	min-width: 0;
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	padding: 14px 10px 12px;
	border: 1px solid #d3d3d3;
	border-radius: 10px;
	background: #fff;
	cursor: pointer;
	text-align: center;
	transition: border-color .2s ease, background-color .2s ease;
}

.udi_qty_bundles .udi_qty_bundle:hover {
	border-color: #094579;
}

.udi_qty_bundles .udi_qty_bundle:focus-visible {
	outline: 2px solid #0294ff;
	outline-offset: 2px;
}

.udi_qty_bundles .udi_qty_bundle--active {
	border: 2px solid #094579;
	background: #5994b91f;
	padding: 13px 9px 11px;
}

.udi_qty_bundles .udi_qty_bundle__badge {
	position: absolute;
	top: -11px;
	left: 50%;
	transform: translateX(-50%);
	background: #d95f23;
	color: #fff;
	font-size: 12px;
	font-weight: 500;
	line-height: 16px;
	padding: 2px 12px;
	border-radius: 20px;
	white-space: nowrap;
}

.udi_qty_bundles .udi_qty_bundle__label {
	color: #676767;
	font-size: 15px;
	font-weight: 400;
	line-height: 19px;
}

.udi_qty_bundles .udi_qty_bundle__unit_price {
	color: #094579;
	font-size: 22px;
	font-weight: 700;
	line-height: 26px;
}

.udi_qty_bundles .udi_qty_bundle__unit_suffix {
	font-size: 14px;
	font-weight: 400;
}

.udi_qty_bundles .udi_qty_bundle__total del {
	display: none;
}

.udi_qty_bundles .udi_qty_bundle__unit {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: center;
	gap: 5px;
	font-size: 13px;
	line-height: 17px;
}

.udi_qty_bundles .udi_qty_bundle__total {
	color: #9aa0a6;
	font-weight: 400;
}

.udi_qty_bundles .udi_qty_bundle__save {
	color: #2e9e5f;
	font-weight: 700;
}

@media (max-width: 400px) {
	.udi_qty_bundles .udi_qty_bundle {
		flex-basis: 100%;
	}
}
