:root {
	--balcony-accent: #d8a400;
	--balcony-ink: #202020;
	--balcony-muted: #6d6d6d;
	--balcony-line: #e2e2e2;
	--balcony-soft: #f7f7f7;
	--balcony-brand: #2095a6;
	--balcony-brand-dark: #177b8a;
	--balcony-brand-soft: #f0fafb;
}

.balcony-menu-panel[hidden] {
	display: none !important;
}

/* ================================================================
   KAUPAN YHTEINEN YLÄPALKKI JA REAALIAIKAINEN HAKU
   ================================================================ */

.balcony-store-toolbar {
	position: relative;
	z-index: 20;
	display: flex;
	width: 100%;
	flex-wrap: wrap;
	gap: 16px;
	align-items: center;
	justify-content: flex-start;
	margin: 22px 0 32px;
}

.balcony-back-to-shop {
	display: inline-flex;
	gap: 9px;
	align-items: center;
	min-height: 46px;
	padding: 0 17px;
	border: 1px solid var(--balcony-brand);
	border-radius: 3px;
	background: var(--balcony-brand);
	color: #fff !important;
	font-size: 15px;
	font-weight: 600;
	text-decoration: none !important;
}

.balcony-back-to-shop:hover,
.balcony-back-to-shop:focus-visible {
	border-color: var(--balcony-accent);
	background: var(--balcony-brand-dark);
	box-shadow: 0 0 0 2px rgba(32, 149, 166, 0.18);
}

.balcony-product-search {
	position: relative;
	display: block;
	width: min(100%, 640px);
	max-width: 640px;
	margin: 0;
}

.balcony-store-toolbar .balcony-product-search {
	flex: 0 1 640px;
}

.balcony-live-search-field {
	position: relative;
	display: flex;
	width: 100%;
	border: 1px solid #cfcfcf;
	border-radius: 3px;
	background: #fff;
}

.balcony-live-search-field:focus-within {
	border-color: #9b9b9b;
	box-shadow: 0 0 0 2px rgba(216, 164, 0, 0.16);
}

.balcony-product-search input[type="search"] {
	min-width: 0;
	flex: 1;
	height: 62px;
	padding: 0 21px;
	border: 0 !important;
	border-radius: 0;
	background: #fff;
	box-shadow: none !important;
	font-size: 16px;
}

.balcony-product-search button {
	display: grid;
	place-items: center;
	width: 67px;
	min-width: 67px;
	height: 62px;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: var(--balcony-accent);
	color: #161616;
	cursor: pointer;
}

.balcony-product-search button:hover,
.balcony-product-search button:focus-visible {
	background: #c99700;
}

.balcony-product-search svg {
	width: 24px;
	height: 24px;
	fill: none;
	stroke: currentColor;
	stroke-linecap: round;
	stroke-width: 1.8;
}

.balcony-live-search-results {
	position: absolute;
	z-index: 9999;
	top: calc(100% + 6px);
	right: 0;
	left: 0;
	border: 1px solid #d5d5d5;
	border-radius: 3px;
	background: #fff;
	box-shadow: 0 12px 28px rgba(0, 0, 0, 0.14);
	max-height: 246px;
	overflow-x: hidden;
	overflow-y: auto;
	overscroll-behavior: contain;
	scrollbar-gutter: stable;
}

.balcony-live-search-results[hidden] {
	display: none !important;
}

.balcony-live-search-item {
	display: grid;
	grid-template-columns: 68px minmax(0, 1fr);
	gap: 14px;
	align-items: center;
	min-height: 82px;
	padding: 7px 13px;
	border-bottom: 1px solid var(--balcony-line);
	background: #fff;
	color: var(--balcony-ink) !important;
	text-decoration: none !important;
}

.balcony-live-search-item:last-child {
	border-bottom: 0;
}

.balcony-live-search-item:hover,
.balcony-live-search-item:focus-visible,
.balcony-live-search-item.is-active {
	background: #f7f7f7;
}

.balcony-live-search-image {
	display: grid;
	width: 68px;
	height: 68px;
	place-items: center;
	background: #fff;
}

