/**
 * QES PRO listing card — PROceed brand.
 *
 * Colors come from qes-brand.css tokens (var(--pro-*)). Navy = primary,
 * Teal = action/accent, Crimson = Sponsor (Official Partner) only,
 * WhatsApp green is functional and unchanged.
 * Tier differentiation is driven by the .qes-card--{tier} class on each card.
 * Mobile-first: the grid is a single column and only opens up at >=576px.
 */

.qes-cards-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 22px;
	width: 100%;
}

/* Desktop columns — collapse to one column on small screens (375px target). */
@media (min-width: 576px) {
	.qes-cards-cols-2 { grid-template-columns: repeat(2, 1fr); }
	.qes-cards-cols-3 { grid-template-columns: repeat(2, 1fr); }
	.qes-cards-cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 992px) {
	.qes-cards-cols-3 { grid-template-columns: repeat(3, 1fr); }
	.qes-cards-cols-4 { grid-template-columns: repeat(4, 1fr); }
}

/* ---- Card shell ---- */
.qes-card {
	position: relative;
	display: flex;
	flex-direction: column;
	background: var(--pro-white, #fff);
	border: 1px solid var(--pro-line, #e6e9f0);
	border-radius: 14px;
	padding: 20px;
	box-shadow: 0 2px 10px rgba(12, 53, 89, 0.05);
	transition: transform 0.18s ease, box-shadow 0.18s ease;
	overflow: hidden;
	font-family: var(--pro-font, -apple-system, "Segoe UI", Roboto, Arial, sans-serif);
}

.qes-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 10px 26px rgba(12, 53, 89, 0.12);
}

/* ---- Header: logo + name ---- */
.qes-card__head {
	display: flex;
	gap: 14px;
	align-items: flex-start;
}

/* Reserve space at the top so the corner badge / ribbon never overlaps the name. */
.qes-card--premium .qes-card__head,
.qes-card--featured .qes-card__head,
.qes-card--sponsor .qes-card__head {
	margin-top: 12px;
}
.qes-card--premium .qes-card__heading,
.qes-card--featured .qes-card__heading {
	padding-right: 78px;
}

.qes-card__logo {
	flex: 0 0 56px;
	width: 56px;
	height: 56px;
	border-radius: 10px;
	overflow: hidden;
	background: var(--pro-cloud, #f5f7fa);
	display: flex;
	align-items: center;
	justify-content: center;
}

.qes-card__logo img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.qes-card__logo-fallback {
	font-size: 24px;
	font-weight: 700;
	color: var(--pro-navy, #0d2952);
	text-transform: uppercase;
	font-family: var(--pro-font, -apple-system, "Segoe UI", Roboto, Arial, sans-serif);
}

.qes-card__heading {
	flex: 1 1 auto;
	min-width: 0;
}

.qes-card__name {
	margin: 0 0 4px;
	font-size: 17px;
	line-height: 1.25;
	font-weight: 700;
	font-family: var(--pro-font, -apple-system, "Segoe UI", Roboto, Arial, sans-serif);
}

.qes-card__name a {
	color: var(--pro-navy, #0d2952);
	text-decoration: none;
}

.qes-card__name a:hover {
	color: var(--pro-teal-700, #0C746D);
}

/* ---- Verified PRO badge: teal bg, white text, checkmark (brand trust cue) ---- */
.qes-card__verified {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	margin: 2px 0 6px;
	padding: 3px 9px;
	background: var(--pro-teal, #12B5AA);
	color: #fff;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.02em;
	border-radius: 20px;
	line-height: 1;
}

.qes-card__verified svg { color: #fff; }

/* ---- Rating ---- */
.qes-card__rating {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 4px 6px;
	margin-top: 2px;
	font-size: 13px;
	color: var(--pro-muted, #5a6478);
}
.qes-card__reviews { white-space: nowrap; }

.qes-card__stars { letter-spacing: 1px; font-size: 14px; line-height: 1; }
.qes-star.is-full  { color: var(--pro-star, #f5a623); }
.qes-star.is-half  { color: var(--pro-star, #f5a623); opacity: 0.55; }
.qes-star.is-empty { color: #d4d9e2; }
.qes-card__rating-num { font-weight: 700; color: var(--pro-navy, #0d2952); }

/* ---- Location ---- */
.qes-card__location {
	display: flex;
	align-items: center;
	gap: 5px;
	margin-top: 14px;
	font-size: 13px;
	color: var(--pro-muted, #5a6478);
}
.qes-card__location svg { color: var(--pro-teal, #12B5AA); flex: 0 0 auto; }

/* ---- Service tags ---- */
.qes-card__tags {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 12px;
}

.qes-card__tag {
	font-size: 11.5px;
	font-weight: 500;
	color: var(--pro-navy, #0d2952);
	background: var(--pro-sunken, #eef2f8);
	border-radius: 6px;
	padding: 4px 9px;
	line-height: 1.2;
}

/* ---- Response time guarantee (premium + sponsor) ---- */
.qes-card__response {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-top: 12px;
	font-size: 12.5px;
	font-weight: 600;
	color: #1a7a4d;
}
.qes-card__response svg { color: #1a7a4d; flex: 0 0 auto; }

/* ---- Actions ---- */
.qes-card__actions {
	display: flex;
	gap: 10px;
	margin-top: 18px;
	padding-top: 16px;
	border-top: 1px solid #eef0f5;
}

.qes-card__btn {
	flex: 1 1 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	/* 44px min touch target (Apple/Google a11y guideline) for the WhatsApp +
	   profile CTAs on every screen size. */
	min-height: 44px;
	padding: 10px 12px;
	border-radius: 9px;
	font-size: 13.5px;
	font-weight: 600;
	text-decoration: none;
	text-align: center;
	line-height: 1.2;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
	cursor: pointer;
}

/* Primary CTA — WhatsApp (functional brand green, never re-themed) */
.qes-card__btn--whatsapp {
	background: var(--pro-whatsapp, #25d366);
	color: #fff;
}
.qes-card__btn--whatsapp:hover { background: var(--pro-whatsapp-hover, #1da851); color: #fff; }
.qes-card__btn--whatsapp svg { color: #fff; }

/* Secondary CTA — View Profile (navy outline) */
.qes-card__btn--profile {
	background: var(--pro-white, #fff);
	color: var(--pro-navy, #0d2952);
	border: 1.5px solid var(--pro-navy, #0d2952);
}
.qes-card__btn--profile:hover { background: var(--pro-navy, #0d2952); color: #fff; }

/* When a card has no WhatsApp button (free tier), View Profile fills the row. */
.qes-card--free .qes-card__btn--profile { flex-basis: 100%; }

/* ---- Tier differentiation ---- */

/* Featured: subtle navy accent on the left edge. */
.qes-card--featured {
	border-color: #c9d3e6;
	box-shadow: 0 3px 12px rgba(12, 53, 89, 0.08);
}

/* Premium: stronger navy frame. */
.qes-card--premium {
	border: 1.5px solid var(--pro-navy, #0d2952);
	box-shadow: 0 6px 18px rgba(12, 53, 89, 0.12);
}

/* Sponsor: crimson frame + partner ribbon + lift (Official Partner tier). */
.qes-card--sponsor {
	border: 2px solid var(--pro-crimson, #C8102E);
	box-shadow: 0 8px 24px rgba(200, 16, 46, 0.18);
}

/* "Official Partner" corner ribbon — sponsor only.
   A fixed-width band rotated 45° and centred across the top-right corner, so
   it sits cleanly inside the card's overflow:hidden clip (no overshoot). */
.qes-card__ribbon {
	position: absolute;
	top: 18px;
	right: -52px;
	width: 180px;
	transform: rotate(45deg);
	background: var(--pro-crimson, #C8102E);
	color: #fff;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	text-align: center;
	padding: 5px 0;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
	pointer-events: none;
}

/* Tier corner badges for premium/featured (text from the tier label). */
.qes-card--premium::before,
.qes-card--featured::before {
	position: absolute;
	top: 0;
	right: 0;
	padding: 4px 10px;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	border-bottom-left-radius: 10px;
	color: #fff;
}
.qes-card--premium::before {
	content: "Premium";
	background: var(--pro-navy, #0d2952);
}
.qes-card--featured::before {
	content: "Featured";
	background: var(--pro-navy-700, #4a6491);
}

/* ---- Small screens: stack actions, prevent overflow ---- */
@media (max-width: 575px) {
	.qes-card { padding: 16px; border-radius: 12px; }
	.qes-card__logo { flex: 0 0 48px; width: 48px; height: 48px; }
	.qes-card__name { font-size: 16px; }
	.qes-card__actions { flex-direction: column; }
	.qes-card__btn { width: 100%; flex: 0 0 auto; }
	/* On a stacked column the corner badge has room, drop the reserved gutter. */
	.qes-card--premium .qes-card__heading,
	.qes-card--featured .qes-card__heading { padding-right: 70px; }
}
