/*
 * custom-additions.css
 * Place in: wp-content/themes/tera-mera-bazar-theme/custom-additions.css
 * Enqueue via the snippet in functions-snippet.php
 */

/* =========================================================================
   1. Hero — no duplicate search panel in page content
   ========================================================================= */
/* Belt-and-suspenders: if [pd_search] is ever accidentally re-added to the
   hero section in content, hide it. The template already omits it, but
   this ensures no flash even on a stale cache. */
.pd-hero .pd-search-panel {
	display: none !important;
}

/* =========================================================================
   2. Mobile / Tablet — category dropdown replaces pill row
   ========================================================================= */

/* Desktop default: show pills, hide the select wrapper */
.pd-cat-select-wrap {
	display: none;
}

@media (max-width: 900px) {
	/* Hide location field and entire category filter row on mobile/tablet */
	.pd-search-location {
		display: none !important;
	}
	.pd-category-filter {
		display: none !important;
	}

	/* Hide pills and clear button on small screens */
	#pd-cat-filter .pd-cat-pills,
	#pd-cat-filter .pd-cat-clear {
		display: none !important;
	}

	/* Show the select wrapper */
	.pd-cat-select-wrap {
		display: flex;
		align-items: center;
		gap: 8px;
		width: 100%;
		margin-top: 8px;
		flex-wrap: nowrap;
	}

	.pd-cat-select-label {
		flex-shrink: 0;
		font-size: 0.72rem;
		font-family: var(--pd-font-mono);
		letter-spacing: 0.06em;
		color: var(--pd-ink-soft);
		text-transform: uppercase;
	}

	.pd-cat-select-wrap select {
		flex: 1;
		min-width: 0;
		padding: 7px 10px;
		border: 1px solid var(--pd-rule);
		border-radius: var(--pd-radius);
		font-family: var(--pd-font-body);
		font-size: 0.88rem;
		background: var(--pd-surface);
		color: var(--pd-ink);
		cursor: pointer;
		-webkit-appearance: none;
		appearance: none;
		background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%230E2A47' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
		background-repeat: no-repeat;
		background-position: right 10px center;
		padding-right: 30px;
	}

	/* Compact header search on mobile */
	.pd-header-search-inner {
		padding: 10px 16px !important;
		gap: 10px;
	}

	/* Stack search row fields vertically on very small screens */
	.pd-search-row {
		flex-wrap: wrap;
		gap: 8px;
	}

	.pd-search-field {
		width: 100%;
	}

	.pd-search-btn {
		width: 100%;
		justify-content: center;
	}
}

/* =========================================================================
   3. Homepage — About section
   ========================================================================= */
.pd-home-about {
	background: var(--pd-surface);
	padding: 72px 0;
	border-top: 1px solid var(--pd-rule);
}

.pd-home-section-label {
	display: inline-block;
	font-family: var(--pd-font-mono);
	font-size: 0.72rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--pd-amber);
	margin-bottom: 10px;
}

.pd-home-about h2,
.pd-home-benefits h2,
.pd-home-featured h2 {
	font-family: var(--pd-font-display);
	font-size: 1.9rem;
	color: var(--pd-ink);
	margin: 0 0 20px;
	line-height: 1.25;
}

.pd-home-about-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 56px;
	align-items: start;
}

@media (max-width: 800px) {
	.pd-home-about-grid {
		grid-template-columns: 1fr;
		gap: 32px;
	}
}

.pd-home-about-text p {
	color: var(--pd-ink-soft);
	line-height: 1.7;
	margin-bottom: 16px;
}

.pd-home-about-text .pd-btn {
	margin-top: 8px;
}

/* KPI tiles */
.pd-kpi-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
}

.pd-kpi-tile {
	background: var(--pd-paper);
	border: 1px solid var(--pd-rule);
	border-radius: var(--pd-radius);
	padding: 24px 20px;
	text-align: center;
}

.pd-kpi-tile strong {
	display: block;
	font-family: var(--pd-font-display);
	font-size: 2rem;
	color: var(--pd-amber);
	margin-bottom: 6px;
}

.pd-kpi-tile span {
	font-size: 0.82rem;
	color: var(--pd-ink-soft);
	font-family: var(--pd-font-mono);
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

/* =========================================================================
   4. Homepage — Benefits section
   ========================================================================= */
.pd-home-benefits {
	background: var(--pd-paper);
	padding: 72px 0;
	border-top: 1px solid var(--pd-rule);
}

.pd-benefits-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 24px;
	margin-top: 32px;
}

@media (max-width: 900px) {
	.pd-benefits-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 600px) {
	.pd-benefits-grid {
		grid-template-columns: 1fr;
	}
}

.pd-benefit-card {
	background: var(--pd-surface);
	border: 1px solid var(--pd-rule);
	border-radius: var(--pd-radius);
	padding: 28px 24px;
}

.pd-benefit-icon {
	font-size: 1.8rem;
	margin-bottom: 14px;
}

.pd-benefit-card h4 {
	font-family: var(--pd-font-display);
	font-size: 1rem;
	color: var(--pd-ink);
	margin: 0 0 10px;
}

.pd-benefit-card p {
	font-size: 0.88rem;
	color: var(--pd-ink-soft);
	line-height: 1.65;
	margin: 0;
}

/* =========================================================================
   5. Homepage — Featured Suppliers section
   ========================================================================= */
.pd-home-featured {
	background: var(--pd-surface);
	padding: 72px 0;
	border-top: 1px solid var(--pd-rule);
}

/* 3-col grid variant for featured section */
.pd-listing-grid-3 {
	grid-template-columns: repeat(3, 1fr) !important;
}

@media (max-width: 900px) {
	.pd-listing-grid-3 {
		grid-template-columns: repeat(2, 1fr) !important;
	}
}

@media (max-width: 600px) {
	.pd-listing-grid-3 {
		grid-template-columns: 1fr !important;
	}
}

/* =========================================================================
   6. Homepage — Join CTA banner
   ========================================================================= */
.pd-home-join-cta {
	background: var(--pd-ink);
	padding: 64px 0;
}

.pd-join-cta-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 40px;
	flex-wrap: wrap;
}

.pd-join-cta-inner h2 {
	font-family: var(--pd-font-display);
	font-size: 1.7rem;
	color: #fff;
	margin: 0 0 10px;
}

.pd-join-cta-inner p {
	color: rgba(255,255,255,0.7);
	margin: 0;
	max-width: 480px;
}

.pd-join-cta-actions {
	display: flex;
	gap: 12px;
	flex-shrink: 0;
	flex-wrap: wrap;
}

/* White-on-dark button variant */
.pd-btn-white {
	background: #fff;
	color: var(--pd-ink) !important;
	border-color: #fff;
}

.pd-btn-white:hover {
	background: var(--pd-paper);
	border-color: var(--pd-paper);
}

.pd-btn-outline-white {
	background: transparent;
	color: #fff !important;
	border: 1px solid rgba(255,255,255,0.45);
}

.pd-btn-outline-white:hover {
	border-color: #fff;
	background: rgba(255,255,255,0.08);
}

@media (max-width: 700px) {
	.pd-join-cta-inner {
		flex-direction: column;
		text-align: center;
	}
	.pd-join-cta-actions {
		justify-content: center;
	}
}