.balcony-live-search-image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.balcony-live-search-text {
	display: flex;
	min-width: 0;
	flex-direction: column;
	gap: 4px;
}

.balcony-live-search-name {
	font-size: 15px;
	font-weight: 600;
	line-height: 1.3;
}

.balcony-live-search-sku {
	color: var(--balcony-muted);
	font-size: 13px;
}

.balcony-live-search-empty {
	padding: 17px 18px;
	color: var(--balcony-muted);
	font-size: 14px;
}

.balcony-top-pagination {
	display: flex;
	width: 100%;
	flex-basis: 100%;
	justify-content: center;
	margin: 0 0 28px;
	clear: both;
}

.balcony-top-pagination .woocommerce-pagination {
	margin: 0;
}

/* ================================================================
   OTSIKON OSTOSKORI JA OMA TILI
   ================================================================ */

.balcony-header-action > a {
	position: relative;
	display: inline-flex !important;
	gap: 6px;
	align-items: center;
}

.balcony-header-action svg {
	width: 21px;
	height: 21px;
	fill: none;
	stroke: currentColor;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 1.7;
}

.balcony-cart-count {
	display: grid;
	min-width: 19px;
	height: 19px;
	padding: 0 5px;
	place-items: center;
	border-radius: 10px;
	background: var(--balcony-accent);
	color: #161616;
	font-size: 11px;
	font-weight: 700;
	line-height: 19px;
}

/* ================================================================
   KAUPAN ETUSIVU
   ================================================================ */

.balcony-shop-front {
	margin: 18px 0 44px;
	color: var(--balcony-ink);
}

.balcony-category-browser {
	display: grid;
	grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
	gap: 48px;
	align-items: start;
}

.balcony-root-categories {
	padding: 24px 30px;
	background: var(--balcony-soft);
}

.balcony-root-category {
	display: grid;
	grid-template-columns: 64px minmax(0, 1fr) 20px;
	gap: 18px;
	align-items: center;
	min-height: 92px;
	padding: 10px 4px;
	border-bottom: 1px solid var(--balcony-line);
	color: var(--balcony-ink) !important;
	font-size: 16px;
	line-height: 1.25;
	text-decoration: none !important;
}

.balcony-root-category:first-child {
	border-top: 1px solid var(--balcony-line);
}

.balcony-root-category:hover,
.balcony-root-category:focus-visible,
.balcony-root-category.is-active {
	font-weight: 650;
}

.balcony-category-thumb {
	display: grid;
	place-items: center;
	width: 100%;
	background: transparent;
}

.balcony-root-category .balcony-category-thumb {
	height: 64px;
}

.balcony-category-thumb img,
.balcony-choice-image img {
	display: block;
	width: 100%;
	height: 100%;
	margin: 0;
	object-fit: contain;
}

.balcony-menu-arrow {
	color: transparent;
	font-size: 34px;
	font-weight: 300;
	line-height: 1;
}

.balcony-root-category.is-active .balcony-menu-arrow,
.balcony-root-category:hover .balcony-menu-arrow,
.balcony-root-category:focus-visible .balcony-menu-arrow {
	color: var(--balcony-accent);
}

.balcony-subcategory-area {
	min-width: 0;
	padding-top: 18px;
}

/* ================================================================
   YHTEISET OIKEAN PUOLEN PANEELIT JA KUVAKORTIT
   ================================================================ */

.balcony-menu-panel-heading {
	display: flex;
	gap: 24px;
	align-items: baseline;
	justify-content: space-between;
	margin: 0 0 28px;
	padding-bottom: 16px;
	border-bottom: 1px solid var(--balcony-line);
}

.balcony-menu-panel-heading h2 {
	margin: 0;
	color: var(--balcony-ink);
	font-size: clamp(25px, 2.2vw, 36px);
	font-weight: 500;
	line-height: 1.2;
}

.balcony-menu-panel-heading a {
	color: #168da1;
	font-size: 14px;
	text-decoration: underline;
	text-underline-offset: 3px;
	white-space: nowrap;
}

.balcony-choice-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 38px 28px;
}

