/* Taiba Request a Quote — front end. Colors come from settings as CSS variables. */

/* ---------- Buttons ---------- */
:is(button, a).trq-btn.trq-btn {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: auto;
	min-height: 0;
	margin: 0;
	padding: var(--trq-pad-y) var(--trq-pad-x);
	font-family: inherit;
	font-size: var(--trq-font-size);
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: inherit;
	text-transform: none;
	text-decoration: none;
	white-space: nowrap;
	color: var(--trq-primary-text);
	background: var(--trq-primary);
	border: 2px solid var(--trq-primary);
	border-radius: var(--trq-radius);
	box-shadow: none;
	cursor: pointer;
	transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
:is(button, a).trq-btn.trq-btn--outline {
	background: transparent;
	color: var(--trq-primary);
}
:is(button, a).trq-btn.trq-btn:hover,
:is(button, a).trq-btn.trq-btn:focus-visible,
:is(button, a).trq-btn.trq-btn.is-added {
	background: var(--trq-hover);
	border-color: var(--trq-hover);
	color: var(--trq-hover-text);
	text-decoration: none;
}
:is(button, a).trq-btn.trq-btn:focus-visible {
	outline: 2px solid var(--trq-hover);
	outline-offset: 3px;
}
:is(button, a).trq-btn.trq-btn--block { width: 100%; }
.trq-btn.is-loading { pointer-events: none; }
.trq-btn.is-loading .trq-btn__label { opacity: 0; }
.trq-btn.is-loading::after {
	content: "";
	position: absolute;
	width: 18px;
	height: 18px;
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	animation: trq-spin .7s linear infinite;
}

/* ---------- Quantity ---------- */
.trq-qty {
	display: inline-flex;
	align-items: stretch;
	flex: 0 0 auto;
	background: var(--trq-input-bg);
	border: 1px solid var(--trq-border);
	border-radius: var(--trq-radius);
	overflow: hidden;
}
.trq-qty button.trq-qty__btn {
	width: 38px;
	min-height: 42px;
	margin: 0;
	padding: 0;
	font: inherit;
	font-size: 18px;
	line-height: 1;
	color: var(--trq-text);
	background: transparent;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	cursor: pointer;
	transition: color .2s, background-color .2s;
}
.trq-qty button.trq-qty__btn:hover { color: var(--trq-primary); background: rgba(255, 255, 255, .04); }
.trq-qty input.trq-qty__input {
	width: 50px;
	min-height: 42px;
	margin: 0;
	padding: 0;
	font: inherit;
	font-weight: 600;
	text-align: center;
	color: var(--trq-text);
	background: transparent;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	-moz-appearance: textfield;
	appearance: textfield;
}
.trq-qty input.trq-qty__input:focus { outline: none; }
.trq-qty input::-webkit-outer-spin-button,
.trq-qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.trq-single {
	display: flex;
	flex-wrap: wrap;
	align-items: stretch;
	gap: 12px;
}

/* ---------- Header icon ---------- */
a.trq-icon {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	color: var(--trq-icon);
	text-decoration: none;
	line-height: 1;
	transition: color .2s;
}
a.trq-icon:hover { color: var(--trq-hover); }
.trq-icon__svg { position: relative; display: inline-flex; }
.trq-icon__svg svg { width: var(--trq-icon-size); height: var(--trq-icon-size); }
.trq-icon__label { font-weight: 600; }
.trq-count {
	position: absolute;
	top: -8px;
	right: -11px;
	box-sizing: border-box;
	min-width: 20px;
	height: 20px;
	padding: 0 5px;
	font-size: 11px;
	font-weight: 700;
	line-height: 20px;
	text-align: center;
	color: var(--trq-badge-text);
	background: var(--trq-badge);
	border-radius: 999px;
}
.trq-count.is-bump { animation: trq-bump .45s ease; }
.trq-icon--hide-empty .trq-count--empty { display: none; }

/* ---------- Quote page ---------- */
.trq-quote { color: var(--trq-text); font-size: 15px; line-height: 1.55; }
.trq-quote *, .trq-quote *::before, .trq-quote *::after { box-sizing: border-box; }

.trq-quote__grid {
	display: grid;
	grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
	gap: 28px;
	align-items: start;
}
.trq-card {
	padding: 28px;
	background: var(--trq-card-bg);
	border: 1px solid var(--trq-border);
	border-radius: 12px;
}
.trq-card--form { position: sticky; top: 30px; }
.trq-quote .trq-card__title {
	margin: 0 0 18px;
	font-size: 22px;
	line-height: 1.3;
	color: var(--trq-text);
}
.trq-quote .trq-card__intro { margin: -6px 0 22px; color: var(--trq-muted); font-size: 14px; }

/* List */
.trq-list__head,
.trq-item {
	display: grid;
	grid-template-columns: 72px minmax(0, 1fr) auto 36px;
	align-items: center;
	gap: 16px;
}
.trq-list__head {
	padding-bottom: 10px;
	font-size: 13px;
	font-weight: 600;
	color: var(--trq-muted);
	border-bottom: 1px solid var(--trq-border);
}
.trq-list__head span:first-child { grid-column: 1 / 3; }
.trq-item {
	padding: 16px 0;
	border-bottom: 1px solid var(--trq-border);
}
.trq-item__img img {
	display: block;
	width: 72px;
	height: 72px;
	object-fit: cover;
	background: #fff;
	border-radius: 8px;
}
.trq-quote a.trq-item__name {
	display: block;
	margin-bottom: 3px;
	font-weight: 600;
	line-height: 1.35;
	color: var(--trq-text);
	text-decoration: none;
}
.trq-quote a.trq-item__name:hover { color: var(--trq-primary); }
.trq-item__meta { display: block; font-size: 13px; color: var(--trq-muted); }

.trq-quote button.trq-remove {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	margin: 0;
	padding: 0;
	color: var(--trq-muted);
	background: transparent;
	border: 1px solid var(--trq-border);
	border-radius: 50%;
	box-shadow: none;
	cursor: pointer;
	transition: color .2s, background-color .2s, border-color .2s;
}
.trq-quote button.trq-remove svg { width: 16px; height: 16px; }
.trq-quote button.trq-remove:hover,
.trq-quote button.trq-remove:focus-visible { color: #fff; background: #d64045; border-color: #d64045; }

.trq-list__foot {
	display: flex;
	justify-content: flex-end;
	gap: 24px;
	padding-top: 16px;
	font-size: 14px;
	color: var(--trq-muted);
}
.trq-list__foot strong { color: var(--trq-text); }
.trq-quote.is-busy .trq-list { opacity: .5; pointer-events: none; transition: opacity .15s; }

/* Form */
.trq-fields {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
}
.trq-quote .trq-field { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.trq-field--full { grid-column: 1 / -1; }
.trq-quote .trq-field label { font-size: 14px; font-weight: 600; color: var(--trq-text); }
.trq-req { color: var(--trq-primary); }
.trq-quote .trq-form .trq-field :is(input, select, textarea) {
	width: 100%;
	min-height: 46px;
	margin: 0;
	padding: 11px 14px;
	font: inherit;
	font-size: 15px;
	color: var(--trq-text);
	background: var(--trq-input-bg);
	border: 1px solid var(--trq-border);
	border-radius: 8px;
	box-shadow: none;
	outline: none;
	transition: border-color .2s, box-shadow .2s;
}
.trq-quote .trq-form .trq-field textarea { min-height: 110px; resize: vertical; }
.trq-quote .trq-form .trq-field :is(input, select, textarea):focus {
	border-color: var(--trq-primary);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--trq-primary) 25%, transparent);
}
.trq-quote .trq-form .trq-field :is(input, textarea)::placeholder { color: var(--trq-muted); }
.trq-quote .trq-form .trq-field select option { color: #111; background: #fff; }
.trq-quote .trq-form .trq-field input[type="file"] { padding: 8px; cursor: pointer; }
.trq-quote .trq-form .trq-field input[type="file"]::file-selector-button {
	margin-right: 12px;
	padding: 6px 12px;
	font: inherit;
	font-size: 13px;
	font-weight: 600;
	color: var(--trq-primary-text);
	background: var(--trq-primary);
	border: 0;
	border-radius: 6px;
	cursor: pointer;
}
.trq-field__hint { font-size: 12px; color: var(--trq-muted); }
.trq-field.has-error :is(input, select, textarea) { border-color: #d64045 !important; }

.trq-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}
.trq-form-msg:empty { display: none; }
.trq-form-msg {
	margin-top: 18px;
	padding: 12px 14px;
	font-size: 14px;
	color: #ffb3b5;
	background: rgba(214, 64, 69, .12);
	border: 1px solid rgba(214, 64, 69, .5);
	border-radius: 8px;
}
.trq-quote button.trq-btn.trq-submit { width: 100%; margin-top: 20px; padding: 14px 22px; }

/* Empty + success */
.trq-empty,
.trq-success {
	padding: 60px 24px;
	text-align: center;
	background: var(--trq-card-bg);
	border: 1px solid var(--trq-border);
	border-radius: 12px;
}
.trq-empty__icon,
.trq-success__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 76px;
	height: 76px;
	margin-bottom: 18px;
	color: var(--trq-primary);
	background: color-mix(in srgb, var(--trq-primary) 15%, transparent);
	border-radius: 50%;
}
.trq-empty__icon svg,
.trq-success__icon svg { width: 34px; height: 34px; }
.trq-quote .trq-success h2 { margin: 0 0 10px; font-size: 26px; color: var(--trq-text); }
.trq-empty p,
.trq-success p { max-width: 500px; margin: 0 auto 22px; color: var(--trq-muted); }
.trq-quote .trq-success p.trq-success__ref { font-weight: 700; color: var(--trq-text); }

/* ---------- Toast ---------- */
.trq-toast-wrap {
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 999999;
	display: flex;
	flex-direction: column;
	gap: 10px;
	max-width: calc(100vw - 40px);
}
.trq-toast {
	display: flex;
	align-items: center;
	gap: 12px;
	min-width: 300px;
	max-width: 440px;
	padding: 14px 14px 14px 16px;
	font-size: 14px;
	line-height: 1.45;
	color: var(--trq-text);
	background: var(--trq-card-bg);
	border: 1px solid var(--trq-border);
	border-left: 4px solid var(--trq-primary);
	border-radius: 10px;
	box-shadow: 0 12px 32px rgba(0, 0, 0, .35);
	animation: trq-in .28s ease;
}
.trq-toast.is-out { animation: trq-out .28s ease forwards; }
.trq-toast--error { border-left-color: #d64045; }
.trq-toast__icon {
	display: inline-flex;
	flex: 0 0 26px;
	align-items: center;
	justify-content: center;
	height: 26px;
	font-size: 14px;
	font-weight: 700;
	color: var(--trq-primary-text);
	background: var(--trq-primary);
	border-radius: 50%;
}
.trq-toast--error .trq-toast__icon { color: #fff; background: #d64045; }
.trq-toast__msg { flex: 1 1 auto; }
a.trq-toast__link {
	flex: 0 0 auto;
	font-weight: 700;
	color: var(--trq-primary);
	text-decoration: underline;
	text-underline-offset: 3px;
	white-space: nowrap;
}
a.trq-toast__link:hover { color: var(--trq-hover); }
.trq-toast button.trq-toast__close {
	flex: 0 0 auto;
	width: 26px;
	height: 26px;
	margin: 0;
	padding: 0;
	font-size: 20px;
	line-height: 1;
	color: var(--trq-muted);
	background: transparent;
	border: 0;
	box-shadow: none;
	cursor: pointer;
}
.trq-toast button.trq-toast__close:hover { color: var(--trq-text); }

/* ---------- Animations ---------- */
@keyframes trq-spin { to { transform: rotate(360deg); } }
@keyframes trq-bump { 0%, 100% { transform: scale(1); } 45% { transform: scale(1.35); } }
@keyframes trq-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes trq-out { to { opacity: 0; transform: translateY(12px); } }

@media (prefers-reduced-motion: reduce) {
	.trq-toast, .trq-toast.is-out, .trq-count.is-bump { animation: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
	.trq-quote__grid { grid-template-columns: 1fr; }
	.trq-card--form { position: static; }
}
@media (max-width: 600px) {
	.trq-card { padding: 20px 16px; }
	.trq-fields { grid-template-columns: 1fr; }
	.trq-list__head { display: none; }
	.trq-item {
		grid-template-columns: 64px minmax(0, 1fr) 34px;
		grid-template-areas: "img info remove" "img qty remove";
		row-gap: 10px;
		align-items: start;
	}
	.trq-item__img { grid-area: img; }
	.trq-item__img img { width: 64px; height: 64px; }
	.trq-item__info { grid-area: info; }
	.trq-item .trq-qty { grid-area: qty; justify-self: start; }
	.trq-quote button.trq-remove { grid-area: remove; width: 34px; height: 34px; }
	.trq-list__foot { justify-content: space-between; }
	.trq-toast-wrap { left: 12px; right: 12px; bottom: 12px; max-width: none; }
	.trq-toast { min-width: 0; max-width: none; flex-wrap: wrap; }
}
