/**
 * AutoMag Pro — Portal homepage & header (automotive marketplace UX)
 * Original design — dark charcoal + crimson accent (not a clone of any site).
 */

/* ── Portal body ── */
.home-page--portal,
body.automag-pro.home {
	--portal-bg: #121214;
	--portal-surface: #1a1a1d;
	--portal-elevated: #222226;
	--portal-border: rgba(255, 255, 255, 0.08);
	--portal-text: #f0f0f2;
	--portal-muted: #9a9aa0;
	--portal-accent: #e11d48;
	--portal-accent-hover: #fb7185;
	--portal-price: #fb923c;
	--portal-link: #7dd3fc;
}

.home-page--portal {
	background: var(--portal-bg);
	color: var(--portal-text);
	padding-bottom: 4rem;
}

/* ── Header ── */
.portal-header {
	background: #0c0c0e;
	border-bottom: 1px solid var(--portal-border, rgba(255,255,255,0.08));
	position: sticky;
	top: 0;
	z-index: 1000;
}

.portal-header__top {
	padding: 0.75rem 0;
}

.portal-header__top-inner {
	display: flex;
	align-items: center;
	gap: 1rem;
	flex-wrap: wrap;
}

.portal-header .site-title {
	font-size: 1.5rem;
	font-weight: 700;
	color: #fff;
	text-decoration: none;
	white-space: nowrap;
}

