/* Smart Search dropdown — panel below header search */
:root {
	--ss-primary: var(--sanomart-primary, #283b91);
	--ss-secondary: var(--sanomart-secondary, #fbaf43);
}

/* Anchor in header */
.ss-search-anchor {
	position: relative;
	z-index: 1;
}

.ss-search-anchor.is-ss-open {
	z-index: 10050;
}

.ss-dropdown {
	position: absolute;
	top: calc(100% + 8px);
	left: 0;
	right: 0;
	z-index: 10051;
}

.ss-dropdown[hidden] {
	display: none !important;
}

.ss-dropdown__backdrop {
	display: none;
}

.ss-dropdown__panel {
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 14px;
	box-shadow: 0 16px 40px rgba(15, 23, 42, 0.14);
	overflow: visible;
}

.ss-dropdown__content {
	padding: 12px;
}

.ss-dropdown__content[hidden] {
	display: none !important;
}

.ss-dropdown__skeleton {
	padding: 0;
}

.ss-skeleton-group,
.ss-skeleton-foot {
	padding: 12px 14px;
}

.ss-skeleton-group + .ss-skeleton-group,
.ss-skeleton-foot {
	border-top: 1px solid #e8edf3;
}

.ss-skeleton {
	display: block;
	background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
	background-size: 200% 100%;
	animation: ss-shimmer 1.2s infinite;
	border-radius: 8px;
}

.ss-skeleton-row {
	display: flex;
	align-items: center;
	gap: 10px;
}

.ss-skeleton-row + .ss-skeleton-row,
.ss-skeleton-product + .ss-skeleton-product {
	margin-top: 10px;
}

.ss-skeleton--icon {
	flex: 0 0 18px;
	width: 18px;
	height: 18px;
	border-radius: 999px;
}

.ss-skeleton--icon-sm {
	flex-basis: 14px;
	width: 14px;
	height: 14px;
}

.ss-skeleton--text {
	height: 14px;
	max-width: 100%;
}

.ss-skeleton--text-lg {
	width: 58%;
}

.ss-skeleton--text-md {
	width: 46%;
}

.ss-skeleton--text-sm {
	width: 34%;
}

.ss-skeleton-product {
	display: flex;
	align-items: flex-start;
	gap: 12px;
}

.ss-skeleton--thumb {
	flex: 0 0 64px;
	width: 64px;
	height: 64px;
	border-radius: 10px;
}

.ss-skeleton-product__body {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding-top: 2px;
}

.ss-skeleton--price {
	width: 84px;
	height: 18px;
	border-radius: 999px;
}

.ss-skeleton--price-sm {
	width: 70px;
}

.ss-skeleton--cta {
	width: 140px;
	height: 16px;
	margin: 0 auto;
	border-radius: 999px;
}

@keyframes ss-shimmer {
	0% { background-position: 200% 0; }
	100% { background-position: -200% 0; }
}

.ss-section {
	margin-bottom: 14px;
}

.ss-section:last-child {
	margin-bottom: 0;
}

.ss-section__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin-bottom: 8px;
}

.ss-section__title {
	margin: 0 0 8px;
	font-size: 14px;
	font-weight: 700;
	color: #0f172a;
}

.ss-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.ss-chip {
	border: 1px solid #cbd5e1;
	background: #fff;
	border-radius: 999px;
	padding: 6px 12px;
	font-size: 13px;
	cursor: pointer;
	line-height: 1.3;
}

.ss-chip--trend {
	border-color: #cbd5e1;
	color: #0f172a;
	background: #fff;
}

.ss-link {
	border: none;
	background: none;
	color: var(--ss-primary);
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	text-decoration: none;
}

.ss-banners {
	padding-bottom: 4px;
}

.ss-banner {
	border-radius: 12px;
	overflow: hidden;
	text-decoration: none;
	display: block;
}

.ss-banner picture,
.ss-banner img {
	display: block;
	width: 100%;
	height: auto;
}

.ss-product-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
}

