/**
 * RFPMart Integration — frontend styles.
 *
 * Scoped under .rfpmart-wrapper / .rfpmart-single so nothing here leaks
 * into the host theme's global styles. Uses CSS custom properties for
 * the small set of repeated colors so a theme integrator can override
 * the palette by redefining these variables in their own child-theme
 * stylesheet, without needing to fight specificity throughout this file.
 */

/* ───── Elementor / theme global style resets ─────
   Elementor Kit global typography and button styles override scoped
   plugin CSS. These rules undo the most common culprits without
   touching anything outside .rfpmart-wrapper. */
.rfpmart-wrapper input,
.rfpmart-wrapper select,
.rfpmart-wrapper textarea,
.rfpmart-wrapper button {
	box-sizing: border-box !important;
	font-family: inherit !important;
	line-height: normal !important;
	letter-spacing: normal !important;
}
button.airfp-btn.airfp-btn-outline.rfpmart-reset-filters {
    line-height: 1px !important;
}
button.airfp-btn.rfpmart-apply-filters {
    line-height: 1px !important;
}
.rfpmart-wrapper button {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	align-self: center !important;
	width: auto !important;
	height: auto !important;
	min-height: 0 !important;
	padding: 0.6rem 1.2rem !important;
	border-radius: 6px !important;
	font-size: 14px !important;
	font-weight: 600 !important;
	cursor: pointer !important;
	flex-shrink: 0 !important;
	flex-grow: 0 !important;
	text-transform: none !important;
}

.rfpmart-wrapper input[type="text"],
.rfpmart-wrapper input[type="date"],
.rfpmart-wrapper input[type="search"],
.rfpmart-wrapper select {
	height: auto !important;
	min-height: 0 !important;
	width: 100% !important;
	padding: 0.55rem 0.75rem !important;
	border: 1px solid var(--rfpmart-border) !important;
	border-radius: 6px !important;
	font-size: 14px !important;
	background: #fff !important;
	color: var(--rfpmart-text) !important;
	outline: none !important;
	box-shadow: none !important;
}

.rfpmart-wrapper {
	--rfpmart-primary: #0c7a6a;
	--rfpmart-primary-dark: #095e51;
	--rfpmart-accent: #e85d2f;
	--rfpmart-text: #1a2332;
	--rfpmart-muted: #6b7785;
	--rfpmart-border: #e3e8ec;
	--rfpmart-bg-soft: #f4f7f8;
	--rfpmart-urgent: #c0392b;

	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	color: var(--rfpmart-text);
	max-width: 100%;
	box-sizing: border-box;
}

.rfpmart-wrapper *,
.rfpmart-single * {
	box-sizing: border-box;
}

/* ───── Filters ───── */
.rfpmart-filters {
	background: var(--rfpmart-bg-soft);
	border: 1px solid var(--rfpmart-border);
	border-radius: 10px;
	padding: 1.1rem;
	margin-bottom: 1.5rem;
}

.rfpmart-filter-row {
	display: flex;
	flex-wrap: wrap;
	gap: 0.7rem;
	margin-bottom: 0.7rem;
}

.rfpmart-filter-row:last-child {
	margin-bottom: 0;
	align-items: center !important;
}

.rfpmart-input {
	flex: 1 1 180px;
	min-width: 140px;
	padding: 0.55rem 0.75rem;
	border: 1px solid var(--rfpmart-border);
	border-radius: 6px;
	font-size: 14px;
	background: #fff;
	color: var(--rfpmart-text);
}

.rfpmart-search {
	flex: 2 1 240px;
}

.rfpmart-date-label {
	display: flex;
	flex-direction: column;
	gap: 0.3rem;
	font-size: 12px;
	color: var(--rfpmart-muted);
	font-weight: 600;
	flex: 1 1 160px;
}

.rfpmart-date-label .rfpmart-input {
	width: 100%;
}

/* ───── Buttons ───── */
.rfpmart-wrapper .rfpmart-btn {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	align-self: center !important;
	gap: 6px;
	background: var(--rfpmart-primary) !important;
	color: #fff !important;
	border: none !important;
	padding: 0.6rem 1.2rem !important;
	border-radius: 6px !important;
	font-size: 14px !important;
	font-weight: 600 !important;
	cursor: pointer !important;
	text-decoration: none !important;
	transition: background 0.18s ease;
	white-space: nowrap;
	height: auto !important;
	width: auto !important;
	flex-shrink: 0 !important;
	flex-grow: 0 !important;
}

.rfpmart-wrapper .rfpmart-btn:hover {
	background: var(--rfpmart-primary-dark) !important;
}

.rfpmart-wrapper .rfpmart-btn-secondary {
	background: transparent !important;
	color: var(--rfpmart-primary) !important;
	border: 1.5px solid var(--rfpmart-primary) !important;
}

.rfpmart-wrapper .rfpmart-btn-secondary:hover {
	background: var(--rfpmart-bg-soft) !important;
}

.rfpmart-wrapper .rfpmart-btn-small {
	padding: 0.4rem 0.85rem !important;
	font-size: 13px !important;
}

/* ───── Status / loading ───── */
.rfpmart-status {
	min-height: 1.2em;
	font-size: 13px;
	color: var(--rfpmart-muted);
	margin-bottom: 0.6rem;
}

.rfpmart-wrapper.is-loading .rfpmart-results {
	opacity: 0.45;
	pointer-events: none;
	transition: opacity 0.15s ease;
}

/* ───── Grid / Cards ───── */
.rfpmart-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 1.1rem;
}

