/**
 * Viaturas — Stand público / Archive (M9)
 *
 * Estilos para /viaturas/ (top bar horizontal de chips + grid de cards).
 *
 * @package moticristo-child
 */

/* ============================================================================
 * 1. Layout base
 * ============================================================================ */

.mc-stand {
	max-width: 1280px;
	margin: 0 auto;
	padding: 0 24px 96px;
	font-family: 'Montserrat', sans-serif;
}

/* ============================================================================
 * 2. Header
 * ============================================================================ */

.mc-stand-header {
	padding: 48px 0 24px;
	border-bottom: 1px solid #f0f1f3;
	margin-bottom: 24px;
}

.mc-stand-header-inner {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 12px;
}

.mc-stand-title {
	font-size: 36px;
	font-weight: 700;
	color: #1a1a1a;
	margin: 0;
	letter-spacing: -0.5px;
}

.mc-stand-title em {
	color: #E52528;
	font-style: italic;
	font-weight: 600;
}

.mc-stand-subtitle {
	color: #646970;
	font-size: 14px;
	margin: 0;
}

.mc-stand-count {
	color: #1a1a1a;
	font-weight: 600;
}

/* ============================================================================
 * 3. Toolbar (chips de filtros + sort)
 * ============================================================================ */

.mc-stand-toolbar {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 16px;
	margin-bottom: 24px;
	flex-wrap: wrap;
}

.mc-stand-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	flex: 1;
	min-width: 0;
}

.mc-stand-toolbar-right {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-shrink: 0;
}

/* ── Chip dropdown (details/summary) ── */
.mc-chip-dd {
	position: relative;
	display: inline-block;
}

.mc-chip-dd > summary {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 14px;
	border: 1.5px solid #d0d3d7;
	border-radius: 999px;
	background: #fff;
	font-size: 13px;
	font-weight: 500;
	color: #1a1a1a;
	cursor: pointer;
	user-select: none;
	transition: border-color 0.15s, background 0.15s, color 0.15s;
	list-style: none;
}

.mc-chip-dd > summary::-webkit-details-marker {
	display: none;
}

.mc-chip-dd > summary:hover {
	border-color: #E52528;
	color: #E52528;
}

/* Open state */
.mc-chip-dd[open] > summary {
	background: #E52528;
	border-color: #E52528;
	color: #fff;
}

/* Has selection (badge) */
.mc-chip-dd > summary .badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	border-radius: 999px;
	background: #E52528;
	color: #fff;
	font-size: 11px;
	font-weight: 600;
	line-height: 1;
}

/* Override default [hidden] que é suprimido pelo display: inline-flex acima. */
.mc-chip-dd > summary .badge[hidden] {
	display: none !important;
}

.mc-chip-dd[open] > summary .badge {
	background: #fff;
	color: #E52528;
}

.mc-chip-dd > summary .ti {
	font-size: 14px;
	transition: transform 0.2s;
}

.mc-chip-dd[open] > summary .ti {
	transform: rotate(180deg);
}

/* Panel (the dropdown content) */
.mc-chip-dd-panel {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	min-width: 240px;
	max-width: 320px;
	max-height: 360px;
	overflow-y: auto;
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 10px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
	padding: 12px;
	z-index: 50;
}

.mc-chip-dd-panel--range {
	min-width: 280px;
}

.mc-chip-dd-panel--modelos {
	min-width: 280px;
}

.mc-chip-dd-hint {
	margin: 0 0 8px;
	padding: 8px;
	background: #fef8ee;
	color: #9a6700;
	font-size: 12px;
	border-radius: 6px;
}

/* Option (checkbox label) */
.mc-chip-opt {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 6px 8px;
	border-radius: 6px;
	font-size: 13px;
	cursor: pointer;
	transition: background 0.1s;
}

.mc-chip-opt:hover {
	background: #f5f5f5;
}

.mc-chip-opt input[type="checkbox"] {
	flex-shrink: 0;
	accent-color: #E52528;
	cursor: pointer;
	margin: 0;
}

.mc-chip-opt .name {
	flex: 1;
	color: #1a1a1a;
}

.mc-chip-opt .count {
	color: #888;
	font-size: 12px;
	flex-shrink: 0;
}

/* Modelo hidden when no marca matches */
.mc-modelo-opt[hidden] { display: none !important; }

/* Range inputs */
.mc-range-inputs {
	display: flex;
	gap: 12px;
}

.mc-range-inputs label {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 4px;
	font-size: 11px;
	color: #888;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	font-weight: 500;
}

.mc-range-inputs input {
	width: 100%;
	padding: 8px 10px;
	border: 1.5px solid #d0d3d7;
	border-radius: 8px;
	font-size: 14px;
	font-weight: 500;
	color: #1a1a1a;
	background: #fff;
	font-family: inherit;
}

.mc-range-inputs input:focus {
	border-color: #E52528;
	outline: 0;
}

