/* =============================================================================================================
 * Roblie Property Archive — Stylesheet
 * Enqueue this file manually. Same design language as the Single Property page: Navy / Gold / White,
 * soft shadows, rounded corners, premium hover motion.
 *
 * .roblie-property-grid is used on BOTH:
 *   - the [property_archive] shortcode (a <div> grid)
 *   - native Shop/Category/Search archives (a <ul class="products"> grid, via the Code Snippet's
 *     woocommerce_product_loop_start/end filters)
 * so the same ruleset below (with list-style/margin/padding reset baked in) works for either element.
 * ============================================================================================================= */

:root {
	--roblie-navy: #0E2238;
	--roblie-gold: #C8A15A;
	--roblie-white: #FFFFFF;
	--roblie-bg: #F8F8F8;
	--roblie-border: #E5E5E5;
	--roblie-text: #1F1F1F;
	--roblie-text-secondary: #666666;
	--roblie-wishlist-active: #D4AF37; /* brand gold — overrides YITH's default green "saved" state */

	--roblie-radius: 14px;
	--roblie-shadow: 0 6px 24px rgba(14, 34, 56, 0.08);
	--roblie-shadow-hover: 0 16px 40px rgba(14, 34, 56, 0.16);
	--roblie-transition: 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* -------------------------------------------------------------------------------------------------------------
 * Layout: wrapper + optional filter sidebar
 * ---------------------------------------------------------------------------------------------------------- */
.roblie-archive-wrapper {
	display: flex;
	align-items: flex-start;
	gap: 36px;
	max-width: 1600px; /* widened from 1320px so desktop cards get noticeably more room to breathe */
	margin: 0 auto;
	padding: 32px 24px 70px;
	font-family: inherit;
	color: var(--roblie-text);
}

.roblie-archive-results {
	flex: 1;
	min-width: 0;
}

.roblie-no-results {
	padding: 60px 20px;
	text-align: center;
	color: var(--roblie-text-secondary);
	background: var(--roblie-bg);
	border-radius: var(--roblie-radius);
	grid-column: 1 / -1;
}

/* -------------------------------------------------------------------------------------------------------------
 * Grid — Desktop max 3 columns / Tablet 2 / Mobile 1 (unchanged). Works for both <div> (shortcode) and
 * <ul class="products"> (native). Desktop gap widened for a less cramped, more premium feel; tablet and
 * mobile breakpoints are untouched from the working implementation.
 * ---------------------------------------------------------------------------------------------------------- */
.roblie-property-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 40px 32px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.roblie-property-grid.roblie-columns-2 { grid-template-columns: repeat(2, 1fr); }
.roblie-property-grid.roblie-columns-4 { grid-template-columns: repeat(3, 1fr); } /* capped at 3/row on desktop even if columns="4" is set */

@media (max-width: 1024px) {
	.roblie-property-grid,
	.roblie-property-grid.roblie-columns-4 {
		grid-template-columns: repeat(2, 1fr);
		gap: 28px 20px;
	}
	.roblie-archive-wrapper {
		gap: 20px;
	}
}

@media (max-width: 640px) {
	.roblie-property-grid,
	.roblie-property-grid.roblie-columns-2,
	.roblie-property-grid.roblie-columns-4 {
		grid-template-columns: 1fr;
	}
	.roblie-archive-wrapper {
		flex-direction: column;
	}
}

/* Native archives render each card inside a WooCommerce <li class="product">. Neutralize WoodMart's default
   float/width-based loop styles so the <li> behaves as a plain grid cell — our .roblie-property-card inside
   it provides all the actual visual styling. */
ul.roblie-property-grid > li.product {
	list-style: none;
	margin: 0 !important;
	padding: 0 !important;
	width: auto !important;
	float: none !important;
	clear: none !important;
}

/* -------------------------------------------------------------------------------------------------------------
 * Property Card
 * ---------------------------------------------------------------------------------------------------------- */
.roblie-property-card {
	background: var(--roblie-white);
	border: 1px solid var(--roblie-border);
	border-radius: var(--roblie-radius);
	overflow: hidden;
	box-shadow: var(--roblie-shadow);
	transition: box-shadow var(--roblie-transition), transform var(--roblie-transition);
	display: flex;
	flex-direction: column;
}

.roblie-property-card:hover {
	box-shadow: var(--roblie-shadow-hover);
	transform: translateY(-4px);
}

.roblie-card-media {
	position: relative;
	overflow: hidden;
	aspect-ratio: 4 / 3;
	background: var(--roblie-bg);
}

.roblie-card-media-link { display: block; height: 100%; }

.roblie-card-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.6s ease;
}