.rfpmart-card {
	border: 1px solid var(--rfpmart-border);
	border-radius: 10px;
	padding: 1.25rem;
	background: #fff;
	display: flex;
	flex-direction: column;
	gap: 0.55rem;
	transition: box-shadow 0.18s ease, transform 0.18s ease;
}

.rfpmart-card:hover {
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
	transform: translateY(-2px);
}

.rfpmart-card-urgent {
	border-color: var(--rfpmart-urgent);
}

.rfpmart-card-category {
	display: inline-block;
	background: var(--rfpmart-bg-soft);
	color: var(--rfpmart-primary);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	padding: 0.25rem 0.6rem;
	border-radius: 100px;
	width: fit-content;
}

.rfpmart-card-title {
	font-size: 1.05rem;
	line-height: 1.35;
	margin: 0;
}

.rfpmart-card-title a {
	color: var(--rfpmart-text);
	text-decoration: none;
}

.rfpmart-card-title a:hover {
	color: var(--rfpmart-primary);
}

.rfpmart-card-location {
	font-size: 13px;
	color: var(--rfpmart-muted);
	margin: 0;
}

.rfpmart-card-excerpt {
	font-size: 13.5px;
	color: var(--rfpmart-muted);
	line-height: 1.55;
	margin: 0;
	flex-grow: 1;
}

.rfpmart-card-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 0.8rem;
	font-size: 12.5px;
	color: var(--rfpmart-muted);
	border-top: 1px solid var(--rfpmart-border);
	padding-top: 0.6rem;
}

.rfpmart-meta-urgent {
	color: var(--rfpmart-urgent);
	font-weight: 700;
}

.rfpmart-card-actions {
	display: flex;
	gap: 0.5rem;
	margin-top: 0.3rem;
}

/* ───── Table layout ───── */
.rfpmart-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
}

.rfpmart-table thead th {
	text-align: left;
	background: var(--rfpmart-bg-soft);
	padding: 0.7rem 0.85rem;
	font-size: 12.5px;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: var(--rfpmart-muted);
	border-bottom: 2px solid var(--rfpmart-border);
}

.rfpmart-table tbody td {
	padding: 0.75rem 0.85rem;
	border-bottom: 1px solid var(--rfpmart-border);
	vertical-align: middle;
}

.rfpmart-table tbody tr:hover {
	background: var(--rfpmart-bg-soft);
}

.rfpmart-row-urgent td:first-child {
	border-left: 3px solid var(--rfpmart-urgent);
}

.rfpmart-table a {
	color: var(--rfpmart-primary);
	text-decoration: none;
	font-weight: 600;
}

/* ───── Pagination ───── */
.rfpmart-pagination {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	margin-top: 1.5rem;
	justify-content: center;
}

.rfpmart-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 36px;
	height: 36px;
	padding: 0 0.6rem;
	border: 1px solid var(--rfpmart-border);
	border-radius: 6px;
	text-decoration: none;
	color: var(--rfpmart-text);
	font-size: 13.5px;
}

.rfpmart-pagination .page-numbers.current {
	background: var(--rfpmart-primary);
	color: #fff;
	border-color: var(--rfpmart-primary);
}

.rfpmart-pagination a.page-numbers:hover {
	border-color: var(--rfpmart-primary);
	color: var(--rfpmart-primary);
}

/* ───── No results / error ───── */
.rfpmart-no-results,
.rfpmart-error {
	text-align: center;
	padding: 2.5rem 1rem;
	color: var(--rfpmart-muted);
	font-size: 15px;
	background: var(--rfpmart-bg-soft);
	border-radius: 10px;
}

.rfpmart-error {
	color: var(--rfpmart-urgent);
}

/* ───── Spinner ───── */
.rfpmart-spinner {
	display: inline-block;
	width: 16px;
	height: 16px;
	border: 2px solid var(--rfpmart-border);
	border-top-color: var(--rfpmart-primary);
	border-radius: 50%;
	animation: rfpmart-spin 0.7s linear infinite;
	vertical-align: middle;
	margin-right: 6px;
}

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

/* ───── Single RFP page ───── */
.rfpmart-single-wrapper {
	max-width: 800px;
	margin: 0 auto;
	padding: 2rem 1rem;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.rfpmart-single-header h1 {
	font-size: 1.85rem;
	line-height: 1.25;
	margin: 0.6rem 0 1rem;
}

.rfpmart-single-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 1.2rem;
	font-size: 13.5px;
	color: #6b7785;
	border-bottom: 1px solid #e3e8ec;
	padding-bottom: 1.2rem;
	margin-bottom: 1.2rem;
}

.rfpmart-single-block {
	margin-bottom: 1.8rem;
}

.rfpmart-single-block h2 {
	font-size: 1.1rem;
	margin-bottom: 0.5rem;
	color: #0c7a6a;
}

.rfpmart-single-content p {
	line-height: 1.7;
	color: #2c3744;
}

.rfpmart-single-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.7rem;
	margin: 2rem 0;
}

.rfpmart-single-back {
	margin-top: 1.5rem;
}

.rfpmart-single-back a {
	color: #0c7a6a;
	text-decoration: none;
	font-weight: 600;
}

/* ───── Responsive ───── */
@media (max-width: 640px) {
	.rfpmart-grid {
		grid-template-columns: 1fr;
	}

	.rfpmart-filter-row {
		flex-direction: column;
	}

	.rfpmart-input,
	.rfpmart-date-label {
		flex: 1 1 100%;
	}

	.rfpmart-table {
		display: block;
		overflow-x: auto;
		white-space: nowrap;
	}
}