/* Limpar button */
.mc-stand-clear {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 8px 14px;
	border-radius: 999px;
	background: transparent;
	color: #E52528;
	font-size: 13px;
	font-weight: 500;
	text-decoration: none;
	border: 1.5px dashed #E52528;
	transition: background 0.15s;
}

.mc-stand-clear[hidden] {
	display: none !important;
}

.mc-stand-clear:hover {
	background: #fef0f0;
	color: #E52528;
}

.mc-stand-clear .ti {
	font-size: 14px;
}

/* Sort select */
.mc-stand-sort {
	padding: 8px 14px;
	border: 1.5px solid #d0d3d7;
	border-radius: 999px;
	background: #fff;
	font-size: 13px;
	font-weight: 500;
	color: #1a1a1a;
	font-family: inherit;
	cursor: pointer;
}

.mc-stand-sort:focus {
	border-color: #E52528;
	outline: 0;
}

.mc-stand-submit {
	padding: 8px 18px;
	border: 0;
	border-radius: 999px;
	background: #E52528;
	color: #fff;
	font-weight: 500;
	cursor: pointer;
	font-family: inherit;
}

/* ============================================================================
 * 4. Grid de cards
 * ============================================================================ */

.mc-stand-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 24px;
	transition: opacity 0.2s;
	min-height: 200px;
}

.mc-stand-grid.is-loading {
	opacity: 0.5;
	pointer-events: none;
}

/* Card */
.mc-stand-card {
	background: #fff;
	border: 1px solid #f0f1f3;
	border-radius: 12px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.mc-stand-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
	border-color: #e0e0e0;
}

.mc-stand-card-link {
	display: flex;
	flex-direction: column;
	flex: 1;
	color: inherit;
	text-decoration: none;
}

.mc-stand-card-img-wrap {
	position: relative;
	aspect-ratio: 16 / 10;
	background: #f0f1f3;
	overflow: hidden;
}

.mc-stand-card-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.mc-stand-card-img--empty {
	background: linear-gradient(135deg, #f0f1f3 0%, #e6e8eb 100%);
}

.mc-stand-card-pill {
	position: absolute;
	top: 12px;
	left: 12px;
	padding: 4px 10px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.95);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.3px;
	text-transform: uppercase;
	color: #0a5ca8;
}

.mc-stand-card-pill--brevemente {
	background: #eef4fb;
	color: #0a5ca8;
}

.mc-stand-card-pill--reservado {
	background: #fef3c7;
	color: #92400e;
}

.mc-stand-card-pill--vendido {
	background: #1a1a1a;
	color: #fff;
}

/* Cards vendidos — visualmente esbatidos mas legíveis */
.mc-stand-card--vendido {
	opacity: 0.7;
	transition: opacity 0.2s;
}

.mc-stand-card--vendido:hover {
	opacity: 1;
}

.mc-stand-card--vendido .mc-stand-card-img {
	filter: grayscale(0.3);
}

.mc-stand-card-preco .vendido {
	color: #6b7280;
	font-style: italic;
	font-weight: 500;
	text-transform: uppercase;
	font-size: 13px;
	letter-spacing: 0.5px;
}

.mc-stand-card-body {
	padding: 16px 18px 18px;
	display: flex;
	flex-direction: column;
	flex: 1;
}

