/* TSC Product Search — form, live suggestions, results page, product cards. */

/* ---------- Search form (mirrors the live Advanced Woo Search box) ---------- */
.tsc-ps {
	position: relative;
	width: 100%;
	max-width: 100%;
	z-index: 20;
}

.tsc-ps__form {
	display: flex;
	align-items: stretch;
	width: 100%;
	margin: 0;
	border: 1px solid #d8d8d8;
	background: #fff;
}

.tsc-ps__field {
	position: relative;
	flex: 1 1 auto;
	min-width: 0;
}

.tsc-ps__input[type="search"] {
	display: block;
	width: 100%;
	height: 50px;
	margin: 0;
	padding: 0 44px 0 16px;
	border: 0 !important;
	border-radius: 0;
	outline: 0;
	box-shadow: none !important;
	background: transparent;
	color: #333;
	font: inherit;
	font-size: 16px;
	-webkit-appearance: none;
	appearance: none;
}

.tsc-ps__input::-webkit-search-cancel-button { display: none; }

.tsc-ps__form:focus-within {
	border-color: var(--tsc-ps-accent, #087a9d);
	box-shadow: 0 0 0 1px var(--tsc-ps-accent, #087a9d);
}

.tsc-ps__clear {
	position: absolute;
	top: 50%;
	right: 10px;
	width: 28px;
	height: 28px;
	margin-top: -14px;
	padding: 0;
	border: 0;
	background: transparent;
	color: #757575;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
}

.tsc-ps__clear:hover { color: #222; }

.tsc-ps__loader {
	position: absolute;
	top: 50%;
	right: 40px;
	display: none;
	width: 18px;
	height: 18px;
	margin-top: -9px;
	border: 2px solid #ddd;
	border-top-color: var(--tsc-ps-accent, #087a9d);
	border-radius: 50%;
	animation: tsc-ps-spin .7s linear infinite;
}

.tsc-ps.is-loading .tsc-ps__loader { display: block; }

@keyframes tsc-ps-spin { to { transform: rotate(360deg); } }

.tsc-ps__submit {
	flex: 0 0 56px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	margin: 0;
	padding: 0;
	border: 0;
	border-left: 1px solid #d8d8d8;
	border-radius: 0;
	background: #ededed;
	color: #555;
	cursor: pointer;
	transition: background .2s ease, color .2s ease;
}

.tsc-ps__submit:hover,
.tsc-ps__submit:focus-visible {
	background: var(--tsc-ps-accent, #087a9d);
	color: #fff;
}

.tsc-ps__submit svg { width: 22px; height: 22px; fill: currentColor; }

/* Live suggestions */
.tsc-ps__results {
	position: absolute;
	left: 0;
	right: 0;
	top: 100%;
	max-height: 70vh;
	overflow-y: auto;
	margin-top: 2px;
	border: 1px solid #d8d8d8;
	background: #fff;
	box-shadow: 0 10px 24px rgba(0, 0, 0, .12);
}

.tsc-ps__item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 14px;
	border-bottom: 1px solid #f0f0f0;
	color: #222;
	text-decoration: none;
}

.tsc-ps__item:hover,
.tsc-ps__item.is-active {
	background: #f5f8f9;
	color: #222;
}

.tsc-ps__item img {
	flex: 0 0 56px;
	width: 56px;
	height: 56px;
	object-fit: cover;
	border-radius: 2px;
}

.tsc-ps__item-body { display: flex; flex-direction: column; min-width: 0; }
.tsc-ps__item-title { font-weight: 600; line-height: 1.3; }
.tsc-ps__item-title mark { background: none; color: inherit; text-decoration: underline; }
.tsc-ps__item-price { font-size: 14px; color: #555; }
.tsc-ps__item-price del { opacity: .6; }
.tsc-ps__item-price ins { text-decoration: none; }

.tsc-ps__all,
.tsc-ps__none {
	display: block;
	padding: 12px 14px;
	font-weight: 600;
	text-align: center;
}

.tsc-ps__all {
	background: #fafafa;
	color: var(--tsc-ps-accent, #087a9d);
	text-decoration: none;
}

.tsc-ps__all:hover,
.tsc-ps__all.is-active { background: #eef5f7; }
.tsc-ps__none { color: #757575; font-weight: 400; }

/* ---------- Results page ---------- */
/* Themes such as Hello Elementor cap .site-main at 960/1140px; let the results page use its own width. */
.site-main.tsc-ps-page { max-width: none; width: 100%; padding-left: 0; padding-right: 0; }

.tsc-ps-container {
	width: min(1080px, calc(100% - 40px)); /* Live product area: ~1032px, 3 × 344px cards */
	margin: 0 auto;
	padding: 40px 0 70px;
}

.tsc-ps-container.has-sidebar {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 300px;
	gap: 50px;
	align-items: start;
}

.tsc-ps-sidebar .tsc-ps-widget { margin-bottom: 32px; }
.tsc-ps-sidebar .tsc-ps-widget-title { margin: 0 0 14px; font-size: 20px; }

.tsc-ps-breadcrumb {
	margin: 0 0 12px;
	font-size: 14px;
	color: #757575;
}

.tsc-ps-breadcrumb a { color: inherit; text-decoration: none; }
.tsc-ps-breadcrumb a:hover { color: var(--tsc-ps-accent, #087a9d); text-decoration: underline; }
.tsc-ps-breadcrumb__sep { margin: 0 6px; }

.tsc-ps-results .tsc-ps-title {
	margin: 0 0 24px;
	font-size: clamp(26px, 3vw, 36px);
	line-height: 1.2;
}

.tsc-ps-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px 20px;
	margin: 0 0 24px;
	padding: 0 0 16px;
	border-bottom: 1px solid #eee;
}

.tsc-ps-view { display: inline-flex; gap: 4px; }

.tsc-ps-view__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 1px solid #ddd;
	background: #fff;
	color: #777;
	cursor: pointer;
}

.tsc-ps-view__btn svg { width: 18px; height: 18px; fill: currentColor; }
.tsc-ps-view__btn.is-active { border-color: var(--tsc-ps-accent, #087a9d); color: var(--tsc-ps-accent, #087a9d); }

.tsc-ps-count { margin: 0; color: #555; font-size: 15px; }

.tsc-ps-sort { margin: 0 0 0 auto; }

.tsc-ps-sort__select {
	height: 40px;
	min-width: 220px;
	padding: 0 34px 0 12px;
	border: 1px solid #ddd;
	border-radius: 0;
	background-color: #fff;
	font: inherit;
	font-size: 15px;
}

/* Product grid (shared with [tsc_products_grid]) */
.tsc-ps-grid {
	--_cols: var(--tsc-ps-cols, 2);
	display: grid;
	grid-template-columns: repeat(var(--_cols), minmax(0, 1fr));
	gap: 36px 30px;
	margin: 0 0 36px;
	padding: 0;
	list-style: none;
}

@media (max-width: 1024px) { .tsc-ps-grid { --_cols: var(--tsc-ps-cols-t, 2); } }
@media (max-width: 767px) { .tsc-ps-grid { --_cols: var(--tsc-ps-cols-m, 1); gap: 28px 16px; } }

.tsc-ps-card {
	position: relative;
	display: flex;
	flex-direction: column;
	margin: 0 !important;
	padding: 0;
	width: auto !important;
	float: none !important;
	list-style: none;
}

.tsc-ps-card__image {
	position: relative;
	display: block;
	overflow: hidden;
	margin: 0 0 14px;
	background: #f6f6f6;
	aspect-ratio: 1 / 1;
}

.tsc-ps-card__image img {
	display: block;
	width: 100%;
	height: 100%;
	margin: 0 !important;
	object-fit: cover;
	transition: transform .4s ease;
}

.tsc-ps-card:hover .tsc-ps-card__image img { transform: scale(1.04); }

.tsc-ps-card__sale {
	position: absolute;
	top: 12px;
	left: 12px;
	z-index: 1;
	min-width: 0;
	min-height: 0;
	margin: 0;
	padding: 4px 12px;
	border-radius: 2px;
	background: #c62828;
	color: #fff;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.4;
}

.tsc-ps-card__tags { margin: 0 0 6px; color: #777; }

.tsc-ps-grid .tsc-ps-card__title {
	margin: 0 0 8px;
	padding: 0;
	font-size: 20px;
	line-height: 1.3;
}

.tsc-ps-grid .tsc-ps-card__title a { color: inherit; text-decoration: none; }
.tsc-ps-grid .tsc-ps-card__title a:hover { color: var(--tsc-ps-accent, #087a9d); }

.tsc-ps-card__price { display: block; margin: 0 0 10px; font-size: 17px; color: #333; }
.tsc-ps-card__price del { opacity: .6; margin-right: 6px; }
.tsc-ps-card__price ins { text-decoration: none; font-weight: 700; }

.tsc-ps-card__excerpt { display: none; margin: 0 0 12px; color: #555; }

.tsc-ps-card__more {
	align-self: flex-start;
	margin-top: auto;
	color: var(--tsc-ps-accent, #087a9d);
	font-weight: 700;
	text-decoration: none;
	text-transform: uppercase;
	letter-spacing: .04em;
	font-size: 14px;
	border-bottom: 2px solid currentColor;
	padding-bottom: 2px;
}

.tsc-ps-card__more:hover { color: #0b2b3a; }

/* List view */
.tsc-ps-grid[data-view="list"] { grid-template-columns: 1fr; gap: 26px; }
.tsc-ps-grid[data-view="list"] .tsc-ps-card { flex-direction: row; gap: 26px; align-items: flex-start; padding-bottom: 26px !important; border-bottom: 1px solid #eee; }
.tsc-ps-grid[data-view="list"] .tsc-ps-card__image { flex: 0 0 min(38%, 300px); margin: 0; }
.tsc-ps-grid[data-view="list"] .tsc-ps-card__body { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; }
.tsc-ps-grid[data-view="list"] .tsc-ps-card__excerpt { display: block; }

@media (max-width: 600px) {
	.tsc-ps-grid[data-view="list"] .tsc-ps-card { flex-direction: column; }
	.tsc-ps-grid[data-view="list"] .tsc-ps-card__image { flex-basis: auto; width: 100%; }
}

.tsc-ps-card__body { display: flex; flex-direction: column; flex: 1 1 auto; }

/* Pagination */
.tsc-ps-pagination ul {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 6px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.tsc-ps-pagination li { margin: 0; }

.tsc-ps-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 10px;
	border: 1px solid #ddd;
	color: #333;
	text-decoration: none;
}

.tsc-ps-pagination .page-numbers.current,
.tsc-ps-pagination a.page-numbers:hover {
	border-color: var(--tsc-ps-accent, #087a9d);
	background: var(--tsc-ps-accent, #087a9d);
	color: #fff;
}

.tsc-ps-empty { padding: 20px 0; }
.tsc-ps-empty .tsc-ps { max-width: 560px; margin-top: 16px; }

@media (max-width: 900px) {
	.tsc-ps-container.has-sidebar { grid-template-columns: 1fr; gap: 30px; }
	.tsc-ps-sort { margin-left: 0; width: 100%; }
	.tsc-ps-sort__select { width: 100%; }
}

@media (max-width: 767px) {
	.tsc-ps-container { width: calc(100% - 32px); padding-top: 28px; }
	.tsc-ps-grid .tsc-ps-card__title { font-size: 18px; }
}

@media (prefers-reduced-motion: reduce) {
	.tsc-ps-card__image img { transition: none; }
	.tsc-ps__loader { animation-duration: 2s; }
}

/* Visually hidden text — defined here so it works even if the theme lacks WordPress' .screen-reader-text. */
.tsc-ps .screen-reader-text,
.tsc-ps-results .screen-reader-text,
.tsc-products-grid .screen-reader-text {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	margin: -1px !important;
	padding: 0 !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	clip-path: inset(50%) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

.tsc-ps .tsc-ps__item,
.tsc-ps .tsc-ps__item *,
.tsc-ps .tsc-ps__all { text-decoration: none; }


/* ---------- Live-site card look (Gardis theme parity) ---------- */
.tsc-ps-card__image { aspect-ratio: 4 / 3; }
.tsc-ps-card__tags,
.tsc-ps-card__tags a { color: var(--tsc-ps-accent, #075f7e); font-style: italic; font-size: 16px; line-height: 1.5; }
.tsc-ps-grid .tsc-ps-card__title { font-size: 18px; font-weight: 400; color: #103449; margin: 6px 0 8px; }
.tsc-ps-count { color: #909aa1; font-size: 16px; }
.tsc-ps-grid .tsc-ps-card__more {
	align-self: stretch;
	display: block;
	margin-top: auto;
	padding: 10px;
	border: 0;
	background: var(--tsc-ps-accent, #075f7e);
	color: #fff;
	font-size: 16px;
	font-weight: 400;
	letter-spacing: .06em;
	text-align: center;
	text-transform: none;
	text-decoration: none;
	transition: background .2s ease;
}
.tsc-ps-grid .tsc-ps-card__more:hover,
.tsc-ps-grid .tsc-ps-card__more:focus-visible { background: #103449; color: #fff; }
.tsc-ps-grid[data-view="list"] .tsc-ps-card__more { align-self: flex-start; padding: 10px 28px; }