.portal-header .site-title__pro {
	color: var(--portal-accent, #e11d48);
}

.portal-header__search {
	flex: 1;
	min-width: 200px;
	position: relative;
	display: flex;
	background: #fff;
	border-radius: 6px;
	overflow: hidden;
}

.portal-header__search-input {
	flex: 1;
	border: 0;
	padding: 0.7rem 1rem;
	font-size: 0.9rem;
	outline: none;
	color: #1d1d1f;
}

.portal-header__search-btn {
	border: 0;
	background: #f3f3f5;
	padding: 0 1rem;
	cursor: pointer;
	color: #555;
}

.portal-header__actions {
	display: flex;
	align-items: center;
	gap: 0.75rem;
}

.portal-header__post {
	background: var(--portal-accent, #e11d48) !important;
	color: #fff !important;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	padding: 0.55rem 0.9rem !important;
	border-radius: 4px !important;
	text-decoration: none;
	white-space: nowrap;
}

.portal-header__account,
.portal-header__compare {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	color: #fff;
	text-decoration: none;
	font-size: 0.8rem;
	font-weight: 500;
}

.portal-header__compare .compare-count {
	background: var(--portal-accent, #e11d48);
	color: #fff;
	border-radius: 999px;
	min-width: 1.25rem;
	height: 1.25rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 0.7rem;
	font-weight: 700;
}

.portal-nav {
	background: #1a1a1d;
	border-top: 1px solid rgba(255,255,255,0.05);
}

.portal-nav__inner {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	min-height: 42px;
	flex-wrap: wrap;
}

.portal-nav__home {
	color: #fff;
	display: flex;
	padding: 0.4rem;
}

.portal-nav__list {
	display: flex;
	list-style: none;
	margin: 0;
	padding: 0;
	gap: 0.15rem;
	flex-wrap: wrap;
	flex: 1;
}

.portal-nav__list a {
	color: #e8e8ea;
	text-decoration: none;
	font-size: 0.78rem;
	font-weight: 600;
	letter-spacing: 0.03em;
	padding: 0.55rem 0.65rem;
	display: block;
	transition: color 0.15s;
}

.portal-nav__list a:hover,
.portal-nav__promo {
	color: var(--portal-accent, #e11d48) !important;
}

.portal-nav__badges {
	display: flex;
	gap: 0.4rem;
}

.portal-badge {
	font-size: 0.7rem;
	font-weight: 700;
	padding: 0.35rem 0.7rem;
	border-radius: 999px;
	text-decoration: none;
	color: #fff;
}

.portal-badge--guide { background: var(--portal-accent, #e11d48); }
.portal-badge--mobile { background: #16a34a; }

/* ── Offers strip ── */
.portal-offers-strip {
	background: #0e0e10;
	border-bottom: 1px solid var(--portal-border);
	padding: 0.75rem 0;
}

.portal-offers-strip__inner {
	display: flex;
	align-items: center;
	gap: 1rem;
	overflow: hidden;
}

.portal-offers-strip__badge {
	flex-shrink: 0;
	background: var(--portal-accent, #e11d48);
	color: #fff;
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	padding: 0.45rem 0.75rem;
	border-radius: 4px;
}

.portal-offers-strip__track {
	display: flex;
	gap: 1.25rem;
	overflow-x: auto;
	scrollbar-width: none;
	padding: 0.25rem 0;
}

.portal-offers-strip__track::-webkit-scrollbar { display: none; }

.portal-offer-chip {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.35rem;
	text-decoration: none;
	color: #fff;
	min-width: 72px;
}

.portal-offer-chip__logo {
	width: 52px;
	height: 52px;
	border-radius: 50%;
	background: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

.portal-offer-chip__logo img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.portal-offer-chip__initial {
	font-weight: 700;
	color: #111;
}

.portal-offer-chip__label {
	font-size: 0.7rem;
	text-align: center;
	max-width: 80px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* ── Find + Hero ── */
.portal-find-hero {
	padding: 1.5rem 0 2rem;
}

.portal-find-hero__grid {
	display: grid;
	grid-template-columns: minmax(260px, 320px) 1fr;
	gap: 1.25rem;
	align-items: stretch;
}

@media (max-width: 900px) {
	.portal-find-hero__grid { grid-template-columns: 1fr; }
}

.portal-finder {
	background: var(--portal-surface);
	border-radius: 10px;
	padding: 1.25rem;
	border: 1px solid var(--portal-border);
}

.portal-finder__icons {
	display: flex;
	justify-content: center;
	gap: 1rem;
	margin-bottom: 0.75rem;
}

.portal-finder__icon {
	background: transparent;
	border: 0;
	color: var(--portal-muted);
	cursor: pointer;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.25rem;
	font-size: 0.7rem;
	font-weight: 600;
}

.portal-finder__icon.is-active { color: var(--portal-accent, #e11d48); }

.portal-finder__title {
	text-align: center;
	font-size: 1.15rem;
	margin: 0 0 1rem;
	color: #fff;
}

.portal-finder__tabs {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0;
	margin-bottom: 1rem;
	border-radius: 6px;
	overflow: hidden;
}

.portal-finder__tab {
	border: 0;
	padding: 0.65rem;
	font-weight: 700;
	font-size: 0.8rem;
	cursor: pointer;
	background: #fff;
	color: #222;
}

.portal-finder__tab.is-active {
	background: #1e3a5f;
	color: #fff;
}

.portal-finder__select {
	width: 100%;
	margin-bottom: 0.65rem;
	padding: 0.7rem 0.75rem;
	border-radius: 4px;
	border: 1px solid #ccc;
	background: #fff;
	font-size: 0.85rem;
	color: #333;
}

.portal-finder__submit {
	width: 100%;
	margin-top: 0.35rem;
	background: var(--portal-accent, #e11d48) !important;
	border: 0 !important;
	font-weight: 700;
	letter-spacing: 0.03em;
	padding: 0.85rem !important;
}

.portal-hero {
	position: relative;
	border-radius: 10px;
	overflow: hidden;
	background: var(--portal-elevated);
	min-height: 360px;
}

.portal-hero__slide {
	display: none;
	position: relative;
	min-height: 360px;
}

.portal-hero__slide.is-active { display: block; }

.portal-hero__img {
	width: 100%;
	height: 360px;
	object-fit: cover;
	display: block;
}

.portal-hero__content {
	position: absolute;
	inset: auto 0 0 0;
	padding: 1.5rem;
	background: linear-gradient(transparent, rgba(0,0,0,0.85));
	color: #fff;
}

.portal-hero__eyebrow {
	color: var(--portal-accent, #e11d48);
	font-size: 0.75rem;
	font-weight: 700;
	text-transform: uppercase;
	margin: 0 0 0.35rem;
}

.portal-hero__title {
	margin: 0 0 0.35rem;
	font-size: 1.5rem;
}

.portal-hero__price {
	color: var(--portal-price, #fb923c);
	font-weight: 700;
	margin: 0 0 0.75rem;
}

.portal-hero__dots {
	position: absolute;
	bottom: 0.75rem;
	right: 1rem;
	display: flex;
	gap: 0.35rem;
	z-index: 2;
}

.portal-hero__dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	border: 0;
	background: rgba(255,255,255,0.4);
	cursor: pointer;
	padding: 0;
}

.portal-hero__dot.is-active { background: var(--portal-accent, #e11d48); }

/* ── Sections ── */
.portal-section {
	padding: 2rem 0;
}

.portal-section__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	flex-wrap: wrap;
	margin-bottom: 1.25rem;
}

.portal-section__title {
	font-size: 1.35rem;
	color: #fff;
	margin: 0;
	font-weight: 600;
}

.portal-section__title span {
	border-bottom: 3px solid var(--portal-accent, #e11d48);
	padding-bottom: 2px;
}

.portal-section__link {
	color: var(--portal-link, #7dd3fc);
	font-size: 0.85rem;
	text-decoration: none;
}

.portal-tabs {
	display: flex;
	gap: 0.5rem;
	margin-bottom: 1.25rem;
	border-bottom: 1px solid var(--portal-border);
	padding-bottom: 0.5rem;
}

.portal-tabs__btn {
	background: transparent;
	border: 0;
	color: var(--portal-muted);
	font-weight: 700;
	font-size: 0.85rem;
	letter-spacing: 0.04em;
	padding: 0.5rem 0.85rem;
	cursor: pointer;
	text-decoration: none;
}

.portal-tabs__btn.is-active,
.portal-tabs__btn:hover {
	color: #fff;
}

.portal-car-carousel {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 1rem;
}

.portal-car-card {
	text-decoration: none;
	color: inherit;
	display: block;
}

.portal-car-card__media {
	background: #fff;
	border-radius: 10px;
	overflow: hidden;
	aspect-ratio: 4/3;
	position: relative;
}

.portal-car-card__media img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	padding: 0.5rem;
}

.portal-car-card__fuel {
	position: absolute;
	top: 0.5rem;
	right: 0.5rem;
	background: rgba(0,0,0,0.7);
	color: #fff;
	font-size: 0.65rem;
	padding: 0.2rem 0.45rem;
	border-radius: 999px;
}

.portal-car-card__title {
	color: var(--portal-link, #7dd3fc);
	font-size: 0.9rem;
	margin: 0.6rem 0 0.2rem;
	font-weight: 600;
}

.portal-car-card__price {
	color: var(--portal-price, #fb923c);
	font-weight: 700;
	font-size: 0.9rem;
	margin: 0;
}

/* ── VS comparisons ── */
.portal-vs-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
	gap: 1rem;
}

.portal-vs-card {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	gap: 0.5rem;
	align-items: center;
	background: var(--portal-surface);
	border-radius: 12px;
	padding: 1rem;
	text-decoration: none;
	border: 1px solid var(--portal-border);
	transition: border-color 0.2s;
}

.portal-vs-card:hover { border-color: var(--portal-accent, #e11d48); }

.portal-vs-card__side {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 0.35rem;
}

.portal-vs-card__side img {
	width: 100%;
	max-width: 140px;
	aspect-ratio: 4/3;
	object-fit: contain;
	background: #fff;
	border-radius: 8px;
	padding: 0.35rem;
}

.portal-vs-card__name {
	color: var(--portal-link, #7dd3fc);
	font-size: 0.8rem;
	font-weight: 600;
}

.portal-vs-card__price {
	color: var(--portal-price, #fb923c);
	font-size: 0.8rem;
	font-weight: 700;
}

.portal-vs-card__vs {
	color: #fff;
	font-weight: 700;
	font-size: 0.85rem;
	opacity: 0.7;
}

/* ── Tools ── */
.portal-tools__grid {
	display: grid;
	grid-template-columns: repeat(6, 1fr);
	gap: 0.75rem;
}

@media (max-width: 900px) {
	.portal-tools__grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 500px) {
	.portal-tools__grid { grid-template-columns: repeat(2, 1fr); }
}

.portal-tool {
	background: var(--portal-surface);
	border: 1px solid var(--portal-border);
	border-radius: 10px;
	padding: 1.25rem 0.75rem;
	text-align: center;
	text-decoration: none;
	color: #fff;
	transition: background 0.2s, border-color 0.2s;
}

.portal-tool:hover {
	border-color: var(--portal-accent, #e11d48);
	background: var(--portal-elevated);
}

.portal-tool__icon {
	display: block;
	margin-bottom: 0.5rem;
	color: #fff;
}

.portal-tool__label {
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.04em;
}

/* ── Partners ── */
.portal-partners__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
	gap: 0.75rem;
}

.portal-partner {
	background: #fff;
	border-radius: 10px;
	aspect-ratio: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0.75rem;
	text-decoration: none;
	color: #222;
	font-weight: 600;
	font-size: 0.8rem;
}

.portal-partner img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
}

/* ── Opinions ── */
.portal-opinions__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 1rem;
}

.portal-opinion {
	background: var(--portal-surface);
	border-radius: 10px;
	overflow: hidden;
	border: 1px solid var(--portal-border);
	display: flex;
	flex-direction: column;
}

.portal-opinion__thumb img {
	width: 100%;
	aspect-ratio: 16/9;
	object-fit: cover;
	display: block;
}

.portal-opinion__body { padding: 1rem; }

.portal-opinion__rating {
	color: var(--portal-price, #fb923c);
	font-weight: 700;
	font-size: 0.85rem;
}

.portal-opinion__title {
	margin: 0.35rem 0;
	font-size: 0.95rem;
}

.portal-opinion__title a {
	color: #fff;
	text-decoration: none;
}

.portal-opinion__excerpt {
	color: var(--portal-muted);
	font-size: 0.85rem;
	margin: 0;
}

/* ── Tool pages ── */
.portal-tool-page {
	padding: 2rem 0 4rem;
}

.portal-tool-page__header h1 {
	font-size: 2rem;
	margin: 0 0 0.5rem;
}

.portal-cote__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 1rem;
	margin-bottom: 1.25rem;
}

.portal-cote__form label {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	font-weight: 600;
	font-size: 0.85rem;
}

.portal-cote__form input,
.portal-cote__form select,
.portal-post-ad input,
.portal-post-ad textarea {
	padding: 0.65rem 0.75rem;
	border: 1px solid var(--color-border);
	border-radius: 8px;
	font: inherit;
}

.portal-cote__result {
	margin-top: 1.5rem;
	padding: 1.5rem;
	background: var(--color-surface);
	border-radius: 12px;
	text-align: center;
}

.portal-cote__value {
	font-size: 2rem;
	font-weight: 700;
	color: var(--color-accent);
	margin: 0.5rem 0;
}

.portal-market-stats {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 1rem;
	margin: 2rem 0;
}

@media (max-width: 700px) {
	.portal-market-stats { grid-template-columns: 1fr 1fr; }
	.portal-header__post { display: none; }
}

.portal-stat {
	background: var(--color-surface);
	border-radius: 12px;
	padding: 1.25rem;
	text-align: center;
}

.portal-stat strong {
	display: block;
	font-size: 1.5rem;
	color: var(--color-accent);
}

.portal-forum-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.portal-forum-list li a {
	display: grid;
	grid-template-columns: 120px 1fr auto;
	gap: 1rem;
	padding: 0.85rem 0;
	border-bottom: 1px solid var(--color-border);
	text-decoration: none;
	color: inherit;
	align-items: center;
}

.portal-forum-list__type {
	font-size: 0.75rem;
	font-weight: 700;
	color: var(--color-accent);
	text-transform: uppercase;
}

.portal-post-ad {
	max-width: 560px;
	display: flex;
	flex-direction: column;
	gap: 0.85rem;
}

.portal-post-ad label {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	font-weight: 600;
}

/* ── Portal dark footer on homepage ── */
body.portal-dark .site-footer {
	background: #0c0c0e;
	color: #c8c8cc;
	border-top: 1px solid rgba(255,255,255,0.08);
}

body.portal-dark .site-footer a {
	color: #e8e8ea;
}

body.portal-dark .footer-site-name,
body.portal-dark .site-footer .widget-title {
	color: #fff;
}

/* Portal home: soften nested light sections */
.home-page--portal .home-section,
.home-page--portal .automag-section {
	color: var(--portal-text);
}

.home-page--portal .section-title,
.home-page--portal .automag-section__title {
	color: #fff;
}

.home-page--portal .car-card,
.home-page--portal .news-card {
	background: var(--portal-surface);
	border-color: var(--portal-border);
}

@media (max-width: 768px) {
	.portal-nav__list { display: none; }
	.portal-nav.is-open .portal-nav__list {
		display: flex;
		flex-direction: column;
		width: 100%;
	}
}

/* ── Search results page ── */
.search-results {
	padding: 1.5rem 0 3rem;
}

.search-results .breadcrumbs {
	margin: 0.75rem 0 1.25rem;
	font-size: 0.85rem;
}

.search-results .breadcrumb-list {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
	list-style: none;
	margin: 0;
	padding: 0;
	color: var(--color-text-muted);
}

.search-results .breadcrumb-list a {
	color: var(--color-accent);
	text-decoration: none;
}

.search-results__header .page-title {
	font-size: clamp(1.5rem, 3vw, 2rem);
	color: var(--color-text);
	margin: 0 0 1.25rem;
	font-weight: 700;
	line-height: 1.25;
}

.search-page-form {
	display: flex;
	gap: 0.75rem;
	flex-wrap: wrap;
	margin-bottom: 1.5rem;
	max-width: 640px;
}

.search-page-form input[type="search"] {
	flex: 1;
	min-width: 200px;
	padding: 0.85rem 1rem;
	border: 1px solid var(--color-border-strong, #ccc);
	border-radius: 10px;
	font-size: 1rem;
	background: #fff;
	color: var(--color-text);
}

.search-page-form .btn {
	padding: 0.85rem 1.25rem;
	border-radius: 10px;
	font-weight: 700;
}

.results-count {
	color: var(--color-text-muted);
	font-size: 0.9rem;
	margin: 0 0 1rem;
}

.search-results-list {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.search-result-item {
	display: grid;
	grid-template-columns: 140px 1fr;
	gap: 1rem;
	padding: 1rem;
	background: var(--color-surface-elevated, #fff);
	border: 1px solid var(--color-border);
	border-radius: 14px;
	box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}

@media (max-width: 560px) {
	.search-result-item { grid-template-columns: 100px 1fr; }
}

.search-result-thumb {
	display: block;
	border-radius: 10px;
	overflow: hidden;
	background: #1a1a1d;
	aspect-ratio: 4/3;
}

.search-result-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.search-result-thumb__placeholder {
	display: block;
	width: 100%;
	height: 100%;
	background: linear-gradient(135deg, #3f0d1a, #1a1a1d);
}

.search-result-type {
	display: inline-block;
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var(--color-accent);
	margin-bottom: 0.35rem;
}

.search-result-title {
	margin: 0 0 0.4rem;
	font-size: 1.1rem;
	line-height: 1.3;
}

.search-result-title a {
	color: var(--color-text);
	text-decoration: none;
}

.search-result-title a:hover {
	color: var(--color-accent);
}

.search-result-excerpt {
	margin: 0;
	color: var(--color-text-muted);
	font-size: 0.9rem;
	line-height: 1.5;
}

.no-results {
	padding: 2rem;
	text-align: center;
	background: var(--color-surface);
	border-radius: 14px;
}

.automag-skip-links:focus-within,
.automag-skip-link:focus {
	position: relative;
	z-index: 10000;
}

