/* ==========================================================================
   CarParts — Custom Footer (RTL, dark premium)
   Scoped under .cpf so it can't leak into the rest of the Xtra theme.
   ========================================================================== */

/* Hide the theme's default footer only when ours is rendered. */
.carparts-has-footer #site_footer { display: none !important; }

.cpf {
	--cpf-bg:        #0d0d0d;   /* near-black, matches site dark sections */
	--cpf-bg-2:      #000000;   /* deeper band */
	--cpf-surface:   #1a1a1a;   /* cards / inputs */
	--cpf-fg:        #e6e6e6;   /* primary text */
	--cpf-muted:     #9a9a9a;   /* secondary text */
	--cpf-heading:   #ffffff;
	--cpf-accent:    #e02617;   /* site CTA red */
	--cpf-accent-2:  #f5331f;   /* hover */
	--cpf-border:    rgba(255,255,255,.07);

	direction: rtl;
	background: var(--cpf-bg);
	color: var(--cpf-fg);
	font-family: inherit;
	font-size: 15px;
	line-height: 1.7;
	position: relative;
}

/* top accent hairline */
.cpf::before {
	content: "";
	display: block;
	height: 3px;
	background: linear-gradient(90deg, transparent 0%, var(--cpf-accent) 50%, transparent 100%);
}

.cpf *,
.cpf *::before,
.cpf *::after { box-sizing: border-box; }

.cpf__inner {
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 24px;
}

.cpf__sr-only {
	position: absolute;
	width: 1px; height: 1px;
	padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0 0 0 0);
	white-space: nowrap; border: 0;
}

/* --------------------------------------------------------------- Newsletter */
.cpf__news {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 20px 40px;
	padding: 36px 0;
	border-bottom: 1px solid var(--cpf-border);
}
.cpf__news-title {
	margin: 0 0 6px;
	font-size: 22px;
	font-weight: 700;
	color: var(--cpf-heading);
}
.cpf__news-sub {
	margin: 0;
	color: var(--cpf-muted);
	font-size: 14px;
	max-width: 46ch;
}
.cpf__news-form {
	position: relative;
	display: flex;
	align-items: stretch;
	gap: 10px;
	flex: 1 1 360px;
	max-width: 460px;
}
.cpf__news-input {
	flex: 1 1 auto;
	min-width: 0;
	height: 50px;
	padding: 0 18px;
	border: 1px solid var(--cpf-border);
	border-radius: 12px;
	background: var(--cpf-surface);
	color: var(--cpf-fg);
	font: inherit;
	transition: border-color .2s ease, box-shadow .2s ease;
}
.cpf__news-input::placeholder { color: var(--cpf-muted); }
.cpf__news-input:focus-visible {
	outline: none;
	border-color: var(--cpf-accent);
	box-shadow: 0 0 0 3px rgba(224,38,23,.35);
}
.cpf__news-btn {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: 50px;
	padding: 0 22px;
	border: 0;
	border-radius: 12px;
	background: var(--cpf-accent);
	color: #fff;
	font: inherit;
	font-weight: 700;
	cursor: pointer;
	transition: background .2s ease, transform .15s ease;
}
.cpf__news-btn:hover { background: var(--cpf-accent-2); }
.cpf__news-btn:active { transform: scale(.97); }
.cpf__news-btn:focus-visible {
	outline: none;
	box-shadow: 0 0 0 3px rgba(224,38,23,.45);
}
/* arrow points left for RTL "next" */
.cpf__news-btn .cpf__icon { transform: scaleX(1); }
.cpf__news-msg {
	position: absolute;
	bottom: -24px; right: 4px;
	margin: 0;
	font-size: 13px;
	color: #4ade80;
}
.cpf__news-msg[hidden] { display: none; }
.cpf__news-msg.is-error { color: #fca5a5; }

/* -------------------------------------------------------------------- Grid */
.cpf__grid {
	display: grid;
	grid-template-columns: 1.6fr 1fr 1fr 1fr 1.3fr;
	gap: 32px;
	padding: 48px 0;
}
.cpf__col { min-width: 0; }

.cpf__heading {
	margin: 0 0 18px;
	font-size: 16px;
	font-weight: 700;
	color: var(--cpf-heading);
	position: relative;
	padding-bottom: 12px;
}
.cpf__heading::after {
	content: "";
	position: absolute;
	bottom: 0; right: 0;
	width: 32px; height: 2px;
	background: var(--cpf-accent);
	border-radius: 2px;
}

/* Brand */
.cpf__logo {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	text-decoration: none;
	color: var(--cpf-heading);
	margin-bottom: 16px;
}
.cpf__logo-mark { color: var(--cpf-accent); flex: 0 0 auto; }
.cpf__logo-text { font-size: 22px; font-weight: 800; }
.cpf__about {
	margin: 0 0 20px;
	color: var(--cpf-muted);
	font-size: 14px;
	max-width: 40ch;
}

/* Social */
.cpf__social {
	list-style: none;
	display: flex;
	gap: 10px;
	margin: 0; padding: 0;
}
.cpf__social a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px; height: 44px;
	border-radius: 12px;
	background: var(--cpf-surface);
	color: var(--cpf-fg);
	border: 1px solid var(--cpf-border);
	transition: background .2s ease, color .2s ease, transform .15s ease;
}
.cpf__social a:hover {
	background: var(--cpf-accent);
	color: #fff;
	transform: translateY(-2px);
}
.cpf__social a:focus-visible {
	outline: none;
	box-shadow: 0 0 0 3px rgba(224,38,23,.45);
}