.roblie-property-card:hover .roblie-card-img {
	transform: scale(1.08);
}

/* Badges */
.roblie-card-badges {
	position: absolute;
	top: 14px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	z-index: 2;
}
.roblie-badges-left  { left: 14px; }
.roblie-badges-right { right: 14px; align-items: flex-end; }

.roblie-badge {
	display: inline-block;
	font-size: 11px;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	font-weight: 600;
	padding: 6px 12px;
	border-radius: 999px;
	white-space: nowrap;
}

.roblie-badge-purpose {
	background: var(--roblie-navy);
	color: var(--roblie-white);
}

.roblie-badge-status,
.roblie-badge-featured {
	background: var(--roblie-gold);
	color: var(--roblie-navy);
}

/* -------------------------------------------------------------------------------------------------------------
 * Wishlist (YITH WooCommerce Wishlist, rendered by the site's existing rat_render_wishlist_button() helper)
 * These selectors are intentionally generic (targeting the container's direct children, plus any icon
 * element inside) rather than hard-coded YITH class names, so the button renders as a correctly centered
 * white circle regardless of exact YITH markup/version — no functionality is touched, only presentation.
 * ---------------------------------------------------------------------------------------------------------- */
.roblie-card-wishlist {
	position: absolute;
	bottom: 14px;
	right: 14px;
	z-index: 3;
	width: 40px;
	height: 40px;
}

/* The white circular button itself — forced onto whatever YITH's outermost wrapper element is, and also
   onto the plain guest login link (.roblie-wishlist-guest-link) so both states look identical */
.roblie-card-wishlist > *,
.roblie-card-wishlist > a.roblie-wishlist-guest-link {
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	width: 40px !important;
	height: 40px !important;
	margin: 0 !important;
	padding: 0 !important;
	border-radius: 50% !important;
	background: var(--roblie-white) !important;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
	overflow: hidden !important;
	transition: transform var(--roblie-transition);
}

/* The clickable link — filled and centered inside the circle; font-size:0 collapses any raw text label
   ("Add to wishlist" / "Browse Wishlist") YITH may render, leaving only the icon visible, matching the
   icon-only heart used everywhere else in this system. */
.roblie-card-wishlist a {
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	width: 100% !important;
	height: 100% !important;
	color: var(--roblie-navy) !important;
	text-decoration: none !important;
	font-size: 0 !important;
	line-height: 1 !important;
	transition: color var(--roblie-transition);
}

.roblie-card-wishlist:hover > * {
	transform: scale(1.08);
}

/* The heart glyph itself, whatever form YITH renders it in (SVG, icon font <i>, dashicon) */
.roblie-card-wishlist svg,
.roblie-card-wishlist i {
	width: 16px !important;
	height: 16px !important;
	font-size: 16px !important;
	line-height: 1 !important;
	fill: currentColor !important;
	color: currentColor !important;
}

/* Saved / active state — brand gold (#D4AF37 via --roblie-wishlist-active), never YITH's default green.
   Covers the common class patterns YITH uses across versions for "already in wishlist". */
.roblie-card-wishlist .exists a,
.roblie-card-wishlist a.exists,
.roblie-card-wishlist a[class*="added"],
.roblie-card-wishlist .yith-wcwl-wishlistexistsbrowse a,
.roblie-card-wishlist .fa-heart,
.roblie-card-wishlist .icon-heart {
	color: var(--roblie-wishlist-active) !important;
	fill: var(--roblie-wishlist-active) !important;
}

/* Card body — padding and type scale increased slightly to match the wider card, avoiding a cramped look */
.roblie-card-body {
	padding: 26px 26px 28px;
	display: flex;
	flex-direction: column;
	flex: 1;
}

.roblie-card-category {
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--roblie-gold);
	font-weight: 600;
	margin-bottom: 8px;
}

.roblie-card-location {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 12px;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--roblie-text-secondary);
	margin-bottom: 10px;
}

.roblie-icon-pin { flex-shrink: 0; color: var(--roblie-gold); }

.roblie-card-title {
	margin: 0 0 12px;
	font-size: 21px;
	line-height: 1.35;
	font-weight: 600;
}

.roblie-card-title a {
	color: var(--roblie-navy);
	text-decoration: none;
	transition: color var(--roblie-transition);
}

.roblie-card-title a:hover {
	color: var(--roblie-gold);
}

.roblie-card-price {
	font-size: 22px;
	font-weight: 700;
	color: var(--roblie-navy);
	margin-bottom: 16px;
}