.ss-product-list {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.ss-product-card {
	position: relative;
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}

.ss-product-card__link {
	display: flex;
	flex-direction: column;
	padding: 10px;
	text-decoration: none;
	color: inherit;
	gap: 8px;
}

.ss-product-card--row .ss-product-card__link {
	flex-direction: row;
	align-items: center;
}

.ss-product-card__badge {
	position: absolute;
	top: 6px;
	left: 6px;
	z-index: 1;
	background: #a91125;
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	padding: 2px 6px;
	border-radius: 999px;
}

.ss-product-card__thumb {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
}

.ss-product-card__thumb img {
	width: 72px;
	height: 72px;
	object-fit: contain;
}

.ss-product-card--row .ss-product-card__thumb img {
	width: 56px;
	height: 56px;
}

.ss-product-card__title {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.35;
}

.ss-product-card__price {
	color: #e53935;
	font-weight: 700;
	font-size: 15px;
}

.ss-product-card__regular {
	color: #94a3b8;
	text-decoration: line-through;
	font-size: 12px;
	margin-left: 6px;
}

.ss-product-card__unit {
	font-size: 12px;
	color: #64748b;
}

.ss-product-card__stock {
	font-size: 12px;
	color: #b91c1c;
}

.ss-term-list {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.ss-term {
	display: block;
	padding: 8px 10px;
	background: #f8fafc;
	border-radius: 8px;
	text-decoration: none;
	color: #0f172a;
	font-size: 14px;
}

.ss-muted {
	color: #94a3b8;
	font-size: 12px;
}

.ss-empty {
	text-align: center;
	color: #64748b;
	padding: 24px 12px;
}

/* Search results dropdown (active query) */
.ss-dropdown__content:has(.ss-results) {
	padding: 0;
}

.ss-results {
	display: flex;
	flex-direction: column;
}

.ss-result-hints,
.ss-result-categories,
.ss-result-brands,
.ss-result-products {
	list-style: none;
	margin: 0;
	padding: 0;
}

.ss-result-categories,
.ss-result-brands,
.ss-result-products,
.ss-results__foot {
	border-top: 1px solid #e8edf3;
}

.ss-result-hints__item,
.ss-result-categories__item,
.ss-result-brands__item {
	margin: 0;
}

.ss-result-hint {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	padding: 10px 14px;
	border: none;
	background: transparent;
	text-align: left;
	color: #0f172a;
	font-size: 14px;
	line-height: 1.4;
	cursor: pointer;
}

.ss-result-category {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	padding: 10px 14px;
	text-decoration: none;
	color: #0f172a;
	font-size: 14px;
	line-height: 1.4;
}

.ss-result-hint:hover,
.ss-result-hint:focus,
.ss-result-category:hover,
.ss-result-category:focus {
	background: #f8fafc;
}

.ss-result-hint__icon,
.ss-result-category__icon {
	flex: 0 0 18px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #94a3b8;
}

.ss-result-hint__text {
	flex: 1;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.ss-result-category__label {
	flex: 1;
	min-width: 0;
	word-break: break-word;
}

.ss-result-category__prefix {
	color: #64748b;
	font-weight: 500;
}

.ss-result-category__prefix::after {
	content: '\00a0';
}

.ss-result-category__name {
	font-weight: 600;
	color: #0f172a;
}

.ss-result-product {
	border-top: 1px solid #e8edf3;
}

.ss-result-product:first-child {
	border-top: none;
}

.ss-result-product__link {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 12px 14px;
	text-decoration: none;
	color: inherit;
}

.ss-result-product__link:hover,
.ss-result-product__link:focus {
	background: #f8fafc;
}

.ss-result-product__thumb {
	flex: 0 0 64px;
	width: 64px;
	height: 64px;
	border: 1px solid #e2e8f0;
	border-radius: 10px;
	background: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

.ss-result-product__thumb img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
}

.ss-result-product__body {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.ss-result-product__title {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.35;
	color: #0f172a;
}

.ss-result-product__price {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 2px 4px;
	font-size: 14px;
	line-height: 1.3;
}

.ss-result-product__amount {
	font-weight: 700;
	color: var(--ss-primary);
}

.ss-result-product__amount .woocommerce-Price-amount {
	color: inherit;
	font-weight: inherit;
}

.ss-result-product__unit {
	font-weight: 700;
	color: var(--ss-primary);
}

.ss-results__foot {
	padding: 12px 14px 14px;
	text-align: center;
}

.ss-results__view-all {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 4px;
	font-size: 14px;
	font-weight: 600;
	color: var(--ss-primary);
	text-decoration: none;
}

.ss-results__view-all:hover,
.ss-results__view-all:focus {
	text-decoration: underline;
}

.ss-results__chevron {
	flex: 0 0 auto;
}

.ss-deals__box {
	border: 2px solid var(--ss-primary);
	border-radius: 14px;
	overflow: hidden;
	background: #fff;
}

.ss-deals__head {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 12px;
	background: var(--ss-primary);
	color: #fff;
}

.ss-deals__fire {
	font-size: 18px;
	line-height: 1;
}

.ss-deals__title {
	margin: 0;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.25;
	color: #fff;
}

.ss-deals__list {
	display: flex;
	flex-direction: column;
	padding: 8px;
}

.ss-deals__item {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 8px;
	border-radius: 10px;
	text-decoration: none;
	color: inherit;
}

.ss-deals__item:hover,
.ss-deals__item:focus {
	background: #f8fafc;
}

.ss-deals__thumb {
	position: relative;
	flex: 0 0 72px;
	width: 72px;
	height: 72px;
	border-radius: 10px;
	overflow: hidden;
	background: #f1f5f9;
}

.ss-deals__thumb img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
}

.ss-deals__badge {
	position: absolute;
	top: 0;
	left: 0;
	z-index: 1;
	background: #c62828;
	color: #fff;
	font-size: 10px;
	font-weight: 700;
	line-height: 1.1;
	padding: 3px 5px;
	border-radius: 0 0 6px 0;
	max-width: 100%;
}

.ss-deals__body {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.ss-deals__name {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.35;
	color: #0f172a;
}

.ss-deals__prices {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 4px 8px;
}

.ss-deals__sale {
	font-size: 15px;
	font-weight: 600;
	color: #0f172a;
}

.ss-deals__sale .woocommerce-Price-amount {
	color: inherit;
	font-weight: inherit;
}

.ss-deals__regular {
	font-size: 13px;
	color: #94a3b8;
	text-decoration: line-through;
}

.ss-deals__regular .woocommerce-Price-amount {
	color: inherit;
}

@media (max-width: 767px) {
	.ss-dropdown {
		position: fixed;
		top: auto;
		left: 12px;
		right: 12px;
		margin-top: 0;
	}

	.ss-search-anchor.is-ss-open .ss-dropdown {
		top: var(--ss-dropdown-top, 120px);
	}

	.ss-dropdown__backdrop {
		display: block;
		position: fixed;
		inset: 0;
		background: rgba(15, 23, 42, 0.25);
		z-index: -1;
	}
}

@media (min-width: 768px) {
	.ss-product-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}
