/**
 * EdiusFA Core — Footer Builder front styles (v1.24.0).
 *
 * Digikala-faithful layout on the EdiusFA design tokens: flush top edge
 * (no gap above the footer), contact top-bar, service tiles, link
 * columns + socials/newsletter side, bordered app-download box, about
 * block + elevated trust-badge cards, copyright line, bordered brand
 * grid. Fully responsive (desktop → tablet → mobile) and RTL-native.
 */

/* ---------- shell ---------- */
/* Double-class selector outranks the theme's `.site-footer` (dark
 * reference) rules — the builder footer is the light Digikala layout.
 * v1.24.0: margin-top is ZERO so the footer sits flush against the last
 * content section (the theme's 80px margin and the builder's old 48px
 * gap both die here). */
.site-footer.efo-footer {
	background: var(--surface);
	color: var(--text);
	border-top: 1px solid var(--border);
	margin-top: 0;
	padding-top: 0;
	font-size: var(--fs-sm, 14px);
}
.efo-footer .container { padding-inline: 24px; }

/* ---------- top bar (row 1) ---------- */
.efo-top { border-bottom: 1px solid var(--border); }
.efo-top-in {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding-block: 14px;
}
.efo-backtop {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	border: 1px solid var(--border-strong);
	background: var(--surface);
	color: var(--text-muted);
	border-radius: 999px;
	padding: 8px 16px;
	font: inherit;
	font-size: var(--fs-xs, 12.5px);
	cursor: pointer;
	transition: color .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.efo-backtop .icon { width: 15px; height: 15px; }
.efo-backtop:hover {
	color: var(--primary);
	border-color: var(--primary);
	box-shadow: 0 2px 10px rgba(0, 0, 0, .05);
}
.efo-meta {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px 0;
	color: var(--text-subtle);
	font-size: var(--fs-xs, 12.5px);
}
.efo-meta-item {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	color: var(--text-subtle);
	text-decoration: none;
	transition: color .15s ease;
}
a.efo-meta-item:hover { color: var(--primary); }
.efo-meta-item .icon-sm { width: 15px; height: 15px; }
.efo-meta-item bdi { letter-spacing: .01em; }
.efo-sep {
	width: 1px;
	height: 14px;
	background: var(--border-strong);
	margin-inline: 16px;
}

/* ---------- services strip (row 2) — icon tiles ---------- */
.efo-services {
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	gap: 10px;
	padding-block: 24px;
	border-bottom: 1px solid var(--border);
}
.efo-srv {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 10px;
	text-align: center;
	color: var(--text-muted);
	text-decoration: none;
	padding: 4px 8px;
}
.efo-srv-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 54px;
	height: 54px;
	border-radius: 16px;
	background: var(--surface-muted);
	color: var(--text-muted);
	transition: background .2s ease, color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.efo-srv-icon .icon { width: 28px; height: 28px; }
.efo-srv-label {
	font-size: var(--fs-xs, 12.5px);
	line-height: 1.7;
	color: var(--text-muted);
	transition: color .15s ease;
}
a.efo-srv { border-radius: 14px; }
a.efo-srv:hover .efo-srv-icon {
	background: var(--primary-soft);
	color: var(--primary);
	transform: translateY(-2px);
	box-shadow: 0 8px 18px rgba(0, 0, 0, .06);
}
a.efo-srv:hover .efo-srv-label { color: var(--primary-ink); }

/* ---------- main row: columns + side (row 3) ---------- */
.efo-main {
	display: grid;
	grid-template-columns: 1fr minmax(250px, 300px);
	gap: 30px 56px;
	padding-block: 28px;
	border-bottom: 1px solid var(--border);
}
.efo-cols {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 24px;
}
.efo-col h4 {
	margin: 0 0 14px;
	font-size: var(--fs-sm, 14px);
	font-weight: 700;
	color: var(--text);
}
.efo-col ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 11px;
}
.efo-col a {
	position: relative;
	display: inline-block;
	color: var(--text-subtle);
	font-size: var(--fs-xs, 12.5px);
	text-decoration: none;
	transition: color .15s ease, transform .15s ease;
}
.efo-col a:hover {
	color: var(--primary);
	transform: translateX(-2px); /* RTL: gently pulls toward the link start */
}
[dir="ltr"] .efo-col a:hover { transform: translateX(2px); }

