/*
 * Parts Market GH – front end.
 * Re-theme from Elementor › Site Settings › Custom CSS by overriding the variables, e.g.
 *   Defaults follow the Parts Market logo: navy #031F34, red #E4131D.
 * Fonts inherit from your theme.
 */
.pmf,
.pm-dash,
.pm-reg,
.pm-listing-meta,
.pm-btns,
.pm-terms,
.pm-stats,
.pm-gallery,
.pm-notice,
.pm-empty {
	--pm-ink: #031f34;
	--pm-muted: #5b6770;
	--pm-line: #d3d9de;
	--pm-field: #ffffff;
	--pm-wash: #f2f4f7;
	--pm-accent: #e4131d;
	--pm-accent-ink: #ffffff;
	--pm-wa: #25d366;
	--pm-wa-ink: #0b3d1f;
	--pm-danger: #b42318;
	--pm-ok: #067647;
	--pm-radius: 6px;
	box-sizing: border-box;
}
.pmf *, .pm-dash *, .pm-reg * { box-sizing: border-box; }

/* ---------- Part finder ---------- */
.pmf {
	--pmf-bg: var(--pm-ink);
	--pmf-text: #fff;
	--pmf-sub: #b8c4d0;
	background: var(--pmf-bg);
	color: var(--pmf-text);
	border-radius: 10px;
	padding: clamp(20px, 4vw, 32px);
	max-width: 760px;
	border-top: 6px solid var(--pm-accent);
}
.pmf--light {
	--pmf-bg: #fff;
	--pmf-text: var(--pm-ink);
	--pmf-sub: var(--pm-muted);
	border: 1px solid var(--pm-line);
	border-top: 6px solid var(--pm-accent);
}
.pmf__title { margin: 0 0 4px; color: inherit; font-size: clamp(1.4rem, 3vw, 1.9rem); line-height: 1.15; letter-spacing: -0.01em; }
.pmf__intro { margin: 0 0 20px; color: var(--pmf-sub); }
.pmf__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 12px; margin-bottom: 18px; }
.pmf__field { display: flex; flex-direction: column; gap: 6px; min-width: 0; margin: 0; padding: 0; border: 0; }
.pmf__field--wide { grid-column: 1 / -1; }
.pmf__field > label, .pmf__field > legend { font-size: 0.875rem; font-weight: 600; color: inherit; padding: 0; }
.pmf__opt { font-weight: 400; color: var(--pmf-sub); }
.pmf select,
.pmf input[type="text"],
.pmf input[type="tel"],
.pmf textarea {
	width: 100%;
	min-height: 48px;
	padding: 10px 12px;
	font: inherit;
	font-size: 1rem;
	color: var(--pm-ink);
	background: var(--pm-field);
	border: 2px solid transparent;
	border-radius: var(--pm-radius);
	box-shadow: inset 0 0 0 1px var(--pm-line);
}
.pmf textarea { min-height: 72px; resize: vertical; }
.pmf select:disabled { opacity: 0.55; cursor: not-allowed; }
.pmf select:focus-visible,
.pmf input:focus-visible,
.pmf textarea:focus-visible,
.pmf button:focus-visible,
.pmf__chip input:focus-visible + span { outline: 3px solid var(--pm-accent); outline-offset: 2px; }
.pmf .is-invalid select,
.pmf .is-invalid input { border-color: #ff8a8f; }
.pmf__err { margin: 0; font-size: 0.85rem; color: #ffb3b6; }
.pmf--light .pmf__err { color: var(--pm-danger); }
.pmf__cond { flex-direction: row; flex-wrap: wrap; gap: 8px; }
.pmf__cond legend { width: 100%; margin-bottom: 6px; }
.pmf__chip { position: relative; cursor: pointer; }
.pmf__chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pmf__chip span {
	display: inline-block;
	padding: 9px 16px;
	border-radius: 999px;
	border: 1px solid currentColor;
	opacity: 0.8;
	font-size: 0.95rem;
}
.pmf__chip input:checked + span { background: var(--pm-accent); color: var(--pm-accent-ink); border-color: var(--pm-accent); opacity: 1; font-weight: 600; }
.pmf__btn,
.pm-btn--primary {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 52px;
	padding: 0 28px;
	font: inherit;
	font-weight: 700;
	font-size: 1.05rem;
	color: var(--pm-accent-ink);
	background: var(--pm-accent);
	border: 0;
	border-radius: var(--pm-radius);
	cursor: pointer;
}
.pmf__btn:hover, .pm-btn--primary:hover { background: #c10f18; }
.pmf__btn:disabled { opacity: 0.6; cursor: progress; }
.pmf [data-step="1"] > .pmf__btn { width: 100%; }
.pmf__actions { display: flex; gap: 12px; align-items: center; }
.pmf__actions .pmf__btn { flex: 1; }
.pmf__back {
	background: none;
	border: 0;
	color: inherit;
	font: inherit;
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
	padding: 8px 4px;
}
.pmf__msg { margin: 12px 0 0; min-height: 1em; color: #ffb3b6; }
.pmf--light .pmf__msg { color: var(--pm-danger); }
.pmf__msg:empty { display: none; }
.pmf__hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.pmf__done { outline: none; }
.pmf__done-title { margin: 0 0 6px; font-size: 1.4rem; font-weight: 700; }
.pmf__done-title::before { content: "✓"; display: inline-grid; place-items: center; width: 1.6em; height: 1.6em; margin-right: 10px; border-radius: 50%; background: var(--pm-accent); color: var(--pm-accent-ink); font-size: 0.9em; }
.pmf__done-text { margin: 0 0 14px; color: var(--pmf-sub); }
.pmf [hidden] { display: none !important; }

@media (max-width: 640px) {
	.pmf__grid { grid-template-columns: 1fr 1fr; }
	.pmf__grid > .pmf__field:first-child { grid-column: 1 / -1; }
}
@media (max-width: 380px) {
	.pmf__grid { grid-template-columns: 1fr; }
}

/* ---------- Listing cards ---------- */
.pm-listing-meta__price { margin: 0 0 8px; font-size: 1.35rem; font-weight: 700; color: var(--pm-ink); }
.pm-listing-meta dl { margin: 0; display: grid; gap: 4px; }
.pm-listing-meta dl > div { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border-bottom: 1px dashed var(--pm-line); font-size: 0.9rem; }
.pm-listing-meta dt { color: var(--pm-muted); }
.pm-listing-meta dd { margin: 0; font-weight: 600; text-align: right; }
.pm-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.pm-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-height: 44px;
	padding: 0 16px;
	border-radius: var(--pm-radius);
	font-weight: 700;
	text-decoration: none !important;
	border: 0;
	cursor: pointer;
	font: inherit;
}
.pm-btn--wa { background: var(--pm-wa); color: var(--pm-wa-ink) !important; }
.pm-btn--wa::before { content: ""; width: 18px; height: 18px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 0 0-8.6 15.1L2 22l5-1.3A10 10 0 1 0 12 2zm5.2 14.2c-.2.6-1.3 1.2-1.8 1.2-.5.1-1 .2-3.3-.7-2.8-1.1-4.5-4-4.7-4.2-.1-.2-1.1-1.5-1.1-2.9s.7-2 1-2.3c.2-.3.5-.3.7-.3h.5c.2 0 .4 0 .6.5l.8 2c.1.2.1.4 0 .5l-.3.5-.4.4c-.1.2-.3.3-.1.6.2.3.8 1.3 1.7 2.1 1.2 1 2.1 1.3 2.4 1.5.3.1.5.1.6-.1l.9-1c.2-.3.4-.2.6-.1l1.9.9c.3.1.5.2.5.3.1.2.1.7-.1 1.1z'/%3E%3C/svg%3E") center/contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 0 0-8.6 15.1L2 22l5-1.3A10 10 0 1 0 12 2zm5.2 14.2c-.2.6-1.3 1.2-1.8 1.2-.5.1-1 .2-3.3-.7-2.8-1.1-4.5-4-4.7-4.2-.1-.2-1.1-1.5-1.1-2.9s.7-2 1-2.3c.2-.3.5-.3.7-.3h.5c.2 0 .4 0 .6.5l.8 2c.1.2.1.4 0 .5l-.3.5-.4.4c-.1.2-.3.3-.1.6.2.3.8 1.3 1.7 2.1 1.2 1 2.1 1.3 2.4 1.5.3.1.5.1.6-.1l.9-1c.2-.3.4-.2.6-.1l1.9.9c.3.1.5.2.5.3.1.2.1.7-.1 1.1z'/%3E%3C/svg%3E") center/contain no-repeat; }
.pm-btn--call { background: var(--pm-ink); color: #fff !important; }
.pm-btn:focus-visible { outline: 3px solid var(--pm-accent); outline-offset: 2px; }
.pm-gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.pm-gallery a:first-child { grid-column: 1 / -1; }
.pm-gallery img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--pm-radius); display: block; aspect-ratio: 4 / 3; }

/* ---------- Term links & stats ---------- */
.pm-terms { list-style: none; margin: 0; padding: 0; columns: var(--pm-cols, 4) 160px; column-gap: 24px; }
.pm-terms li { break-inside: avoid; padding: 5px 0; }
.pm-terms a { color: inherit; text-decoration: none; border-bottom: 1px solid var(--pm-line); }
.pm-terms a:hover { border-bottom-color: var(--pm-accent); }
.pm-terms__count { color: var(--pm-muted); font-size: 0.85em; }
.pm-stats table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.pm-stats th, .pm-stats td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--pm-line); }
.pm-stats th { font-size: 0.85rem; color: var(--pm-muted); font-weight: 600; }
.pm-stats td:nth-child(n+2), .pm-stats th:nth-child(n+2) { text-align: right; }
.pm-stats a { color: inherit; }

/* ---------- Supplier forms & dashboard ---------- */
.pm-dash, .pm-reg { color: var(--pm-ink); max-width: 900px; }
.pm-dash__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.pm-dash__h { margin: 0; font-size: 1.5rem; }
.pm-dash__logout { color: var(--pm-muted); font-size: 0.9rem; }
.pm-dash__tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 2px solid var(--pm-line); margin-bottom: 20px; }
.pm-dash__tabs a { padding: 12px 16px; text-decoration: none; color: var(--pm-muted); font-weight: 600; white-space: nowrap; border-bottom: 3px solid transparent; margin-bottom: -2px; }
.pm-dash__tabs a.is-active { color: var(--pm-ink); border-bottom-color: var(--pm-accent); }
.pm-badge { display: inline-block; min-width: 20px; padding: 1px 6px; margin-left: 4px; border-radius: 999px; background: var(--pm-accent); color: var(--pm-accent-ink); font-size: 0.75rem; text-align: center; }
.pm-form { display: grid; gap: 18px; }
.pm-form__row { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; border: 0; min-width: 0; }
.pm-form__row > label, .pm-form__row > legend { font-weight: 600; font-size: 0.9rem; padding: 0; }
.pm-form__cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.pm-form__cols--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pm-form input[type="text"], .pm-form input[type="email"], .pm-form input[type="tel"], .pm-form input[type="password"], .pm-form select, .pm-form textarea,
.pm-quote input {
	width: 100%;
	min-height: 46px;
	padding: 10px 12px;
	font: inherit;
	color: var(--pm-ink);
	background: #fff;
	border: 1px solid var(--pm-line);
	border-radius: var(--pm-radius);
}
.pm-form :focus-visible, .pm-quote :focus-visible, .pm-dash a:focus-visible { outline: 3px solid var(--pm-accent); outline-offset: 2px; }
.pm-form [hidden] { display: none !important; }
.pm-opt, .pm-hint { color: var(--pm-muted); font-weight: 400; }
.pm-hint { margin: 0; font-size: 0.875rem; }
.pm-err { margin: 0; color: var(--pm-danger); font-size: 0.875rem; }
.pm-check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; cursor: pointer; }
.pm-check--all { font-weight: 600; margin-bottom: 6px; }
.pm-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px 12px; max-height: 280px; overflow: auto; padding: 12px; border: 1px solid var(--pm-line); border-radius: var(--pm-radius); background: var(--pm-wash); }
.pm-checks.is-disabled { opacity: 0.45; }
.pm-checks__group { grid-column: 1 / -1; margin: 8px 0 0; font-size: 0.8rem; font-weight: 700; color: var(--pm-muted); }
.pm-checks__group:first-child { margin-top: 0; }
.pm-type { flex-direction: row; flex-wrap: wrap; gap: 8px; }
.pm-type legend { width: 100%; margin-bottom: 6px; }
.pm-type .pmf__chip span { border-color: var(--pm-line); opacity: 1; }
.pm-photos { display: flex; flex-wrap: wrap; gap: 10px; }
.pm-photo { display: flex; flex-direction: column; gap: 4px; font-size: 0.8rem; font-weight: 400; }
.pm-photo img { width: 96px; height: 96px; object-fit: cover; border-radius: var(--pm-radius); }
.pm-notice { padding: 14px 16px; margin: 0 0 16px; border-radius: var(--pm-radius); background: var(--pm-wash); border-left: 4px solid var(--pm-muted); }
.pm-notice p { margin: 0 0 10px; }
.pm-notice--ok { border-left-color: var(--pm-ok); background: #ecfdf3; }
.pm-notice--error { border-left-color: var(--pm-danger); background: #fef3f2; }
.pm-empty { padding: 28px; text-align: center; border: 1px dashed var(--pm-line); border-radius: var(--pm-radius); }
.pm-empty p { margin: 0 0 10px; }
.pm-link { background: none; border: 0; padding: 0; font: inherit; color: var(--pm-muted); text-decoration: underline; cursor: pointer; }
.pm-link--danger { color: var(--pm-danger); }

.pm-leads { display: grid; gap: 14px; }
.pm-lead { padding: 18px; border: 1px solid var(--pm-line); border-radius: 8px; background: #fff; }
.pm-lead--pending { border-left: 4px solid var(--pm-accent); }
.pm-lead--declined { opacity: 0.6; }
.pm-lead__head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.pm-lead__part { margin: 0; font-size: 1.15rem; }
.pm-lead__when { color: var(--pm-muted); font-size: 0.85rem; white-space: nowrap; }
.pm-lead__vehicle { margin: 2px 0 10px; font-weight: 600; }
.pm-lead__facts { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 0 0 10px; font-size: 0.9rem; }
.pm-lead__facts dt { display: inline; color: var(--pm-muted); }
.pm-lead__facts dt::after { content: ": "; }
.pm-lead__facts dd { display: inline; margin: 0; }
.pm-lead__notes { margin: 0 0 12px; padding: 10px 12px; background: var(--pm-wash); border-radius: var(--pm-radius); font-size: 0.95rem; }
.pm-quote__row { display: grid; grid-template-columns: 160px 1fr; gap: 10px; }
.pm-quote label { display: flex; flex-direction: column; gap: 4px; font-size: 0.85rem; font-weight: 600; }
.pm-quote__actions { margin-top: 10px; }
.pm-decline { margin-top: 8px; }
.pm-lead .pm-hint { margin-top: 6px; }
.pm-lead__quoted p { margin: 0 0 8px; }

.pm-table-wrap { overflow-x: auto; }
.pm-table { width: 100%; border-collapse: collapse; }
.pm-table th, .pm-table td { padding: 10px; text-align: left; border-bottom: 1px solid var(--pm-line); vertical-align: middle; }
.pm-table th { font-size: 0.85rem; color: var(--pm-muted); }
.pm-table__item { display: flex; gap: 10px; align-items: center; }
.pm-table__item img { width: 48px; height: 48px; object-fit: cover; border-radius: 4px; }
.pm-table__actions { display: flex; gap: 14px; align-items: center; white-space: nowrap; }
.pm-table__actions form { margin: 0; }
.pm-status { font-size: 0.8rem; padding: 2px 8px; border-radius: 999px; background: var(--pm-wash); white-space: nowrap; }
.pm-status--publish { background: #ecfdf3; color: var(--pm-ok); }
.pm-status--pending { background: #fffaeb; color: #93370d; }
.pm-pager { display: flex; gap: 16px; justify-content: center; align-items: center; margin-top: 18px; }
.pm-dash--login form p { display: flex; flex-direction: column; gap: 4px; }
.pm-dash--login input[type="text"], .pm-dash--login input[type="password"] { min-height: 46px; padding: 10px 12px; border: 1px solid var(--pm-line); border-radius: var(--pm-radius); font: inherit; }
.pm-dash--login .login-remember label { flex-direction: row; }
.pm-dash--login input[type="submit"] { min-height: 48px; padding: 0 24px; background: var(--pm-accent); color: var(--pm-accent-ink); border: 0; border-radius: var(--pm-radius); font: inherit; font-weight: 700; cursor: pointer; }

@media (max-width: 640px) {
	.pm-form__cols, .pm-form__cols--3 { grid-template-columns: 1fr; }
	.pm-quote__row { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
	.pmf *, .pm-dash * { transition: none !important; animation: none !important; }
}
.pm-type .pmf__chip input:focus-visible + span { outline: 3px solid var(--pm-accent); outline-offset: 2px; }

.pmf--dark select:focus-visible, .pmf--dark input:focus-visible, .pmf--dark textarea:focus-visible, .pmf--dark button:focus-visible, .pmf--dark .pmf__chip input:focus-visible + span { outline-color: #ffffff; }
