/* TRANG PHÂN LOẠI NIỀNG RĂNG – form chọn theo từng bước
   JS: assets/js/step-form.js

   Elementor:
   - Container mỗi bước : class "vd-step vd-step--1" / "vd-step vd-step--2" / "vd-step vd-step--3"
   - Lưới ô chọn        : class "vd-pick-grid"
   - Ô chọn             : class "vd-pick" = container "Khung ảnh" (class vd-pick__media, chứa widget Ảnh) + widget Tiêu đề
   - Ảnh tròn đối tượng : container class "vd-avatar" (chứa widget Ảnh)
   - Form bước 3        : [contact-form-7 id="7dca91b" html_class="vd-form vd-form--steps"]
*/

/* ---------- Ẩn / hiện bước ---------- */
.vd-step.is-locked { display: none !important; }
.vd-step.is-revealed { animation: vd-step-in .45s ease both; }
@keyframes vd-step-in {
	from { opacity: 0; transform: translateY(24px); }
	to   { opacity: 1; transform: none; }
}

/* ---------- Lưới ô chọn ---------- */
.vd-pick-grid {
	display: grid !important;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 34px 22px;
}
.vd-pick-grid > .vd-pick { width: auto !important; }

/* ---------- Ô chọn ---------- */
.vd-pick {
	position: relative;
	cursor: pointer;
	outline: 0;
	-webkit-tap-highlight-color: transparent;
}
/* Khung ảnh xanh nhạt (container con có class vd-pick__media, chứa widget Ảnh) */
.vd-pick .vd-pick__media {
	aspect-ratio: 1 / 1;
	width: 100%;
	border-color: transparent !important;
	overflow: hidden;
	transition: border-color .2s ease, box-shadow .2s ease;
}
.vd-pick__media .elementor-widget-image { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.vd-pick__media .elementor-widget-image img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
}
.vd-pick:hover .vd-pick__media { border-color: rgba(4, 186, 113, .45) !important; }
.vd-pick:focus-visible .vd-pick__media { box-shadow: 0 0 0 3px rgba(4, 186, 113, .35); }
.vd-pick.is-selected .vd-pick__media {
	border-color: #04BA71 !important;
	box-shadow: 0 8px 22px rgba(4, 186, 113, .18);
}

/* Ô vuông check ở góc phải trên */
.vd-pick::after {
	content: "";
	position: absolute;
	top: 14px;
	right: 14px;
	width: 26px;
	height: 26px;
	border-radius: 4px;
	background: #fff center / 16px no-repeat;
	z-index: 2;
	transition: background-color .2s ease;
	pointer-events: none;
}
.vd-pick.is-selected::after {
	background-color: #04BA71;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12.5l5 5L20 6.5'/%3E%3C/svg%3E");
}
.vd-pick.is-selected .elementor-heading-title { color: #04BA71 !important; }

/* ---------- Ảnh tròn trẻ em / người lớn ---------- */
.vd-avatar { aspect-ratio: 1 / 1; }
.vd-avatar .elementor-widget-image,
.vd-avatar .elementor-widget-image .elementor-widget-container { width: 100%; height: 100%; }
.vd-avatar img { width: 100%; height: 100% !important; object-fit: cover; }

/* ---------- Form bước 3 ---------- */
.vd-form--steps .vd-form__grid { gap: 14px 8px; }
.vd-form--steps input[type="number"] { -moz-appearance: textfield; }
.vd-form--steps input[type="number"]::-webkit-outer-spin-button,
.vd-form--steps input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Hàng tải ảnh: chữ hướng dẫn | nút | trạng thái */
.vd-upload {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	gap: 12px;
	margin-top: 16px;
}
.vd-upload p { margin: 0 !important; }
.vd-upload__hint {
	padding-left: 10px;
	font-size: 12px;
	line-height: 1.35;
	color: #3C3C3C;
}
.vd-form .vd-upload__btn {
	width: auto;
	margin: 0;
	padding: 9px 20px;
	border-radius: 30px;
	background: #09A956;
	font-size: 13px;
	font-weight: 500;
	white-space: nowrap;
}
.vd-upload__status {
	font-size: 11px;
	line-height: 1.35;
	color: #A0A0A0;
	word-break: break-word;
}
.vd-upload__status.has-files { color: #04BA71; }

/* 2 ô file gốc của CF7: ẩn đi nhưng vẫn giữ chỗ báo lỗi */
.vd-upload__inputs { grid-column: 1 / -1; }
.vd-upload__inputs input[type="file"] {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	opacity: 0;
	pointer-events: none;
}
.vd-upload__inputs .wpcf7-not-valid-tip { margin-left: 10px; }
/* Trình duyệt cũ: hiện ô chọn file gốc, ẩn nút tự làm */
.vd-upload--native .vd-upload__btn,
.vd-upload--native .vd-upload__status { display: none; }
.vd-upload--native .vd-upload__inputs input[type="file"] {
	position: static !important;
	width: 100% !important;
	height: auto !important;
	opacity: 1;
	pointer-events: auto;
	margin-top: 8px;
}

.vd-form--steps .vd-form__submit { position: relative; }
.vd-form--steps .wpcf7-submit {
	width: auto;
	min-width: 160px;
	margin: 22px auto 0;
	padding: 11px 36px;
	letter-spacing: .5px;
}

/* ---------- Tablet / mobile ---------- */
@media (max-width: 1024px) {
	.vd-pick-grid { gap: 26px 16px; }
}
@media (max-width: 767px) {
	.vd-pick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 14px; }
	.vd-pick::after { top: 10px; right: 10px; width: 22px; height: 22px; background-size: 14px; }
	.vd-upload { grid-template-columns: 1fr; text-align: center; gap: 8px; }
	.vd-upload__hint { padding-left: 0; }
	.vd-form .vd-upload__btn { justify-self: center; }
}

/* ---------- 2 ô "Dành cho trẻ em & tuổi teen" / "Dành cho người lớn" ----------
   Container class "vd-who" là thẻ <a> -> bấm cả ô sẽ sang trang Niềng răng trẻ em / người lớn.
   Rê chuột: ảnh tròn phóng to nhẹ 1.02. */
a.vd-who,
a.vd-who:hover,
a.vd-who:focus { text-decoration: none !important; color: inherit; }
.vd-who { cursor: pointer; }
.vd-who .vd-avatar { transition: transform .35s ease; }
.vd-who .elementor-heading-title { transition: color .25s ease; }
@media (hover: hover) and (pointer: fine) {
	.vd-who:hover .vd-avatar { transform: scale(1.02); }
	.vd-who:hover .elementor-heading-title { color: #09A956 !important; }
}
.vd-who:focus-visible { outline: 3px solid rgba(4, 186, 113, .4); outline-offset: 6px; border-radius: 12px; }