/* side: socials + newsletter */
.efo-side-title {
	margin: 0 0 14px;
	font-size: var(--fs-sm, 14px);
	font-weight: 700;
	color: var(--text);
}
.efo-social {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 18px;
}
.efo-soc {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: var(--surface-muted);
	color: var(--text-muted);
	transition: background .15s ease, color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.efo-soc .icon { width: 19px; height: 19px; }
.efo-soc:hover {
	background: var(--primary-soft);
	color: var(--primary);
	transform: translateY(-2px);
	box-shadow: 0 6px 14px rgba(0, 0, 0, .07);
}
.efo-news-desc {
	margin: 0 0 12px;
	font-size: var(--fs-xs, 12.5px);
	color: var(--text-muted);
	line-height: 1.8;
}
.efo-news { display: flex; gap: 8px; }
.efo-news input[type="email"] {
	flex: 1;
	min-width: 0;
	border: 1px solid var(--border-strong);
	border-radius: 10px;
	padding: 10px 14px;
	font: inherit;
	font-size: var(--fs-xs, 12.5px);
	background: var(--surface);
	color: var(--text);
	transition: border-color .15s ease, box-shadow .15s ease;
}
.efo-news input[type="email"]:focus {
	outline: none;
	border-color: var(--primary);
	box-shadow: var(--focus-ring);
}
.efo-news button {
	border: 0;
	border-radius: 10px;
	background: var(--primary);
	color: var(--text-inverse);
	font: inherit;
	font-size: var(--fs-xs, 12.5px);
	font-weight: 600;
	padding: 10px 20px;
	cursor: pointer;
	transition: background .15s ease, transform .15s ease, box-shadow .15s ease;
}
.efo-news button:hover {
	background: var(--primary-hover, var(--primary));
	transform: translateY(-1px);
	box-shadow: 0 6px 14px rgba(0, 0, 0, .10);
}
.efo-news-note {
	margin: 10px 0 0;
	font-size: var(--fs-2xs, 11px);
	color: var(--text-subtle);
}

/* ---------- app download (row 4) — bordered light box, Digikala style.
 * Rendered only when the store buttons actually exist (see PHP). */
.efo-appwrap { padding-block: 20px; }
.efo-appbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 14px 24px;
	background: var(--surface-muted);
	border: 1px solid var(--border);
	border-radius: 16px;
	padding: 18px 24px;
}
.efo-app-title {
	color: var(--text);
	font-weight: 700;
	font-size: var(--fs-sm, 14px);
	display: flex;
	flex-direction: column;
	gap: 3px;
}
.efo-app-title small { font-weight: 400; color: var(--text-muted); font-size: var(--fs-2xs, 11px); }
.efo-app-btns {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
}
.efo-app-btn { display: inline-flex; }
.efo-app-img { height: 44px; width: auto; border-radius: 9px; transition: transform .15s ease; }
a.efo-app-btn:hover .efo-app-img { transform: translateY(-2px); }
.efo-app-chip {
	display: inline-flex;
	align-items: center;
	border: 1px solid var(--border-strong);
	color: var(--text-muted);
	border-radius: 10px;
	padding: 10px 18px;
	font-size: var(--fs-xs, 12.5px);
	text-decoration: none;
	background: var(--surface);
	transition: border-color .15s ease, color .15s ease;
}
a.efo-app-btn:hover .efo-app-chip { border-color: var(--primary); color: var(--primary); }

/* ---------- about + badges (row 5) ---------- */
.efo-bottom {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 28px 48px;
	align-items: start;
	padding-block: 26px;
	border-bottom: 1px solid var(--border);
}
.efo-about h3 {
	margin: 0 0 10px;
	font-size: var(--fs-sm, 14px);
	font-weight: 700;
	color: var(--text);
}
.efo-about-text {
	color: var(--text-muted);
	font-size: var(--fs-xs, 12.5px);
	line-height: 2;
	position: relative;
	max-height: 3.9em;
	overflow: hidden;
	transition: max-height .25s ease;
}
.efo-about-text.is-open { max-height: 40em; }
.efo-more {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	margin-top: 8px;
	border: 0;
	background: none;
	color: var(--primary-ink);
	font: inherit;
	font-size: var(--fs-xs, 12.5px);
	font-weight: 600;
	cursor: pointer;
	padding: 0;
}
.efo-more .icon-sm { width: 14px; height: 14px; transition: transform .2s ease; }
.efo-more.is-open .icon-sm { transform: rotate(180deg); }