@keyframes mc-stand-led { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

.mc-stand-card-marca {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	font-size: 11px;
	color: #6b7280;
	text-transform: uppercase;
	letter-spacing: 1px;
	font-weight: 700;
	line-height: 1;
	margin-bottom: 6px;
}

.mc-stand-card-marca::before {
	content: "";
	width: 3px;
	height: 11px;
	border-radius: 2px;
	background: #E52528;
	animation: mc-stand-led 1.8s ease-in-out infinite;
}

.mc-stand-card-title {
	font-size: 16px;
	font-weight: 600;
	color: #1a1a1a;
	margin: 0;
	line-height: 1.3;
	letter-spacing: -0.2px;
}

.mc-stand-card-specs {
	list-style: none;
	margin: 10px 0 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 10px 14px;
}

.mc-stand-card-specs li {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-size: 12px;
	color: #4b5563;
	font-weight: 500;
}

.mc-stand-card-specs li svg {
	color: #9aa1ab;
	flex-shrink: 0;
}

/* Badges comerciais (sob o título) — vermelho Moticristo */
.mc-stand-card-badges {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 10px;
}

.mc-stand-badge {
	display: inline-flex;
	align-items: center;
	padding: 3px 9px;
	border-radius: 999px;
	font-size: 10.5px;
	font-weight: 700;
	letter-spacing: 0.4px;
	text-transform: uppercase;
	line-height: 1.4;
}

.mc-stand-badge--promo {
	background: #E52528;
	color: #fff;
}

/* Tags sobre a base da imagem (features) */
.mc-stand-card-tags {
	position: absolute;
	left: 12px;
	bottom: 12px;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	max-width: calc(100% - 24px);
	z-index: 2;
}

.mc-stand-tag {
	display: inline-flex;
	align-items: center;
	padding: 4px 11px;
	border-radius: 999px;
	font-size: 10.5px;
	font-weight: 700;
	letter-spacing: 0.4px;
	text-transform: uppercase;
	line-height: 1.3;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.mc-stand-tag--caixa {
	background: #0F1216;
	color: #fff;
}

.mc-stand-tag--eco {
	background: #2ce64a;
	color: #fff;
}

.mc-stand-card-preco {
	margin: auto 0 0;
	padding-top: 14px;
	border-top: 1px solid #f3f4f6;
	font-size: 20px;
	font-weight: 700;
	color: #E52528;
	letter-spacing: -0.3px;
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
}

.mc-stand-card-preco .iva {
	font-size: 12px;
	font-weight: 500;
	color: #888;
	letter-spacing: 0;
}

.mc-stand-preco-badge {
	display: inline-flex;
	align-items: center;
	padding: 3px 9px;
	border-radius: 6px;
	background: #0F1216;
	color: #fff;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.4px;
	text-transform: uppercase;
	line-height: 1.4;
}

.mc-stand-card-preco .vendido {
	color: #a8200a;
	text-transform: uppercase;
	font-size: 16px;
}

/* ============================================================================
 * 5. Empty state
 * ============================================================================ */

.mc-stand-empty {
	grid-column: 1 / -1;
	padding: 64px 32px;
	text-align: center;
	border: 1px dashed #d0d3d7;
	border-radius: 12px;
	color: #646970;
}

.mc-stand-empty p {
	margin: 0 0 12px;
	font-size: 16px;
}

.mc-stand-empty-link {
	display: inline-block;
	padding: 10px 24px;
	background: #E52528;
	color: #fff;
	border-radius: 999px;
	text-decoration: none;
	font-weight: 500;
}

.mc-stand-empty-link:hover {
	background: #c11f22;
	color: #fff;
}

/* ============================================================================
 * 6. Pagination
 * ============================================================================ */

#mc-stand-pagination-wrap {
	margin-top: 48px;
}

.mc-stand-pagination ul {
	display: flex;
	justify-content: center;
	gap: 4px;
	list-style: none;
	padding: 0;
	margin: 0;
	flex-wrap: wrap;
}

.mc-stand-pagination li {
	margin: 0;
}

.mc-stand-pagination a,
.mc-stand-pagination span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 10px;
	border-radius: 8px;
	background: #fff;
	border: 1px solid #e0e0e0;
	color: #1a1a1a;
	font-size: 14px;
	font-weight: 500;
	text-decoration: none;
	transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.mc-stand-pagination a:hover {
	border-color: #E52528;
	color: #E52528;
}

.mc-stand-pagination .current {
	background: #E52528;
	border-color: #E52528;
	color: #fff;
}

.mc-stand-pagination .dots {
	border: 0;
	background: transparent;
}

/* ============================================================================
 * 7. Responsive
 * ============================================================================ */

@media (max-width: 1100px) {
	.mc-stand-grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (max-width: 900px) {
	.mc-stand-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 16px;
	}
	.mc-stand-title {
		font-size: 28px;
	}
}

@media (max-width: 600px) {
	.mc-stand {
		padding: 0 16px 64px;
	}
	.mc-stand-grid {
		grid-template-columns: 1fr;
	}
	.mc-stand-toolbar {
		flex-direction: column;
	}
	.mc-stand-toolbar-right {
		width: 100%;
	}
	.mc-stand-sort {
		flex: 1;
	}
	.mc-chip-dd-panel {
		left: auto;
		right: 0;
	}
	.mc-stand-card-title {
		font-size: 15px;
	}
	.mc-stand-card-preco {
		font-size: 18px;
	}
}

/* ============================================================================
 * 8. Infinite scroll — sentinel, spinner, end message (M9-patch1)
 * ============================================================================ */

.mc-stand-sentinel {
	height: 1px;
	margin-top: -1px;
}

.mc-stand-spinner {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	padding: 32px 16px;
	color: #646970;
	font-size: 14px;
}

/* Força display: none quando hidden — override do display: flex acima. */
.mc-stand-spinner[hidden],
.mc-stand-end[hidden],
.mc-stand-sentinel[hidden] {
	display: none !important;
}

.mc-spinner {
	width: 20px;
	height: 20px;
	border: 2px solid #f0f1f3;
	border-top-color: #E52528;
	border-radius: 50%;
	animation: mc-spin 0.8s linear infinite;
	flex-shrink: 0;
}

@keyframes mc-spin {
	to { transform: rotate(360deg); }
}

.mc-stand-end {
	padding: 32px 16px;
	text-align: center;
	color: #888;
	font-size: 13px;
	font-style: italic;
}
