/* Scanmil Core komponendid. Värvid tulevad teema muutujatest, varuvärvid CVI-st. */
:root {
	--smc-ink: var(--wp--preset--color--ink, #131914);
	--smc-olive: var(--wp--preset--color--olive, #48532F);
	--smc-accent: var(--wp--preset--color--accent, #9DA966);
	--smc-mist: var(--wp--preset--color--mist, #F6F6F2);
	--smc-line: var(--wp--preset--color--line, #DFE3DB);
	--smc-muted: var(--wp--preset--color--muted, #5F6860);
}

/* Brändide logoruudustik (avaleht) */
.sm-brand-logos {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
	border-top: 1px solid var(--smc-line);
	border-left: 1px solid var(--smc-line);
}
.sm-brand-logo {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 120px;
	padding: 1.5rem;
	border-right: 1px solid var(--smc-line);
	border-bottom: 1px solid var(--smc-line);
	color: var(--smc-ink);
	background: #fff;
	transition: background-color .2s;
}
.sm-brand-logo:hover { background: var(--smc-mist); }
.sm-brand-logo img { max-width: 80%; max-height: 64px; width: auto; object-fit: contain; filter: grayscale(1); opacity: .85; transition: filter .2s, opacity .2s; }
.sm-brand-logo:hover img { filter: none; opacity: 1; }
.sm-brand__wordmark { font-weight: 800; font-size: 1.125rem; letter-spacing: -.03em; text-align: center; line-height: 1.2; }

/* Brändide kaardid (brändide leht) */
.sm-brands__toolbar { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; }
.sm-brands__toolbar input { flex: 1; min-width: 220px; border: 1px solid var(--smc-line); padding: .9rem 1.1rem; font: inherit; color: inherit; background: var(--sm-surface, #fff); outline-color: var(--smc-olive); }
.sm-brands__count { color: var(--smc-muted); font-size: .8125rem; }
.sm-brands__filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 2rem; }
.sm-brands__filters button { font: inherit; font-size: .8125rem; font-weight: 700; padding: .5rem .9rem; border: 1px solid var(--smc-line); background: var(--sm-surface, #fff); color: var(--smc-ink); cursor: pointer; }
.sm-brands__filters button:hover { border-color: var(--smc-olive); }
.sm-brands__filters button.is-active { background: var(--smc-olive); border-color: var(--smc-olive); color: var(--sm-on-olive, #fff); }
.sm-brands__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
.sm-brand { border: 1px solid var(--smc-line); display: flex; flex-direction: column; background: var(--sm-surface, #fff); transition: box-shadow .2s, transform .2s; }
.sm-brand[hidden] { display: none; }
.sm-brand:hover { box-shadow: 0 15px 35px #172a1512; transform: translateY(-2px); }
.sm-brand__top { height: 125px; display: flex; align-items: center; justify-content: center; padding: 1.5rem; border-bottom: 1px solid var(--smc-line); background: var(--smc-mist); color: var(--smc-ink); }
.sm-brand__top img { max-width: 76%; max-height: 74px; width: auto; object-fit: contain; }
.sm-brand__body { padding: 1.7rem 1.9rem 1.9rem; display: flex; flex-direction: column; flex: 1; }
.sm-brand__body h3 { font-size: 1.1875rem; margin: 0 0 .8rem; }
.sm-brand__body h3 a { color: inherit; }
.sm-brand__body p { font-size: .875rem; line-height: 1.65; color: var(--smc-muted); margin: 0 0 1.6rem; }
.sm-brand__more { margin-top: auto; font-size: .8125rem; font-weight: 800; }
.sm-brands__empty { color: var(--smc-muted); }
@media (max-width: 1000px) { .sm-brands__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
	.sm-brands__grid { grid-template-columns: 1fr; }
	.sm-brand-logos { grid-template-columns: repeat(2, 1fr); }
	.sm-brand-logo { height: 96px; }
}

/* Brändi päis */
.sm-brand-hero { position: relative; overflow: hidden; background: var(--smc-mist); }
.sm-brand-hero__bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sm-brand-hero.has-image::before { content: ''; position: absolute; inset: 0; z-index: 1; background: linear-gradient(90deg, rgba(245,247,242,.97), rgba(245,247,242,.9) 45%, rgba(245,247,242,.2) 80%, transparent); }
.sm-brand-hero__inner { position: relative; z-index: 2; width: min(100% - 2 * clamp(1.0625rem, 4vw, 2.25rem), 1320px); margin: 0 auto; padding: clamp(3rem, 7vw, 6.5rem) 0; }
.sm-brand-hero__crumbs { font-size: .8125rem; color: var(--smc-muted); margin-bottom: 2rem; }
.sm-brand-hero__crumbs a { color: var(--smc-olive); }
.sm-brand-hero__logo { background: #fff; display: inline-flex; padding: 1rem 1.5rem; border: 1px solid var(--smc-line); margin-bottom: 1.5rem; }
.sm-brand-hero__logo img { max-height: 70px; max-width: 220px; width: auto; object-fit: contain; }
.sm-brand-hero__logo .sm-brand__wordmark { font-size: 1.25rem; }
.sm-brand-hero h1 { margin: 0 0 1.25rem; }
.sm-brand-hero__desc { max-width: 620px; font-size: 1.0625rem; }
.sm-brand-hero__actions { display: flex; gap: 1.5rem; align-items: center; flex-wrap: wrap; margin-top: 2rem; }
.sm-brand-hero__link { font-weight: 700; border-bottom: 1px solid currentColor; padding-bottom: .25rem; }

/* Failid */
.sm-downloads ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .75rem; }
.sm-downloads a { display: flex; justify-content: space-between; gap: 1rem; padding: 1.1rem 1.25rem; border: 1px solid var(--smc-line); color: var(--smc-ink); font-weight: 700; }
.sm-downloads a:hover { border-color: var(--smc-olive); }
.sm-downloads a span { color: var(--smc-olive); font-size: .8125rem; white-space: nowrap; }

/* Toode */
.sm-product-brand a { color: inherit; }
.sm-product-extras { display: flex; gap: 1.5rem; align-items: center; flex-wrap: wrap; margin: 1.5rem 0; }
.sm-product-extras__pdf { font-weight: 700; }
.sm-video { position: relative; aspect-ratio: 16 / 9; background: var(--smc-ink); margin: 1.5rem 0; }
.sm-video button { position: absolute; inset: 0; width: 100%; border: 0; background: transparent; color: #fff; font: inherit; font-size: 1.125rem; font-weight: 700; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .25rem; }
.sm-video button small { font-weight: 400; font-size: .75rem; opacity: .7; }
.sm-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Päringuvorm */
.sm-form { background: var(--sm-surface, #fff); padding: clamp(1.5rem, 4vw, 2.8rem); display: grid; gap: 1rem; border: 1px solid var(--smc-line); }
.sm-form label { font-size: .8125rem; font-weight: 700; display: block; }
.sm-form input:not([type=checkbox]), .sm-form textarea { display: block; width: 100%; margin-top: .4rem; padding: .8rem; border: 1px solid var(--smc-line); font: inherit; font-weight: 400; color: inherit; background: var(--sm-surface, #fff); box-sizing: border-box; }
.sm-form input:focus, .sm-form textarea:focus { outline: 2px solid var(--smc-olive); outline-offset: -1px; }
.sm-form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.sm-form__check { display: flex !important; gap: .6rem; align-items: flex-start; font-weight: 400 !important; line-height: 1.5; }
.sm-form__check input { margin-top: .2rem; }
.sm-form__hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.sm-form button { width: 100%; justify-content: center; cursor: pointer; }
.sm-form__notice { padding: 1rem 1.25rem; margin: 0; font-weight: 700; }
.sm-form__notice.is-success { background: #eef2e4; color: #48532F; }
.sm-form__notice.is-error { background: #fbeaea; color: #8a1f1f; }
@media (max-width: 640px) { .sm-form__row { grid-template-columns: 1fr; } }

/* Küpsiste bänner */
.sm-consent {
	position: fixed;
	z-index: 100000;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
	background: rgba(19, 25, 20, .35);
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
}
.sm-consent[hidden] { display: none; }
html.sm-consent-open { overflow: hidden; }
.sm-consent__box { max-width: 560px; width: 100%; max-height: calc(100vh - 2rem); overflow-y: auto; box-sizing: border-box; background: var(--sm-surface, #fff); color: var(--smc-ink); border: 1px solid var(--smc-line); box-shadow: 0 20px 50px rgba(19, 25, 20, .18); padding: 1.5rem 1.6rem; font-size: .875rem; line-height: 1.6; }
.sm-consent__title { font-weight: 800; font-size: 1rem; margin: 0 0 .4rem; }
.sm-consent__box p { margin: 0 0 1rem; }
.sm-consent__box a { color: var(--smc-olive); font-weight: 700; }
.sm-consent__prefs { display: grid; gap: .7rem; margin: 0 0 1rem; padding: 1rem 0; border-top: 1px solid var(--smc-line); border-bottom: 1px solid var(--smc-line); }
.sm-consent__prefs[hidden] { display: none; }
.sm-consent__prefs label { display: flex; gap: .7rem; align-items: flex-start; }
.sm-consent__prefs input { margin-top: .3rem; accent-color: var(--smc-olive); }
.sm-consent__prefs strong { display: block; }
.sm-consent__actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.sm-consent__btn { flex: 1 1 auto; font: inherit; font-weight: 700; font-size: .8125rem; padding: .75rem 1rem; border: 1px solid var(--smc-olive); background: var(--sm-surface, #fff); color: var(--smc-olive); cursor: pointer; }
.sm-consent__btn[hidden] { display: none; }
.sm-consent__btn.is-primary, .sm-consent__btn:hover { background: var(--smc-olive); color: var(--sm-on-olive, #fff); }
@media (max-width: 640px) {
	.sm-consent { padding: .5rem; }
	.sm-consent__box { padding: 1.1rem; }
}
