/**
 * FPS System Build block styles
 * Dark-theme, matches product-grid and product-pricing design tokens.
 */

/* ─────────────────────────────────────────────────────────────
 * Variables (repeated here for standalone enqueueing)
 * ───────────────────────────────────────────────────────────── */
:root {
	--fps-sb-surface:    #2c2c2c;
	--fps-sb-bg:         #1a1a1a;
	--fps-sb-border:     #444;
	--fps-sb-accent:     #007cba;
	--fps-sb-text:       #e8e8e8;
	--fps-sb-muted:      #9a9a9a;
	--fps-sb-success:    #3fb950;
	--fps-sb-warning:    #d29922;
	--fps-sb-error:      #f85149;
	--fps-sb-radius:     6px;
}

/* ─────────────────────────────────────────────────────────────
 * Standalone share page layout
 * Wraps the build card in a centred, max-width container when the
 * theme's own content column is not available (fps_share_render_standalone).
 * ───────────────────────────────────────────────────────────── */
.fps-share-page {
	width: 100%;
	box-sizing: border-box;
	padding: 24px 16px 48px;
	background: #1a1a1a;
}

.fps-share-page__wrap {
	max-width: 1200px;
	margin: 0 auto;
	width: 100%;
	box-sizing: border-box;
}

/* ─────────────────────────────────────────────────────────────
 * Wrapper
 * ───────────────────────────────────────────────────────────── */
.fps-system-build {
	background: var(--fps-sb-bg);
	border-radius: var(--fps-sb-radius);
	overflow: hidden;
	font-family: inherit;
	color: var(--fps-sb-text);
	border: 1px solid var(--fps-sb-border);
}

/* ─────────────────────────────────────────────────────────────
 * Hero section
 * ───────────────────────────────────────────────────────────── */
.fps-system-build__hero {
	display: grid;
	grid-template-columns: 280px 1fr;
	gap: 0;
}

.fps-system-build__hero-image {
	width: 100%;
	height: 100%;
	min-height: 180px;
	object-fit: cover;
	display: block;
}

.fps-system-build__hero-image--placeholder {
	background: var(--fps-sb-surface);
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 180px;
}

.fps-system-build__hero-image--placeholder .dashicons {
	font-size: 64px;
	width: 64px;
	height: 64px;
	color: #555;
}

.fps-system-build__hero-meta {
	padding: 24px 28px;
	background: var(--fps-sb-surface);
	border-left: 1px solid var(--fps-sb-border);
}

.fps-system-build__title {
	margin: 0 0 6px;
	font-size: 22px;
	font-weight: 700;
	line-height: 1.25;
	color: var(--fps-sb-text);
}

.fps-system-build__tagline {
	margin: 0 0 12px;
	font-size: 14px;
	color: var(--fps-sb-muted);
	line-height: 1.5;
}

.fps-system-build__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 14px;
}

.fps-system-build__chip {
	display: inline-block;
	padding: 3px 9px;
	background: rgba(0, 124, 186, 0.15);
	color: var(--fps-sb-accent);
	border: 1px solid rgba(0, 124, 186, 0.3);
	border-radius: 12px;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.fps-system-build__totals {
	margin-top: 4px;
}

.fps-system-build__total-price {
	font-size: 28px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	color: var(--fps-sb-text);
	line-height: 1;
}

.fps-system-build__total-range {
	font-size: 12px;
	color: var(--fps-sb-muted);
	margin-top: 4px;
}

.fps-system-build__last-priced {
	font-size: 11px;
	color: var(--fps-sb-muted);
	margin-top: 2px;
}

/* ─────────────────────────────────────────────────────────────
 * Compatibility banner
 * ───────────────────────────────────────────────────────────── */
.fps-system-build__compat {
	padding: 10px 20px;
	font-size: 13px;
	border-top: 1px solid var(--fps-sb-border);
}

.fps-system-build__compat--ok {
	background: rgba(63, 185, 80, 0.08);
	color: var(--fps-sb-success);
}

.fps-system-build__compat--warning {
	background: rgba(210, 153, 34, 0.1);
	color: var(--fps-sb-warning);
}

.fps-system-build__compat--error {
	background: rgba(248, 81, 73, 0.1);
	color: var(--fps-sb-error);
}

.fps-system-build__compat-list {
	margin: 4px 0 0 18px;
	padding: 0;
}

.fps-system-build__compat-list li {
	margin-bottom: 2px;
}

/* ─────────────────────────────────────────────────────────────
 * Parts table (layout: table)
 * ───────────────────────────────────────────────────────────── */
.fps-system-build__table-wrap {
	overflow-x: auto;
}

.fps-system-build__table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
}

