/* Tiles and Cabinets Search: the full screen search overlay. */

.tcso {
	--tcso-accent: #dc9814;
	--tcso-ink: #111;
	--tcso-muted: #6b6b6b;
	--tcso-line: #e6e6e6;
	--tcso-soft: #f6f6f4;
	--tcso-radius: 6px;
	position: fixed;
	inset: 0;
	/* Above floating widgets such as the "See our products in your space" button. */
	z-index: 2147483600;
	font-family: inherit;
	color: var(--tcso-ink);
}

.tcso[hidden] { display: none; }

html.tcso-open,
html.tcso-open body { overflow: hidden; }

.tcso *,
.tcso *::before,
.tcso *::after { box-sizing: border-box; }

.tcso-backdrop {
	position: absolute;
	inset: 0;
	background: rgba( 17, 17, 17, 0.55 );
}

.tcso-panel {
	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	max-height: 100vh;
	max-height: 100dvh;
	background: #fff;
	box-shadow: 0 20px 60px rgba( 0, 0, 0, 0.25 );
}

/* Search box row */

.tcso-head {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	max-width: 1240px;
	margin: 0 auto;
	padding: 18px 24px;
}

.tcso-field {
	position: relative;
	flex: 1 1 auto;
}

.tcso-icon {
	position: absolute;
	left: 16px;
	top: 50%;
	width: 20px;
	height: 20px;
	transform: translateY( -50% );
	fill: #8a8a8a;
	pointer-events: none;
}

.tcso .tcso-input {
	width: 100%;
	height: 52px;
	margin: 0;
	padding: 0 16px 0 48px;
	font: inherit;
	font-size: 18px;
	color: var(--tcso-ink);
	background: var(--tcso-soft);
	border: 1px solid var(--tcso-line);
	border-radius: var(--tcso-radius);
	box-shadow: none;
	outline: none;
	-webkit-appearance: none;
	appearance: none;
}

.tcso .tcso-input:focus {
	background: #fff;
	border-color: var(--tcso-accent);
	box-shadow: 0 0 0 3px rgba( 220, 152, 20, 0.18 );
}

.tcso-is-loading .tcso-icon,
.tcso.is-loading .tcso-icon { fill: var(--tcso-accent); }

.tcso .tcso-close {
	flex: 0 0 auto;
	width: 44px;
	height: 44px;
	margin: 0;
	padding: 0;
	font-size: 30px;
	line-height: 1;
	color: #555;
	background: transparent;
	border: 0;
	border-radius: 50%;
	cursor: pointer;
}

.tcso .tcso-close:hover,
.tcso .tcso-close:focus-visible { background: var(--tcso-soft); color: var(--tcso-ink); }

/* Body: left column and cards */

.tcso-body {
	display: grid;
	grid-template-columns: 230px minmax( 0, 1fr );
	gap: 32px;
	width: 100%;
	max-width: 1240px;
	margin: 0 auto;
	padding: 4px 24px 20px;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}

.tcso-side {
	min-width: 0;
	/* Stays in place while the cards scroll. The scrolling box is
	   .tcso-body, so the column sticks inside that rather than the page. */
	position: sticky;
	top: 0;
	align-self: start;
	max-height: calc( 100dvh - 120px );
	padding-top: 4px;
	overflow-y: auto;
}

.tcso-group + .tcso-group { margin-top: 24px; }

.tcso .tcso-h {
	margin: 0 0 10px;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--tcso-muted);
}

.tcso-side ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.tcso-side li { margin: 0 0 4px; }

.tcso-side a,
.tcso-side li > span {
	display: block;
	padding: 5px 0;
	font-size: 15px;
	line-height: 1.35;
	color: var(--tcso-ink);
	text-decoration: none;
}

.tcso-side a:hover,
.tcso-side a:focus-visible { color: var(--tcso-accent); }

.tcso-cat { display: block; }

.tcso-cat-parent {
	display: block;
	font-size: 12px;
	color: var(--tcso-muted);
}

.tcso .tcso-tool {
	font-weight: 500;
	color: var(--tcso-accent);
}

.tcso-cards {
	display: grid;
	grid-template-columns: repeat( 3, minmax( 0, 1fr ) );
	gap: 22px;
	align-content: start;
	/* Both rows of three fit on a laptop screen without scrolling. */
	max-width: 880px;
}

.tcso-card { position: relative; min-width: 0; }

.tcso .tcso-link {
	display: block;
	height: 100%;
	padding: 8px;
	margin: -8px;
	color: var(--tcso-ink);
	text-decoration: none;
	border-radius: var(--tcso-radius);
	outline: none;
}

.tcso .tcso-link.is-active,
.tcso .tcso-link:focus-visible { box-shadow: 0 0 0 2px var(--tcso-accent); }

.tcso-media {
	position: relative;
	display: block;
	aspect-ratio: 1 / 1;
	margin-bottom: 10px;
	overflow: hidden;
	background: var(--tcso-soft);
	border-radius: var(--tcso-radius);
}

.tcso .tcso-img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	transition: opacity 0.18s ease;
}

.tcso .tcso-img-second { opacity: 0; }

/* Product shots are on white and shown whole; room photos fill the frame. */
.tcso .tcso-img.is-product {
	object-fit: contain;
	background: #fff;
}