/* Link lists */
.cpf__links {
	list-style: none;
	margin: 0; padding: 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
}
.cpf__links a {
	display: inline-block;
	padding: 7px 0;
	color: var(--cpf-muted);
	text-decoration: none;
	font-size: 14.5px;
	transition: color .2s ease, padding-inline-start .2s ease;
}
.cpf__links a:hover {
	color: #fff;
	padding-inline-start: 6px;
}
.cpf__links a:focus-visible {
	outline: none;
	color: #fff;
	text-decoration: underline;
	text-underline-offset: 4px;
}

/* Contact */
.cpf__contact-list {
	list-style: none;
	margin: 0; padding: 0;
	display: flex;
	flex-direction: column;
	gap: 16px;
}
.cpf__contact-list li {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	color: var(--cpf-muted);
	font-size: 14px;
}
.cpf__contact-list .cpf__icon {
	flex: 0 0 auto;
	margin-top: 3px;
	color: var(--cpf-accent);
}
.cpf__contact-list a {
	color: var(--cpf-fg);
	text-decoration: none;
	transition: color .2s ease;
}
.cpf__contact-list a:hover { color: var(--cpf-accent-2); }
.cpf__contact-list a:focus-visible {
	outline: none;
	text-decoration: underline;
	text-underline-offset: 4px;
}

/* ----------------------------------------------------------------- Badges */
.cpf__badges {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	padding: 26px 0;
	border-top: 1px solid var(--cpf-border);
	border-bottom: 1px solid var(--cpf-border);
}
.cpf__badge {
	display: inline-flex;
	align-items: center;
	padding: 10px 16px;
	border-radius: 10px;
	background: var(--cpf-surface);
	border: 1px solid var(--cpf-border);
	color: var(--cpf-fg);
	font-size: 13px;
	font-weight: 600;
}

/* Trust seals (Aqaye Pardakht + Enamad) — white cards so the logos stay legible on black */
.cpf__trust {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 14px;
	padding: 26px 0;
	border-top: 1px solid var(--cpf-border);
	border-bottom: 1px solid var(--cpf-border);
}
.cpf__seal {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 10px;
	line-height: 0;
	transition: transform .15s ease;
}
.cpf__seal:hover { transform: translateY(-2px); }
.cpf__seal:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(224,38,23,.45); border-radius: 10px; }
.cpf__seal img {
	display: block;
	height: 90px;
	width: auto;
	max-width: 160px;
	object-fit: contain;
}

/* ------------------------------------------------------------- Bottom bar */
.cpf__bottom {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 22px 0 30px;
	color: var(--cpf-muted);
	font-size: 13px;
}
.cpf__copy, .cpf__made { margin: 0; }
.cpf__made { display: inline-flex; align-items: center; gap: 6px; }
.cpf__heart { color: var(--cpf-accent); vertical-align: middle; }

/* ============================================================= Responsive */
@media (max-width: 1024px) {
	.cpf__grid { grid-template-columns: 1fr 1fr; gap: 32px; }
	/* Brand spans full width: present it as one deliberately-centered intro
	   block (logo + tagline + social), divided from the link grid below so the
	   centering reads as intentional structure rather than mixed alignment. */
	.cpf__brand {
		grid-column: 1 / -1;
		text-align: center;
		padding-bottom: 32px;
		margin-bottom: 4px;
		border-bottom: 1px solid var(--cpf-border);
	}
	/* Center the brand NAME on screen; the gear icon hangs off its right edge
	   (taken out of flow) so it adds on without pulling the name off-center. */
	.cpf__brand .cpf__logo { position: relative; margin-bottom: 14px; }
	.cpf__brand .cpf__logo-mark {
		position: absolute;
		left: 100%;
		margin-left: 10px;
		top: 50%;
		transform: translateY(-50%);
	}
	.cpf__brand .cpf__about { max-width: 44ch; margin: 0 auto 22px; text-align: center; }
	.cpf__brand .cpf__social { justify-content: center; }
}

@media (max-width: 768px) {
	.cpf__inner { padding: 0 18px; }
	.cpf__news { flex-direction: column; align-items: flex-start; }
	.cpf__news-form { width: 100%; max-width: none; flex-basis: auto; }
}

@media (max-width: 560px) {
	/* Two columns on phones so links sit side-by-side instead of one tall
	   sparse column. Brand + contact span the full width. */
	.cpf__grid { grid-template-columns: 1fr 1fr; gap: 28px 24px; padding: 36px 0; }
	.cpf__brand,
	.cpf__contact { grid-column: 1 / -1; }
	.cpf__news-form { flex-direction: column; }
	.cpf__news-btn { justify-content: center; }
	.cpf__news-msg { position: static; margin-top: 8px; }
	.cpf__bottom { flex-direction: column; align-items: flex-start; }
	.cpf__badge { font-size: 12px; padding: 9px 13px; }
}

/* ----------------------------------------------------- Reduced motion */
@media (prefers-reduced-motion: reduce) {
	.cpf * { transition: none !important; }
	.cpf__social a:hover,
	.cpf__news-btn:active { transform: none; }
}
