/* GuestPost Marketplace — filter bar, chips and table polish.
   Overrides guestpost-marketplace/assets/css/public.css (loaded after it). */

.gpm-marketplace-wrap {
	--gpm-blue: #1a3aff;
	--gpm-blue-50: #eef1ff;
	--gpm-line: #e3e7f1;
	--gpm-ink: #111827;
	--gpm-muted: #667085;
	font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* The master template gives the shortcode widget a custom 1284px width,
   wider than its 1140px column — it overflowed to the right. */
.elementor-widget-shortcode:has(> .elementor-widget-container .gpm-marketplace-wrap),
.elementor-widget-shortcode:has(> .elementor-shortcode > .gpm-marketplace-wrap) {
	width: 100% !important;
	max-width: 100% !important;
	--container-widget-width: 100% !important;
}
.gpm-marketplace-wrap { max-width: 100%; }
.gpm-marketplace-wrap .gpm-table-scroll { overflow-x: auto; }

/* ---------- Filter card ---------- */

.gpm-marketplace-wrap .gpm-filter-bar {
	border: 1px solid var(--gpm-line);
	border-radius: 14px;
	padding: 18px;
	box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .05);
}

/* Equal-width grid instead of ragged wrapping buttons */
.gpm-marketplace-wrap .gpm-filter-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
	gap: 10px;
}
.gpm-marketplace-wrap .gpm-fdrop { min-width: 0; width: auto; }