/* Trust badges — elevated cards: the trust strip is the visual anchor. */
.efo-badges {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	justify-content: flex-start;
	align-items: stretch;
}
.efo-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 96px;
	min-height: 96px;
	max-width: 160px;
	padding: 12px;
	border: 1px solid var(--border);
	border-radius: 14px;
	background: var(--surface);
	box-shadow: 0 2px 10px rgba(0, 0, 0, .04);
	transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.efo-badge:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 20px rgba(0, 0, 0, .08);
	border-color: var(--border-strong);
}
.efo-badge a { display: inline-flex; align-items: center; justify-content: center; }
.efo-badge-img,
.efo-badge img,
.efo-badge iframe { max-width: 100%; max-height: 70px; width: auto; height: auto; display: block; border-radius: 6px; }
.efo-badge iframe { max-height: 92px; }
/* Graceful placeholder when a badge row has a label but no image/code —
 * never a blank or broken box. */
.efo-badge-ph {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	color: var(--text-muted);
	text-align: center;
}
.efo-badge-ph .icon { width: 26px; height: 26px; color: var(--primary); opacity: .8; }
.efo-badge-ph span { font-size: var(--fs-2xs, 11px); line-height: 1.7; }

/* ---------- copyright (row 6) ---------- */
.efo-legal {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 6px 24px;
	padding-block: 16px;
	color: var(--text-subtle);
	font-size: var(--fs-2xs, 11px);
}
.efo-legal-note { opacity: .85; }

/* ---------- brand grid (row 7) ---------- */
.efo-brands { background: var(--surface-muted); padding-block: 0; }
.efo-brands-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
}
.efo-brand {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 64px;
	padding: 10px 14px;
	margin: -1px 0 0 -1px;
	border: 1px solid var(--border);
	background: var(--surface);
	text-decoration: none;
	overflow: hidden;
	transition: background .15s ease;
}
a.efo-brand:hover { background: var(--primary-soft); }
.efo-brand-img,
.efo-brand img { max-height: 40px; max-width: 70%; width: auto; height: auto; object-fit: contain; }
.efo-brand-label {
	color: var(--text-muted);
	font-size: var(--fs-sm, 14px);
	font-weight: 700;
	letter-spacing: .01em;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
a.efo-brand:hover .efo-brand-label { color: var(--primary); }

/* ---------- responsive ---------- */
@media (max-width: 1024px) {
	.efo-main { grid-template-columns: 1fr; }
	.efo-cols { grid-template-columns: repeat(4, 1fr); }
	.efo-services { grid-template-columns: repeat(3, 1fr); }
	.efo-services .efo-srv:nth-child(n+4):nth-child(-n+5) { display: none; }
}
@media (max-width: 760px) {
	.efo-footer .container { padding-inline: 16px; }
	.efo-top-in { flex-direction: column-reverse; align-items: stretch; text-align: center; }
	.efo-backtop { align-self: center; }
	.efo-meta { justify-content: center; }
	.efo-sep { margin-inline: 10px; }
	.efo-services { grid-template-columns: repeat(2, 1fr); gap: 16px 8px; padding-block: 20px; }
	.efo-services .efo-srv:nth-child(n+4):nth-child(-n+5) { display: flex; }
	.efo-srv-icon { width: 48px; height: 48px; border-radius: 14px; }
	.efo-srv-icon .icon { width: 24px; height: 24px; }
	.efo-cols { grid-template-columns: repeat(2, 1fr); gap: 20px 16px; }
	.efo-main { gap: 26px; }
	.efo-bottom { grid-template-columns: 1fr; }
	.efo-badges { order: -1; justify-content: center; }
	.efo-appbar { flex-direction: column; text-align: center; justify-content: center; }
	.efo-app-btns { justify-content: center; }
	.efo-brands-grid { grid-template-columns: repeat(2, 1fr); }
	.efo-legal { justify-content: center; text-align: center; }
}
@media (max-width: 400px) {
	.efo-services { grid-template-columns: repeat(2, 1fr); }
	.efo-news { flex-wrap: wrap; }
	.efo-news button { flex: 1; }
}