.roblie-card-divider {
	height: 1px;
	background: var(--roblie-border);
	margin-bottom: 16px;
}

.roblie-card-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 12px 20px;
	font-size: 13px;
	color: var(--roblie-text-secondary);
	margin-bottom: 20px;
}

.roblie-meta-item { display: inline-flex; align-items: center; }

.roblie-card-btn {
	margin-top: auto;
	display: inline-block;
	text-align: center;
	padding: 14px 20px;
	border: 1.5px solid var(--roblie-navy);
	border-radius: 999px;
	color: var(--roblie-navy);
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	text-decoration: none;
	transition: background var(--roblie-transition), color var(--roblie-transition), border-color var(--roblie-transition);
}

.roblie-card-btn:hover {
	background: var(--roblie-navy);
	color: var(--roblie-white);
}

/* -------------------------------------------------------------------------------------------------------------
 * Filter Sidebar
 * ---------------------------------------------------------------------------------------------------------- */
.roblie-filter-sidebar {
	width: 280px;
	flex-shrink: 0;
	background: var(--roblie-white);
	border: 1px solid var(--roblie-border);
	border-radius: var(--roblie-radius);
	padding: 22px;
	position: sticky;
	top: 24px;
}

.roblie-filter-mobile-toggle {
	display: none;
	align-items: center;
	gap: 8px;
	width: 100%;
	padding: 12px 16px;
	background: var(--roblie-navy);
	color: var(--roblie-white);
	border: none;
	border-radius: 10px;
	font-weight: 600;
	font-size: 14px;
	cursor: pointer;
	margin-bottom: 4px;
}

.roblie-filter-group {
	margin-bottom: 18px;
}

.roblie-filter-group label {
	display: block;
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--roblie-navy);
	margin-bottom: 8px;
}

.roblie-filter-group select,
.roblie-filter-group input[type="text"],
.roblie-filter-group input[type="number"] {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid var(--roblie-border);
	border-radius: 8px;
	background: var(--roblie-bg);
	color: var(--roblie-text);
	font-size: 14px;
}

.roblie-filter-group select:focus,
.roblie-filter-group input:focus {
	outline: none;
	border-color: var(--roblie-gold);
}

.roblie-range-inputs {
	display: flex;
	gap: 10px;
}

.roblie-filter-actions {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-top: 22px;
}

.roblie-btn-apply {
	background: var(--roblie-gold);
	color: var(--roblie-navy);
	border: none;
	padding: 12px;
	border-radius: 999px;
	font-weight: 700;
	font-size: 14px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	cursor: pointer;
	transition: filter var(--roblie-transition);
}

.roblie-btn-apply:hover { filter: brightness(0.95); }

.roblie-btn-reset {
	text-align: center;
	font-size: 13px;
	color: var(--roblie-text-secondary);
	text-decoration: underline;
}

@media (max-width: 900px) {
	.roblie-filter-mobile-toggle { display: flex; }

	.roblie-filter-sidebar {
		width: 100%;
		position: static;
	}

	.roblie-filter-form {
		display: none;
	}

	.roblie-filter-sidebar.roblie-filters-open .roblie-filter-form {
		display: block;
		margin-top: 16px;
	}
}

/* -------------------------------------------------------------------------------------------------------------
 * Pagination / Load More
 * Shortcode instances use .roblie-pagination / .roblie-load-more-btn.
 * Native archive pages use WooCommerce's own .woocommerce-pagination — styled to match.
 * ---------------------------------------------------------------------------------------------------------- */
.roblie-load-more-wrap {
	text-align: center;
	margin-top: 36px;
}

.roblie-load-more-btn {
	background: var(--roblie-navy);
	color: var(--roblie-white);
	border: none;
	padding: 14px 36px;
	border-radius: 999px;
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	cursor: pointer;
	transition: background var(--roblie-transition);
}

.roblie-load-more-btn:hover { background: var(--roblie-gold); color: var(--roblie-navy); }
.roblie-load-more-btn[disabled] { opacity: 0.6; cursor: default; }

.roblie-pagination,
.woocommerce-pagination {
	display: flex;
	justify-content: center;
	gap: 8px;
	margin-top: 36px;
}

.roblie-pagination .page-numbers,
.woocommerce-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	border-radius: 50%;
	border: 1px solid var(--roblie-border);
	color: var(--roblie-navy);
	text-decoration: none;
	font-size: 14px;
}

.roblie-pagination .page-numbers.current,
.woocommerce-pagination .page-numbers.current {
	background: var(--roblie-navy);
	color: var(--roblie-white);
	border-color: var(--roblie-navy);
}