@media ( hover: hover ) {
	.tcso-card.has-second:hover .tcso-img-second { opacity: 1; }
}

.tcso-card.is-swapped .tcso-img-second { opacity: 1; }

.tcso-noimg {
	position: absolute;
	inset: 0;
}

.tcso-title {
	display: -webkit-box;
	overflow: hidden;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.4;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.tcso-title mark {
	padding: 0;
	color: inherit;
	background: rgba( 220, 152, 20, 0.22 );
}

.tcso-sku {
	display: block;
	margin-top: 3px;
	font-size: 12px;
	letter-spacing: 0.02em;
	color: var(--tcso-muted);
}

.tcso-price {
	margin-top: 4px;
	font-size: 15px;
	font-weight: 600;
}

.tcso-stock {
	margin-top: 4px;
	font-size: 13px;
	font-weight: 500;
	color: #b3261e;
}

.tcso-price s {
	font-weight: 400;
	color: #999;
}

.tcso-unit {
	font-size: 13px;
	font-weight: 400;
	color: var(--tcso-muted);
}

/* The small second photo, tapped to swap on touch screens */

.tcso .tcso-swap {
	position: absolute;
	top: 8px;
	right: 8px;
	display: none;
	width: 40px;
	height: 40px;
	margin: 0;
	padding: 0;
	overflow: hidden;
	background: #fff;
	border: 2px solid #fff;
	border-radius: 4px;
	box-shadow: 0 1px 4px rgba( 0, 0, 0, 0.3 );
	cursor: pointer;
}

.tcso .tcso-swap img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.tcso-card.is-swapped .tcso-swap { border-color: var(--tcso-accent); }

@media ( hover: none ) {
	.tcso .tcso-swap { display: block; }
}

/* Before typing: the three ranges */

.tcso-ranges {
	display: grid;
	grid-column: 1 / -1;
	grid-template-columns: repeat( 3, minmax( 0, 1fr ) );
	gap: 22px;
}

.tcso .tcso-range {
	position: relative;
	display: flex;
	align-items: flex-end;
	aspect-ratio: 4 / 3;
	padding: 16px;
	overflow: hidden;
	color: #fff;
	text-decoration: none;
	background: #3a3a3a;
	border-radius: var(--tcso-radius);
}

.tcso .tcso-range img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	transition: transform 0.3s ease;
}

.tcso .tcso-range::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient( to top, rgba( 0, 0, 0, 0.55 ), rgba( 0, 0, 0, 0 ) 60% );
}

.tcso .tcso-range:hover img { transform: scale( 1.04 ); }

/* Until Gokhan's photos are in: light tiles with dark text. */
.tcso .tcso-range:not( .has-image ) {
	align-items: center;
	aspect-ratio: auto;
	min-height: 96px;
	color: var(--tcso-ink);
	background: var(--tcso-soft);
	border: 1px solid var(--tcso-line);
}

.tcso .tcso-range:not( .has-image )::after { display: none; }

.tcso .tcso-range:not( .has-image ):hover {
	border-color: var(--tcso-accent);
	color: var(--tcso-accent);
}

.tcso-range-name {
	position: relative;
	z-index: 1;
	font-size: 18px;
	font-weight: 600;
}

.tcso-note {
	grid-column: 1 / -1;
	margin: 8px 0;
	font-size: 15px;
	color: #444;
}

.tcso-note a { color: var(--tcso-accent); }

/* Footer bar */

.tcso-foot {
	flex: 0 0 auto;
	border-top: 1px solid var(--tcso-line);
}

.tcso-foot:empty { display: none; }

.tcso .tcso-all {
	display: block;
	max-width: 1240px;
	margin: 0 auto;
	padding: 16px 24px;
	font-size: 15px;
	font-weight: 600;
	text-align: center;
	color: var(--tcso-ink);
	text-decoration: none;
	outline: none;
}

.tcso .tcso-all:hover,
.tcso .tcso-all.is-active,
.tcso .tcso-all:focus-visible {
	color: #fff;
	background: var(--tcso-accent);
}

.tcso-live {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect( 0 0 0 0 );
}

/* Narrow screens */

@media ( max-width: 900px ) {
	.tcso-body {
		grid-template-columns: minmax( 0, 1fr );
		gap: 20px;
	}

	.tcso-side {
		order: 2;
		position: static;
		max-height: none;
		overflow: visible;
	}

	.tcso-cards,
	.tcso-ranges { grid-template-columns: repeat( 2, minmax( 0, 1fr ) ); gap: 16px; }
}

@media ( max-width: 600px ) {
	.tcso-panel { height: 100vh; height: 100dvh; }

	.tcso-head { padding: 12px 16px; gap: 8px; }

	.tcso .tcso-input { height: 46px; font-size: 16px; }

	.tcso-body { padding: 4px 16px 16px; }

	.tcso-ranges { grid-template-columns: minmax( 0, 1fr ); }

	.tcso .tcso-range.has-image { aspect-ratio: 16 / 7; }

	.tcso .tcso-range:not( .has-image ) { min-height: 56px; padding: 12px 16px; }

	.tcso-range-name { font-size: 16px; }

	.tcso-title { font-size: 13px; }
}

@media ( prefers-reduced-motion: reduce ) {
	.tcso .tcso-img,
	.tcso .tcso-range img { transition: none; }
}