.gpm-marketplace-wrap .gpm-fbtn {
	width: 100%;
	max-width: none;
	height: 42px;
	padding: 0 12px 0 14px;
	justify-content: space-between;
	gap: 8px;
	border: 1px solid var(--gpm-line);
	border-radius: 9px;
	background: #fff;
	color: var(--gpm-ink);
	font-size: 13.5px;
	font-weight: 500;
	text-align: left;
	box-shadow: 0 1px 1px rgba(16, 24, 40, .03);
}
.gpm-marketplace-wrap .gpm-fbtn:hover { border-color: #b9c4ff; color: var(--gpm-ink); background: #fbfcff; }

.gpm-marketplace-wrap .gpm-fbtn-label {
	flex: 1 1 auto;
	min-width: 0;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
}

/* Selected value as a small pill instead of "· value" */
.gpm-marketplace-wrap .gpm-fbtn-val:not(:empty)::before { content: none; }
.gpm-marketplace-wrap .gpm-fbtn-val:not(:empty) {
	flex: 0 1 auto;
	max-width: 90px;
	padding: 3px 8px;
	border-radius: 999px;
	background: var(--gpm-blue);
	color: #fff;
	font-size: 11.5px;
	font-weight: 700;
	line-height: 1.2;
}

/* Replace the tiny "▾" text caret with a chevron icon */
.gpm-marketplace-wrap .gpm-fbtn > i {
	flex: none;
	font-size: 0;
	margin: 0;
	width: 14px;
	text-align: center;
	color: var(--gpm-muted);
	transition: transform .15s;
}
.gpm-marketplace-wrap .gpm-fbtn > i::before {
	content: "\f078";
	font-family: "Font Awesome 6 Free";
	font-weight: 900;
	font-style: normal;
	font-size: 11px;
	line-height: 1;
}
.gpm-marketplace-wrap .gpm-fdrop.open .gpm-fbtn > i { transform: rotate(180deg); color: var(--gpm-blue); }

.gpm-marketplace-wrap .gpm-fdrop.active .gpm-fbtn {
	border-color: var(--gpm-blue);
	background: var(--gpm-blue-50);
	color: var(--gpm-blue);
	font-weight: 600;
}
.gpm-marketplace-wrap .gpm-fdrop.open .gpm-fbtn { border-color: var(--gpm-blue); box-shadow: 0 0 0 3px rgba(26, 58, 255, .14); }

/* Dropdown panel */
.gpm-marketplace-wrap .gpm-fpanel {
	min-width: max(100%, 270px);
	max-width: min(360px, calc(100vw - 32px));
	border: 1px solid var(--gpm-line);
	border-radius: 12px;
	box-shadow: 0 16px 40px rgba(16, 24, 40, .16);
	padding: 14px;
	z-index: 80;
}
.gpm-marketplace-wrap .gpm-fpanel.gph-align-right { left: auto; right: 0; }

/* ---------- Quick chips + actions ---------- */

.gpm-marketplace-wrap .gpm-filter-actions {
	margin-top: 16px;
	padding-top: 16px;
	border-top: 1px solid var(--gpm-line);
}
.gpm-marketplace-wrap .gpm-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 14px;
	border: 1px solid var(--gpm-line);
	font-size: 13px;
	color: #344054;
}
.gpm-marketplace-wrap .gpm-chip .gph-emo { width: auto; color: var(--gpm-blue); font-size: 12px; }
.gpm-marketplace-wrap .gpm-chip.active .gph-emo { color: #fff; }

.gpm-marketplace-wrap .gpm-filter-btns { display: flex; gap: 8px; }
.gpm-marketplace-wrap .gpm-filter-btns button { height: 42px; border-radius: 9px; display: inline-flex; align-items: center; gap: 8px; }

/* ---------- Search row + active pills ---------- */

.gpm-marketplace-wrap .gpm-search-box input,
.gpm-marketplace-wrap .gpm-sort-controls select {
	height: 44px;
	border: 1px solid var(--gpm-line);
	border-radius: 9px;
	font-size: 14px;
}
.gpm-marketplace-wrap .gpm-filter-pill {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	border-radius: 999px;
	font-size: 13px;
}

.gpm-marketplace-wrap .gpm-search-row { gap: 12px; margin-bottom: 14px; }
.gpm-marketplace-wrap .gpm-search-box { flex: 1 1 320px; max-width: 520px; }
.gpm-marketplace-wrap .gpm-search-box input { width: 100%; padding: 0 14px; }
.gpm-marketplace-wrap .gpm-sort-controls select {
	min-width: 200px;
	padding: 0 34px 0 14px;
	background-position: right 14px center;
	color: var(--gpm-ink);
}
.gpm-marketplace-wrap .gpm-sort-controls select:first-child { min-width: 130px; }
.gpm-marketplace-wrap .gpm-search-box input:focus,
.gpm-marketplace-wrap .gpm-sort-controls select:focus { outline: none; border-color: var(--gpm-blue); box-shadow: 0 0 0 3px rgba(26, 58, 255, .14); }

/* ---------- Table ---------- */

.gpm-marketplace-wrap .gpm-table-wrap {
	border: 1px solid var(--gpm-line);
	border-radius: 14px;
	overflow: hidden;
	box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}

/* Fit the column on desktop (plugin forced min-width:1180px → scrollbar + cut-off "Buy Now"). */
.gpm-marketplace-wrap .gpm-table { min-width: 0; width: 100%; margin: 0; border: 0; }
.gpm-marketplace-wrap .gpm-table thead { background: #f6f8ff; border-bottom: 2px solid var(--gpm-blue); }
.gpm-marketplace-wrap .gpm-table th,
.gpm-marketplace-wrap .gpm-table td {
	padding: 12px 8px;
	border: 0;
	border-bottom: 1px solid #eef0f6;
	background: transparent;
}
.gpm-marketplace-wrap .gpm-table th:first-child,
.gpm-marketplace-wrap .gpm-table td:first-child { padding-left: 16px; }
.gpm-marketplace-wrap .gpm-table th:last-child,
.gpm-marketplace-wrap .gpm-table td:last-child { padding-right: 16px; }
.gpm-marketplace-wrap .gpm-table th { font-size: 12px; color: #344054; }
.gpm-marketplace-wrap .gpm-table tbody tr:nth-child(odd) > td,
.gpm-marketplace-wrap .gpm-table tbody tr:nth-child(even) > td { background: transparent; }
.gpm-marketplace-wrap .gpm-table tbody tr:hover > td { background: #f9faff; }
.gpm-marketplace-wrap .gpm-table tbody tr:last-child > td { border-bottom: 0; }
.gpm-marketplace-wrap .gpm-col-url { min-width: 160px; }

/* Empty / loading state */
.gpm-marketplace-wrap .gpm-table td.gpm-empty,
.gpm-marketplace-wrap .gpm-table td.gpm-loading {
	padding: 48px 20px;
	background: #fff !important;
	color: var(--gpm-muted);
	font-size: 14px;
}
.gpm-marketplace-wrap .gpm-empty h3 { font-size: 17px; font-weight: 700; color: var(--gpm-ink); margin: 0 0 6px; }
.gpm-marketplace-wrap .gpm-empty h3::before {
	content: "\f002";
	display: block;
	width: 52px;
	height: 52px;
	margin: 0 auto 14px;
	border-radius: 50%;
	background: var(--gpm-blue-50);
	color: var(--gpm-blue);
	font-family: "Font Awesome 6 Free";
	font-weight: 900;
	font-size: 20px;
	line-height: 52px;
	text-align: center;
}
.gpm-marketplace-wrap .gpm-empty a { color: var(--gpm-blue); font-weight: 600; text-decoration: underline; }

.gpm-marketplace-wrap .gpm-pagination:empty { display: none; }

/* ---------- Tablet / mobile ---------- */

@media (max-width: 1100px) {
	/* Narrow screens: keep columns readable and scroll the table inside its card. */
	.gpm-marketplace-wrap .gpm-table { min-width: 1020px; }
}

@media (max-width: 1024px) {
	.gpm-marketplace-wrap .gpm-filter-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
	.gpm-marketplace-wrap .gpm-search-box { max-width: none; }
}

@media (max-width: 768px) {
	.gpm-marketplace-wrap .gpm-filter-bar { padding: 14px; }
	.gpm-marketplace-wrap .gpm-filter-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
	.gpm-marketplace-wrap .gpm-fdrop.open { grid-column: 1 / -1; }
	.gpm-marketplace-wrap .gpm-fpanel { min-width: 0; max-width: none; }
	.gpm-marketplace-wrap .gpm-fbtn { height: 44px; font-size: 13px; }
	.gpm-marketplace-wrap .gpm-filter-actions { flex-direction: column; align-items: stretch; }
	.gpm-marketplace-wrap .gpm-filter-btns { justify-content: stretch; }
	.gpm-marketplace-wrap .gpm-filter-btns button { flex: 1; justify-content: center; }
	.gpm-marketplace-wrap .gpm-mbtn { height: 44px; border-radius: 9px; }
	.gpm-marketplace-wrap .gpm-sort-controls select { width: 100%; min-width: 0; }
	.gpm-marketplace-wrap .gpm-search-box { flex-basis: auto; }
}

@media (max-width: 380px) {
	.gpm-marketplace-wrap .gpm-filter-grid { grid-template-columns: 1fr; }
}