.fps-system-build__table thead th {
	background: #232323;
	color: var(--fps-sb-muted);
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	padding: 8px 14px;
	text-align: left;
	border-bottom: 1px solid var(--fps-sb-border);
}

.fps-system-build__table tbody tr {
	border-bottom: 1px solid var(--fps-sb-border);
	transition: background 0.12s ease;
}

.fps-system-build__table tbody tr:hover {
	background: rgba(255, 255, 255, 0.03);
}

.fps-system-build__table tbody td {
	padding: 10px 14px;
	vertical-align: middle;
	color: var(--fps-sb-text);
}

.bestprice {
	display: inline-flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 2px;
	min-width: 138px;
	padding: 8px 12px;
	border-radius: 8px;
	border: 1px solid rgba(0, 124, 186, 0.34);
	background: linear-gradient(180deg, rgba(8, 43, 64, 0.95), rgba(22, 33, 44, 0.95));
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
	color: #f7fbff;
	font-variant-numeric: tabular-nums;
	line-height: 1.2;
	text-align: left;
	text-decoration: none;
}

button.bestprice {
	appearance: none;
	background: linear-gradient(180deg, rgba(8, 43, 64, 0.95), rgba(22, 33, 44, 0.95));
	cursor: pointer;
	font: inherit;
}

.bestprice:hover {
	border-color: rgba(89, 168, 216, 0.76);
	color: #fff;
}

.bestprice--sm {
	min-width: 124px;
	padding: 7px 10px;
}

.bestprice__k {
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #9fc7df;
}

.bestprice__amt {
	font-size: 20px;
	font-weight: 800;
	color: #fff;
	line-height: 1.05;
}

.bestprice__sub {
	font-size: 11px;
	color: #b7c7d2;
}

.fps-bestprice-wrap {
	display: inline-flex;
	align-items: stretch;
	position: relative;
	max-width: 100%;
}

.fps-bestprice__proxy {
	position: absolute;
	width: 0;
	height: 0;
	overflow: visible;
}

.fps-bestprice-floating-ui .modal-content {
	background: #313a47 !important;
	border-color: rgba(255, 255, 255, 0.1) !important;
	box-shadow: 0 28px 80px rgba(0, 0, 0, 0.55) !important;
}

.fps-bestprice-floating-ui .modal-dialog {
	min-height: calc(100% - 1rem);
	display: flex;
	align-items: center;
	margin: 0.5rem auto;
	max-width: min(560px, calc(100vw - 2rem));
}

.fps-bestprice-floating-ui .modal-header,
.fps-bestprice-floating-ui .modal-footer {
	border-color: rgba(255, 255, 255, 0.08) !important;
}

.fps-bestprice-floating-ui .btn-close {
	filter: invert(1) grayscale(1) brightness(200%);
	opacity: 0.92;
}

.fps-bestprice-floating-ui .btn-close:hover,
.fps-bestprice-floating-ui .btn-close:focus {
	opacity: 1;
}

@media (min-width: 768px) {
	.fps-bestprice-floating-ui .modal-dialog {
		min-height: calc(100% - 3.5rem);
		margin: 1.75rem auto;
	}
}

.affil-disclosure {
	margin: 0 20px 18px;
	padding: 14px 16px;
	border: 1px solid rgba(0, 124, 186, 0.22);
	border-radius: 8px;
	background: linear-gradient(180deg, rgba(0, 124, 186, 0.08), rgba(255, 255, 255, 0.02));
	color: var(--fps-sb-text);
	font-size: 12px;
	line-height: 1.55;
}

.affil-disclosure p {
	margin: 0;
}

.affil-disclosure p + p {
	margin-top: 8px;
}

.fps-system-build__table tbody tr:last-child {
	border-bottom: none;
}

