/**
 * Teb Open — Base: reset, typography, buttons, forms, utilities.
 */

/* ---------- Reset ---------- */
*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}

body {
	margin: 0;
	font-family: var(--to-font);
	font-size: var(--to-fs-base);
	line-height: var(--to-lh);
	color: var(--to-text);
	background: var(--to-bg);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

img,
svg,
video,
iframe {
	max-width: 100%;
	height: auto;
	display: block;
}

h1, h2, h3, h4, h5, h6 {
	margin: 0;
	line-height: 1.4;
	font-weight: 700;
}

p {
	margin: 0 0 var(--to-space-4);
}

a {
	color: var(--to-primary-strong);
	text-decoration: none;
	transition: color var(--to-dur-fast) var(--to-ease);
}

a:hover {
	color: var(--to-primary-deep);
}

[data-theme='dark'] a:hover {
	color: var(--to-primary);
}

ul, ol {
	margin: 0;
	padding: 0;
}

button {
	font-family: inherit;
	cursor: pointer;
}

input, textarea, select {
	font-family: inherit;
	font-size: var(--to-fs-m);
}

:focus-visible {
	outline: 2px solid var(--to-primary-strong);
	outline-offset: 2px;
	border-radius: var(--to-radius-s);
}

[data-theme='dark'] :focus-visible {
	outline-color: var(--to-primary);
}

/* ---------- Layout primitives ---------- */
.to-container {
	width: 100%;
	max-width: var(--to-container);
	margin-inline: auto;
	padding-inline: var(--to-space-4);
}

@media (min-width: 768px) {
	.to-container {
		padding-inline: var(--to-space-6);
	}
}

.to-site {
	min-height: 100vh;
	min-height: 100dvh;
	display: flex;
	flex-direction: column;
}

.to-main {
	flex: 1 0 auto;
	padding-block: var(--to-space-5) var(--to-space-7);
}

@media (min-width: 1024px) {
	.to-main {
		padding-block: var(--to-space-6) var(--to-space-8);
	}
}

/* ---------- Icons ---------- */
.to-icon {
	width: 22px;
	height: 22px;
	flex-shrink: 0;
	display: inline-flex;
	vertical-align: middle;
}

.to-icon--xs { width: 14px; height: 14px; }
.to-icon--s { width: 18px; height: 18px; }
.to-icon--lg { width: 32px; height: 32px; }
.to-icon--xl { width: 48px; height: 48px; }
.to-icon--giant { width: 72px; height: 72px; stroke-width: 1.3; }
.to-icon--flip { transform: rotate(180deg); }

/* ---------- Skip link ---------- */
.to-skip-link {
	position: absolute;
	inset-inline-start: 16px;
	top: -48px;
	z-index: 200;
	background: var(--to-surface);
	color: var(--to-text);
	padding: 10px 16px;
	border-radius: var(--to-radius-s);
	box-shadow: var(--to-shadow-2);
	transition: top var(--to-dur-fast) var(--to-ease);
}

.to-skip-link:focus {
	top: 12px;
}

/* ---------- Buttons ---------- */
.to-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--to-space-2);
	padding: 10px 20px;
	border: 1px solid transparent;
	border-radius: var(--to-radius-m);
	font-size: var(--to-fs-m);
	font-weight: 600;
	line-height: 1.5;
	min-height: 44px;
	background: var(--to-surface-2);
	color: var(--to-text);
	transition: background var(--to-dur-fast) var(--to-ease), color var(--to-dur-fast) var(--to-ease), border-color var(--to-dur-fast) var(--to-ease), transform var(--to-dur-fast) var(--to-ease), box-shadow var(--to-dur-fast) var(--to-ease);
	user-select: none;
}

.to-btn:active {
	transform: scale(0.98);
}

.to-btn--primary {
	background: var(--to-primary-strong);
	color: #fff;
	box-shadow: var(--to-shadow-1);
}

.to-btn--primary:hover {
	background: var(--to-primary-deep);
	color: #fff;
}

[data-theme='dark'] .to-btn--primary {
	background: var(--to-primary-strong);
	color: #06231f;
}

.to-btn--accent {
	background: var(--to-accent-strong);
	color: #fff;
}

.to-btn--accent:hover {
	background: var(--to-accent);
	color: #fff;
}

.to-btn--ghost {
	background: transparent;
	border-color: var(--to-border-2);
	color: var(--to-text);
}

.to-btn--ghost:hover {
	background: var(--to-surface-2);
	color: var(--to-text);
}

.to-btn--sm {
	padding: 6px 14px;
	min-height: 38px;
	font-size: var(--to-fs-s);
}

.to-btn--lg {
	padding: 12px 28px;
	min-height: 50px;
	font-size: var(--to-fs-base);
	border-radius: var(--to-radius-l);
}

.to-btn--block {
	width: 100%;
}

.to-btn:disabled,
.to-btn.is-loading {
	opacity: 0.65;
	pointer-events: none;
}

/* ---------- Forms ---------- */
.to-field {
	margin-bottom: var(--to-space-4);
}

.to-field label {
	display: block;
	margin-bottom: var(--to-space-2);
	font-size: var(--to-fs-s);
	font-weight: 600;
	color: var(--to-text-2);
}

