/*
 * Tellimustest taganemine – vormi kujundus.
 *
 * Põhimõte: fondid, tekstivärv, väljad ja nupud tulevad teemast.
 * Plugin lisab ainult paigutuse, vahed ja peened eraldusjooned.
 * Toonid arvutatakse teema tekstivärvist (currentColor), seega sobivad
 * nii heleda kui tumeda kujundusega.
 *
 * Rõhuvärvi saab teema poolt muuta muutujaga --td-tt-accent.
 * Astra teemas kasutatakse automaatselt teema põhivärvi.
 */

.td-tt {
	/* Vormi põhifont. Teise kliendi jaoks muuda ainult seda rida
	   (või kirjuta üle teema CSS-is: .td-tt { --td-tt-font: ...; }). */
	--td-tt-font: "Cormorant Garamond", Georgia, serif;
	--td-tt-accent: var(--ast-global-color-0, currentColor);
	--td-tt-line: rgba(0, 0, 0, .12);
	--td-tt-soft: rgba(0, 0, 0, .035);
	--td-tt-muted-opacity: .68;
	--td-tt-radius: 6px;
	--td-tt-gap: 1.25rem;

	max-width: 640px;
	margin: 0 auto 2rem;
	font-family: var(--td-tt-font);
	color: inherit;
	line-height: 1.5;
}

@supports (color: color-mix(in srgb, red 50%, transparent)) {
	.td-tt {
		--td-tt-line: color-mix(in srgb, currentColor 14%, transparent);
		--td-tt-soft: color-mix(in srgb, currentColor 4%, transparent);
	}
}

/* Vormielemendid (väli, rippmenüü, nupp) ei päri brauseris fonti ise,
   ja teema võib anda eri elementidele eri fondi – ühtlustame. */
.td-tt p,
.td-tt span,
.td-tt label,
.td-tt legend,
.td-tt li,
.td-tt dt,
.td-tt dd,
.td-tt h3,
.td-tt input,
.td-tt select,
.td-tt button {
	font-family: var(--td-tt-font);
}

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

.td-tt p { margin: 0; }

/* ---------- Sammude näidik ---------- */

.td-tt-steps {
	display: flex;
	gap: .5rem;
	list-style: none;
	margin: 0 0 var(--td-tt-gap);
	padding: 0;
	counter-reset: none;
}

.td-tt-step {
	flex: 1 1 0;
	display: flex;
	align-items: center;
	gap: .5rem;
	margin: 0;
	padding: 0 0 .6rem;
	border-bottom: 2px solid var(--td-tt-line);
	font-size: .9em;
	opacity: .55;
}

.td-tt-step.is-current,
.td-tt-step.is-done {
	opacity: 1;
	border-bottom-color: var(--td-tt-accent);
}

.td-tt-step.is-current .td-tt-step__label { font-weight: 600; }

.td-tt-step__num {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 1.6em;
	height: 1.6em;
	border-radius: 50%;
	border: 1px solid currentColor;
	font-size: .85em;
	line-height: 1;
	margin: 10px;
}

.td-tt-step.is-current .td-tt-step__num,
.td-tt-step.is-done .td-tt-step__num {
	background: var(--td-tt-accent);
	border-color: var(--td-tt-accent);
	color: #fff;
}

/* ---------- Kaart ---------- */

.td-tt-card {
	padding: clamp(1.25rem, 4vw, 2rem);
	border: 1px solid var(--td-tt-line);
	border-radius: var(--td-tt-radius);
	background: transparent;
}

.td-tt .td-tt-card > * { margin-bottom: 0; }
.td-tt .td-tt-card > * + * { margin-top: var(--td-tt-gap); }

.td-tt-card__head {
	display: flex;
	align-items: baseline;
	gap: .5rem;
	padding-bottom: 1rem;
	border-bottom: 1px solid var(--td-tt-line);
}

.td-tt-eyebrow {
	font-size: .8em;
	text-transform: uppercase;
	letter-spacing: .06em;
	opacity: var(--td-tt-muted-opacity);
}

.td-tt-order-no { font-weight: 600; }

.td-tt-lead { opacity: .85; }

/* ---------- Väljad ---------- */

.td-tt-fields { display: grid; gap: 1rem; }

.td-tt-field { display: flex; flex-direction: column; gap: .35rem; }

.td-tt-field label,
.td-tt-items legend {
	display: block;
	font-weight: 600;
	font-size: .95em;
}

.td-tt-field input[type="email"],
.td-tt-field input[type="text"] {
	width: 100%;
	max-width: 100%;
}

.td-tt-hint {
	font-size: .875em;
	opacity: var(--td-tt-muted-opacity);
}

.td-tt-hint--block { display: block; }

/* ---------- Tootevalik ---------- */

.td-tt-items {
	border: 0;
	margin: 0;
	padding: 0;
	min-width: 0;
}

.td-tt-items legend { margin-bottom: .5rem; padding: 0; }

.td-tt-item-list {
	list-style: none;
	margin: 0;
	padding: 0;
	border-top: 1px solid var(--td-tt-line);
}

.td-tt-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	margin: 0;
	padding: .85rem 0;
	border-bottom: 1px solid var(--td-tt-line);
}

.td-tt-item__text { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }

.td-tt-item__name { font-weight: 500; overflow-wrap: anywhere; cursor: pointer; }

.td-tt-item__meta { font-size: .85em; opacity: var(--td-tt-muted-opacity); }

.td-tt-item__qty { display: flex; align-items: center; gap: .5rem; flex: 0 0 auto; }

.td-tt-item__qty-label { font-size: .85em; opacity: var(--td-tt-muted-opacity); }

/* Teemad venitavad select'i sageli täislaiuseks – siin piisab kitsast. */
.td-tt .td-tt-item__qty select {
	width: auto;
	min-width: 4.5rem;
	margin: 0;
}

/* ---------- Nupud ---------- */

.td-tt-actions { display: flex; }

.td-tt .td-tt-button { margin: 0; cursor: pointer; }

/* ---------- Teated ---------- */

/* Teate välimus tuleb WooCommerce'ist / teemast, siin ainult vahe vormist. */
.td-tt .td-tt-notices { margin: 0 0 var(--td-tt-gap); }
.td-tt .td-tt-notices ul { margin-bottom: 0; }

/* ---------- Kinnitus ---------- */

.td-tt-done { text-align: left; }

.td-tt-done__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 3rem;
	height: 3rem;
	border-radius: 50%;
	background: rgba(46, 125, 50, .12);
	color: #2e7d32;
}

.td-tt .td-tt-card > .td-tt-done__title { margin-top: .75rem; }

.td-tt-summary {
	margin: 0;
	border-top: 1px solid var(--td-tt-line);
}

.td-tt-summary > div {
	display: grid;
	grid-template-columns: minmax(7rem, 35%) 1fr;
	gap: 1rem;
	padding: .7rem 0;
	border-bottom: 1px solid var(--td-tt-line);
}

.td-tt-summary dt { margin: 0; opacity: var(--td-tt-muted-opacity); font-weight: 400; }

.td-tt-summary dd { margin: 0; }

.td-tt-summary__item { display: block; }

/* ---------- Mobiil ---------- */

@media (max-width: 480px) {
	.td-tt-step__label { font-size: .85em; }
	.td-tt-actions .td-tt-button { width: 100%; text-align: center; justify-content: center; }
	.td-tt-summary > div { grid-template-columns: 1fr; gap: .15rem; }
}

/* ---------- Lõksväli (peidetud ka ekraanilugerite eest) ---------- */

.td-tt-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}