/* Slot label column */
.fps-system-build__slot-label {
	color: var(--fps-sb-muted);
	font-size: 12px;
	font-weight: 600;
	white-space: nowrap;
	width: 110px;
}

/* Part column with thumbnail */
.fps-system-build__part-cell {
	display: flex;
	align-items: center;
	gap: 10px;
}

.fps-system-build__part-thumb {
	width: 40px;
	height: 40px;
	object-fit: cover;
	border-radius: 4px;
	background: #333;
	flex-shrink: 0;
}

.fps-system-build__part-thumb--placeholder {
	width: 40px;
	height: 40px;
	background: #333;
	border-radius: 4px;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
}

@media (max-width: 700px) {
	.affil-disclosure {
		margin: 0 12px 14px;
		padding: 12px;
	}

	.bestprice,
	.fps-bestprice-wrap {
		min-width: 0;
		width: 100%;
	}
}

.fps-system-build__part-thumb--placeholder .dashicons {
	font-size: 20px;
	width: 20px;
	height: 20px;
	color: #555;
}

.fps-system-build__part-name {
	font-weight: 500;
	color: var(--fps-sb-text);
}

.fps-system-build__part-name a {
	color: inherit;
	text-decoration: none;
}

.fps-system-build__part-name a:hover {
	color: var(--fps-sb-accent);
	text-decoration: underline;
}

.fps-system-build__part-removed {
	color: var(--fps-sb-muted);
	font-style: italic;
	font-size: 13px;
}

/* Price column */
.fps-system-build__price {
	font-variant-numeric: tabular-nums;
	font-weight: 600;
	white-space: nowrap;
	color: var(--fps-sb-text);
}

.fps-system-build__price--none {
	color: var(--fps-sb-muted);
	font-weight: normal;
}

/* ─────────────────────────────────────────────────────────────
 * Parts grid (layout: cards)
 * ───────────────────────────────────────────────────────────── */
.fps-system-build__cards {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 14px;
	padding: 16px;
}

.fps-system-build__card {
	background: var(--fps-sb-surface);
	border: 1px solid var(--fps-sb-border);
	border-radius: var(--fps-sb-radius);
	padding: 14px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.fps-system-build__card-slot {
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--fps-sb-muted);
}

.fps-system-build__card-name {
	font-size: 13px;
	font-weight: 600;
	color: var(--fps-sb-text);
	line-height: 1.35;
}

.fps-system-build__card-name a {
	color: inherit;
	text-decoration: none;
}

.fps-system-build__card-price {
	font-size: 15px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	color: var(--fps-sb-text);
	margin-top: auto;
}

/* ─────────────────────────────────────────────────────────────
 * Footer
 * ───────────────────────────────────────────────────────────── */
.fps-system-build__footer {
	padding: 12px 20px;
	background: #232323;
	border-top: 1px solid var(--fps-sb-border);
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 8px;
	font-size: 13px;
	color: var(--fps-sb-muted);
}

.fps-system-build__footer-actions {
	display: flex;
	gap: 8px;
}

.fps-system-build__footer-btn {
	display: inline-block;
	padding: 4px 12px;
	border: 1px solid var(--fps-sb-border);
	border-radius: 4px;
	font-size: 12px;
	font-weight: 600;
	color: var(--fps-sb-muted);
	text-decoration: none;
	transition: border-color 0.15s, color 0.15s;
	background: transparent;
	cursor: pointer;
}

.fps-system-build__footer-btn:hover {
	border-color: var(--fps-sb-accent);
	color: var(--fps-sb-accent);
}

.fps-system-build__disclosure {
	font-size: 11px;
	color: #666;
	margin-top: 2px;
}

/* ─────────────────────────────────────────────────────────────
 * Responsive
 * ───────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
	.fps-system-build__hero {
		grid-template-columns: 1fr;
	}

	.fps-system-build__hero-image--placeholder {
		min-height: 120px;
	}

	.fps-system-build__hero-meta {
		border-left: none;
		border-top: 1px solid var(--fps-sb-border);
	}
}

@media (max-width: 480px) {
	.fps-system-build__cards {
		grid-template-columns: 1fr;
	}

	.fps-system-build__title {
		font-size: 18px;
	}

	.fps-system-build__total-price {
		font-size: 22px;
	}
}