.to-field input[type='text'],
.to-field input[type='email'],
.to-field input[type='tel'],
.to-field input[type='search'],
.to-field input[type='url'],
.to-field input[type='password'],
.to-field input[type='number'],
.to-field textarea,
.to-field select,
.to-searchform__input {
	width: 100%;
	padding: 10px 14px;
	border: 1px solid var(--to-border-2);
	border-radius: var(--to-radius-m);
	background: var(--to-surface);
	color: var(--to-text);
	transition: border-color var(--to-dur-fast) var(--to-ease), box-shadow var(--to-dur-fast) var(--to-ease);
}

.to-field textarea {
	min-height: 120px;
	resize: vertical;
}

.to-field input:focus,
.to-field textarea:focus,
.to-field select:focus {
	outline: none;
	border-color: var(--to-primary-strong);
	box-shadow: var(--to-ring);
}

.to-field--hp {
	position: absolute !important;
	inset-inline-start: -9999px !important;
	opacity: 0;
	height: 0;
	overflow: hidden;
}

.to-field--hp label {
	font-size: 0;
}

.to-field--hp input {
	pointer-events: none;
}

/* ---------- Badges ---------- */
.to-badge {
	display: inline-flex;
	align-items: center;
	padding: 3px 10px;
	border-radius: var(--to-radius-pill);
	font-size: var(--to-fs-xs);
	font-weight: 700;
	line-height: 1.6;
	white-space: nowrap;
}

.to-badge--sale {
	background: var(--to-accent);
	color: #fff;
}

.to-badge--new {
	background: var(--to-primary-soft);
	color: var(--to-primary-strong);
}

[data-theme='dark'] .to-badge--new {
	color: var(--to-primary);
}

.to-badge--out {
	background: var(--to-surface-3);
	color: var(--to-text-3);
}

.to-badge--success {
	background: var(--to-success-soft);
	color: var(--to-success);
}

/* ---------- Price digits ---------- */
.to-price-amount,
.woocommerce-Price-amount,
bdi {
	font-family: var(--to-num-font);
	font-feature-settings: 'tnum';
}

/* ---------- Screen reader / utilities ---------- */
[hidden] {
	display: none !important;
}

.sr-only {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

.to-grid {
	display: grid;
	gap: var(--to-space-4);
	grid-template-columns: 1fr;
}

@media (min-width: 576px) {
	.to-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
	.to-grid--3 { grid-template-columns: repeat(3, 1fr); }
	.to-grid--4 { grid-template-columns: repeat(4, 1fr); gap: var(--to-space-5); }
}

@media (min-width: 1280px) {
	.to-grid--4 { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- Scroll reveal ---------- */
.to-reveal {
	opacity: 0;
	transform: translateY(16px);
	transition: opacity var(--to-dur-slow) var(--to-ease), transform var(--to-dur-slow) var(--to-ease);
}

.to-reveal.is-visible {
	opacity: 1;
	transform: none;
}

@media (prefers-reduced-motion: reduce) {
	.to-reveal {
		opacity: 1;
		transform: none;
	}
}

/* ---------- Prose (rich text) ---------- */
.to-prose {
	font-size: var(--to-fs-base);
	color: var(--to-text-2);
	max-width: 72ch;
}

.to-prose > * + * {
	margin-top: 1em;
}

.to-prose h2,
.to-prose h3,
.to-prose h4 {
	color: var(--to-text);
	margin-top: 1.6em;
}

.to-prose a {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.to-prose ul,
.to-prose ol {
	padding-inline-start: 1.4em;
	margin-block: 1em;
}

.to-prose ul { list-style: disc; }
.to-prose ol { list-style: decimal; }

.to-prose li + li {
	margin-top: 0.4em;
}

.to-prose blockquote {
	margin: 1.4em 0;
	padding: var(--to-space-4) var(--to-space-5);
	border-inline-start: 3px solid var(--to-primary);
	background: var(--to-surface-2);
	border-radius: var(--to-radius-s);
	color: var(--to-text);
}

.to-prose img {
	border-radius: var(--to-radius-m);
}

.to-prose table {
	width: 100%;
	border-collapse: collapse;
}

.to-prose table th,
.to-prose table td {
	border: 1px solid var(--to-border);
	padding: 10px 12px;
	text-align: start;
}

.to-prose code,
.to-prose pre {
	background: var(--to-surface-2);
	border-radius: var(--to-radius-s);
	font-size: 0.9em;
}

.to-prose pre {
	padding: var(--to-space-4);
	overflow-x: auto;
}

/* ---------- Widget ---------- */
.to-widget {
	background: var(--to-surface);
	border: 1px solid var(--to-border);
	border-radius: var(--to-radius-l);
	padding: var(--to-space-5);
	margin-bottom: var(--to-space-4);
}

.to-widget__title {
	font-size: var(--to-fs-base);
	margin-bottom: var(--to-space-4);
	color: var(--to-text);
}

/* ---------- Print ---------- */
@media print {
	.to-header,
	.to-footer,
	.to-bottomnav,
	.to-strip,
	.to-announce,
	.to-totop,
	.to-sticky-buy,
	.to-toasts {
		display: none !important;
	}
}
