/**
 * YS RAQ Addons - 報價頁面前端樣式
 *
 * 欄位隱藏和 actions flex 佈局由 PHP inline <style> 動態注入，
 * 本檔案負責元件外觀樣式。
 */

/* ── Action Buttons ── */
.ys-raq-actions-left,
.ys-raq-actions-right {
	flex-shrink: 0;
}

.ys-raq-back-to-shop {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	white-space: nowrap;
}

/* ── Custom Form Fields ───────────────────────── */
.ys-raq-custom-field {
	margin-bottom: 15px;
}

.ys-raq-custom-field label {
	display: block;
	margin-bottom: 5px;
	font-weight: 500;
}

.ys-raq-custom-field .required {
	color: #e2401c;
}

.ys-raq-custom-field input[type="text"],
.ys-raq-custom-field input[type="email"],
.ys-raq-custom-field input[type="tel"],
.ys-raq-custom-field input[type="number"],
.ys-raq-custom-field input[type="date"],
.ys-raq-custom-field textarea,
.ys-raq-custom-field select {
	width: 100%;
	max-width: 100%;
	padding: 8px 12px;
	border: 1px solid #d1d1d1;
	border-radius: 4px;
	font-size: 14px;
}

.ys-raq-custom-field textarea {
	resize: vertical;
}

.ys-raq-radio-label {
	display: block;
	margin-bottom: 5px;
	font-weight: normal;
	cursor: pointer;
}

.ys-raq-radio-label input[type="radio"] {
	margin-right: 5px;
}

/* ── Back to Shop Fallback ── */
.ys-raq-back-to-shop-fallback {
	margin: 15px 0;
}

/* ── Responsive ───────────────────────────────── */
@media screen and (max-width: 768px) {
	#yith-ywrq-table-list td.actions {
		flex-direction: column;
		align-items: stretch;
	}

	#yith-ywrq-table-list td.actions .button,
	#yith-ywrq-table-list td.actions .ys-raq-back-to-shop {
		text-align: center;
	}
}

/* ── AJAX 自動更新：loading 狀態 ───────────────── */
.ywraq-form-table-wrapper.ys-raq-loading {
	position: relative;
	pointer-events: none;
}

.ywraq-form-table-wrapper.ys-raq-loading::after {
	content: "";
	position: absolute;
	inset: 0;
	background: rgba(255, 255, 255, 0.55);
	z-index: 10;
	transition: opacity 0.2s;
}

.ywraq-form-table-wrapper.ys-raq-loading::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 28px;
	height: 28px;
	margin: -14px 0 0 -14px;
	border: 3px solid rgba(0, 0, 0, 0.1);
	border-top-color: #2271b1;
	border-radius: 50%;
	z-index: 11;
	animation: ys-raq-spin 0.8s linear infinite;
}

@keyframes ys-raq-spin {
	to { transform: rotate(360deg); }
}

/* ── AJAX 自動更新：toast 提示 ─────────────────── */
.ys-raq-toast {
	position: fixed;
	right: 24px;
	bottom: 24px;
	padding: 10px 18px;
	border-radius: 4px;
	background: #333;
	color: #fff;
	font-size: 14px;
	line-height: 1.4;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
	opacity: 0;
	transform: translateY(10px);
	transition: opacity 0.3s, transform 0.3s;
	z-index: 99999;
	pointer-events: none;
}

.ys-raq-toast.ys-raq-toast-in {
	opacity: 1;
	transform: translateY(0);
}

.ys-raq-toast-success { background: #2e7d32; }
.ys-raq-toast-error   { background: #c62828; }
