/* ============================================================
 * yunfanzhi-dtc — My Account extras
 * Address book, after-sales evidence upload, profile avatar.
 * Loaded only on /my-account pages (see inc/enqueue.php).
 * ============================================================ */

/* ---------- Shared clear button styles ---------- */
.account-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 10px 18px;
	border-radius: 8px;
	border: 1px solid transparent;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	text-decoration: none;
	transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.account-btn--sm { padding: 7px 13px; font-size: 13px; }

.account-btn--primary {
	background: #111827;
	color: #fff;
}
.account-btn--primary:hover { background: #1f2937; color: #fff; box-shadow: 0 6px 16px rgba(17, 24, 39, .16); }

.account-btn--secondary {
	background: #fff;
	color: #111827;
	border-color: #d1d5db;
}
.account-btn--secondary:hover { border-color: #9ca3af; background: #f9fafb; color: #111827; }

.account-btn--ghost {
	background: transparent;
	color: #4b5563;
	border-color: #e5e7eb;
}
.account-btn--ghost:hover { color: #111827; border-color: #9ca3af; background: #f9fafb; }

.account-btn--danger {
	background: #fff;
	color: #b91c1c;
	border-color: #fecaca;
}
.account-btn--danger:hover { background: #fef2f2; color: #991b1b; border-color: #fca5a5; }

/* ---------- Address book ---------- */
.yfz-ab__lead { color: #6b7280; margin: 0 0 18px; }
.yfz-ab__back { display: inline-flex; align-items: center; gap: 6px; color: #6b7280; text-decoration: none; font-size: 14px; margin-bottom: 14px; }
.yfz-ab__back:hover { color: #111827; }

.yfz-ab__defaults {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 18px;
	margin: 0 0 22px;
}

.yfz-ab__default {
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	background: #fff;
	padding: 18px;
	box-shadow: 0 1px 2px rgba(17, 24, 39, .05);
}
.yfz-ab__default-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-bottom: 8px;
}
.yfz-ab__default-head h4 { margin: 0; font-size: 15px; }
.yfz-ab__badge {
	display: inline-flex;
	background: #ecfdf5;
	color: #047857;
	border: 1px solid #a7f3d0;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 600;
	padding: 2px 9px;
}
.yfz-ab__addr { color: #4b5563; font-size: 13px; line-height: 1.65; margin: 0 0 14px; min-height: 62px; }
.yfz-ab__default.is-empty .yfz-ab__addr { min-height: 40px; }
.yfz-ab__tombstone { display: inline-block; margin-top: 6px; font-size: 12px; color: #b45309; background: #fffbeb; border: 1px dashed #fcd34d; border-radius: 6px; padding: 3px 8px; }
.yfz-ab__card-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.yfz-ab__addbar {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 0 0 26px;
}

.yfz-ab__list { display: grid; gap: 12px; }

.yfz-ab__item {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	background: #fff;
	padding: 16px 18px;
}
.yfz-ab__item-main { min-width: 0; }
.yfz-ab__item-title { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.yfz-ab__item-title strong { font-size: 14px; }
.yfz-ab__type {
	font-size: 11px;
	font-weight: 600;
	color: #4f46e5;
	background: #eef2ff;
	border-radius: 999px;
	padding: 2px 8px;
}
.yfz-ab__addr { color: #6b7280; font-size: 13px; margin: 0; }
.yfz-ab__item-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.yfz-ab__mini-form { display: inline-block; margin: 0; }
.yfz-ab__empty { color: #6b7280; }

/* Address editor */
.yfz-ab__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 14px;
}
.yfz-ab__field { margin: 0; }
.yfz-ab__field label { display: block; margin-bottom: 5px; font-size: 13px; font-weight: 600; }
.yfz-ab__field input,
.yfz-ab__field select {
	width: 100%;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	padding: 10px 12px;
	font-size: 14px;
	background: #fff;
	transition: border-color 160ms ease, box-shadow 160ms ease;
}
.yfz-ab__field input:focus,
.yfz-ab__field select:focus { outline: none; border-color: #111827; box-shadow: 0 0 0 3px rgba(17, 24, 39, .12); }
.yfz-ab__field .required { color: #dc2626; }
.yfz-ab__field--wide { grid-column: 1 / -1; }
.yfz-ab__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
	margin-top: 20px;
}
.yfz-ab__default-toggle {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	font-size: 13px;
	color: #4b5563;
	margin-right: auto;
	cursor: pointer;
}
.yfz-ab__default-toggle input { width: auto; accent-color: #111827; }

@media (max-width: 640px) {
	.yfz-ab__grid { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Avatar cropper modal ---------- */
.yfz-crop {
	position: fixed;
	inset: 0;
	z-index: 2000;
	background: rgba(17, 24, 39, .58);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 18px;
}
.yfz-crop__panel {
	background: #fff;
	border-radius: 14px;
	padding: 20px;
	width: min(400px, 100%);
	box-shadow: 0 18px 48px rgba(17, 24, 39, .28);
}
.yfz-crop__title {
	margin: 0 0 14px;
	font-size: 16px;
	font-weight: 700;
}
.yfz-crop__stage {
	display: flex;
	justify-content: center;
}
.yfz-crop__canvas {
	width: 300px;
	height: 300px;
	max-width: 100%;
	border-radius: 50%;
	background: #f3f4f6;
	cursor: grab;
	touch-action: none;
	box-shadow: 0 0 0 3px rgba(17, 24, 39, .08);
}
.yfz-crop__canvas.is-dragging { cursor: grabbing; }
.yfz-crop__hint {
	margin: 12px 0 10px;
	font-size: 12.5px;
	color: #6b7280;
	line-height: 1.5;
}
.yfz-crop__zoom {
	width: 100%;
	margin: 6px 0 14px;
	accent-color: #111827;
}
.yfz-crop__actions {
	display: flex;
	justify-content: flex-end;
	gap: 10px;
}

/* ---------- Localized file picker (after-sales evidence) ---------- */
.yfz-file {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
	margin-top: 6px;
}
.yfz-file__input {
	position: absolute;
	width: 1px; height: 1px;
	padding: 0; margin: -1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap; border: 0;
}
.yfz-file__name {
	font-size: 13px;
	color: #6b7280;
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.yfz-file__name:not(:empty) { min-width: 40px; }

/* ---------- After-sales evidence ---------- */
.account-aftersales__notice.is-error { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.account-aftersales__hint { display: block; margin-top: 6px; font-size: 12.5px; color: #6b7280; line-height: 1.5; }
.account-aftersales__hint.is-strong {
	margin-top: 8px;
	padding: 8px 10px;
	border-radius: 8px;
	background: #fffbeb;
	border: 1px solid #fcd34d;
	color: #92400e;
	font-weight: 600;
}
.account-aftersales__hint b { color: #374151; }

.account-aftersales__files { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.account-aftersales__thumb { display: inline-flex; }
.account-aftersales__thumb img {
	width: 44px; height: 44px; object-fit: cover;
	border-radius: 8px; border: 1px solid #e5e7eb;
}
.account-aftersales__thumb.is-video {
	display: inline-flex; align-items: center; justify-content: center;
	width: 44px; height: 44px; font-size: 10px; color: #4b5563;
	border-radius: 8px; background: #f3f4f6; border: 1px solid #e5e7eb;
}
.account-aftersales__file-count {
	display: inline-flex; align-items: center; justify-content: center;
	width: 22px; height: 22px; font-size: 11px; font-weight: 700; color: #111827;
	background: #f3f4f6; border-radius: 50%;
}
.account-aftersales__file-link { font-size: 12px; color: #2563eb; text-decoration: none; }

/* ---------- Account profile: date of birth ---------- */
.yfz-dob {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	margin: 6px 0 2px;
}
.yfz-dob select {
	flex: 1 1 120px;
	min-width: 110px;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	padding: 10px 12px;
	font-size: 14px;
	background: #fff;
	transition: border-color 160ms ease, box-shadow 160ms ease;
}
.yfz-dob select:focus {
	outline: none;
	border-color: #111827;
	box-shadow: 0 0 0 3px rgba(17, 24, 39, .12);
}

/* ---------- Account profile: avatar & contact ---------- */
.yfz-account-avatar {
	display: flex;
	align-items: center;
	gap: 20px;
	flex-wrap: wrap;
	margin: 8px 0 4px;
}
.yfz-account-avatar > .account-btn--sm { margin-top: 0; }
.yfz-account-avatar__preview {
	width: 88px; height: 88px; border-radius: 50%;
	object-fit: cover;
	border: 2px solid #e5e7eb;
	background: #f3f4f6;
	overflow: hidden;
	display: flex; align-items: center; justify-content: center;
	font-size: 30px; color: #9ca3af;
}
.yfz-account-avatar__preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.yfz-account-avatar__preview.is-editable {
	cursor: pointer;
	transition: box-shadow 160ms ease, transform 160ms ease;
}
.yfz-account-avatar__preview.is-editable:hover,
.yfz-account-avatar__preview.is-editable:focus-within {
	box-shadow: 0 0 0 3px rgba(79, 70, 229, .28);
	transform: translateY(-1px);
}
.yfz-account-avatar__file {
	position: absolute;
	width: 1px; height: 1px;
	padding: 0; margin: -1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap; border: 0;
}
.yfz-account-avatar__tap { font-size: 13px; font-weight: 600; color: #4b5563; }
.yfz-account-avatar__status { font-size: 12.5px; min-height: 1em; }
.yfz-account-avatar__status.is-ok { color: #047857; font-weight: 600; }
.yfz-account-avatar__status.is-error { color: #b91c1c; font-weight: 600; }
.yfz-account-avatar.is-uploading .yfz-account-avatar__preview { opacity: .6; }
.yfz-account-avatar__controls { display: flex; flex-direction: column; gap: 8px; position: relative; }
.yfz-account-avatar__controls .field-hint { color: #6b7280; font-size: 12.5px; }