.balcony-choice-card {
	display: flex;
	min-width: 0;
	flex-direction: column;
	gap: 15px;
	padding: 10px 10px 14px;
	border: 1px solid var(--balcony-line);
	border-radius: 4px;
	background: #fff;
	color: var(--balcony-ink) !important;
	font-size: 16px;
	font-weight: 500;
	line-height: 1.3;
	text-align: center;
	text-decoration: none !important;
	overflow: hidden;
	transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
}

.balcony-choice-image {
	display: grid;
	place-items: center;
	height: 180px;
	padding: 9px;
	border: 0;
	background: #fff;
}

.balcony-choice-card:hover,
.balcony-choice-card:focus-visible {
	border-color: var(--balcony-brand);
	background: #fff;
	box-shadow: none;
	outline: 0;
}

.balcony-choice-card:hover .balcony-choice-image,
.balcony-choice-card:focus-visible .balcony-choice-image {
	background: #fff;
}

.balcony-choice-name {
	display: block;
}

.balcony-empty-category {
	margin: 24px 0;
	color: var(--balcony-muted);
	font-size: 16px;
}

/* Kaupan etusivulla ei näytetä satunnaista WooCommerce-tuoteluetteloa. */
.balcony-shop-front-active .woocommerce-result-count,
.balcony-shop-front-active .woocommerce-ordering,
.balcony-shop-front-active .woocommerce-pagination,
.balcony-shop-front-active .products[class*="columns-"] {
	display: none !important;
}

@media (max-width: 1280px) {
	.balcony-category-browser {
		grid-template-columns: 290px minmax(0, 1fr);
	}

	.balcony-root-categories {
		padding-right: 22px;
		padding-left: 22px;
	}

	.balcony-shop-front .balcony-choice-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (max-width: 900px) {
	.balcony-category-browser {
		display: block;
	}

	.balcony-root-categories {
		display: flex;
		gap: 10px;
		padding: 13px 16px;
		overflow-x: auto;
		scroll-snap-type: x proximity;
		-webkit-overflow-scrolling: touch;
	}

	.balcony-root-category {
		grid-template-columns: 48px minmax(105px, auto);
		gap: 10px;
		min-width: max-content;
		min-height: 64px;
		padding: 7px 12px 7px 7px;
		border: 1px solid var(--balcony-line) !important;
		border-radius: 3px;
		font-size: 14px;
		scroll-snap-align: start;
	}

	.balcony-root-category.is-active {
		border-color: var(--balcony-accent) !important;
	}

	.balcony-root-category .balcony-category-thumb {
		height: 48px;
	}

	.balcony-menu-arrow {
		display: none;
	}

	.balcony-subcategory-area {
		padding: 22px 18px 36px;
	}

	.balcony-category-browser {
		margin: 0 -16px;
	}

	.balcony-subcategory-area {
		padding-top: 4px;
	}

	.balcony-choice-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 26px 14px;
	}

	.balcony-choice-image {
		height: 142px;
	}

	.balcony-choice-card {
		font-size: 14px;
	}
}

@media (max-width: 600px) {
	.balcony-shop-front {
		margin-top: 10px;
	}

	.balcony-store-toolbar {
		display: block;
		margin: 15px 0 24px;
	}

	.balcony-back-to-shop {
		margin-bottom: 12px;
	}

	.balcony-product-search {
		width: 100%;
	}

	.balcony-product-search input[type="search"],
	.balcony-product-search button {
		height: 50px;
	}

	.balcony-product-search button {
		width: 54px;
		min-width: 54px;
	}

	.balcony-live-search-item {
		grid-template-columns: 56px minmax(0, 1fr);
		min-height: 70px;
		padding: 6px 9px;
	}

	.balcony-live-search-image {
		width: 56px;
		height: 56px;
	}

	.balcony-header-action-label {
		display: inline;
	}

	.balcony-menu-panel-heading {
		margin-bottom: 20px;
		padding-bottom: 11px;
	}

	.balcony-menu-panel-heading h2 {
		font-size: 23px;
	}

	.balcony-menu-panel-heading a {
		font-size: 12px;
	}

	.balcony-choice-image {
		height: 122px;
		padding: 5px;
	}

}

@media (prefers-reduced-motion: reduce) {
	.balcony-choice-card {
		transition: none;
	}
}
