/**
 * Property Archive & Portal Search Stylesheet.
 *
 * Integrates strictly with Customizer Theme Colors (--kka-color-primary, --kka-color-secondary).
 * Supports Option 2: 1-Column Compact Horizontal Cards Split Map View & Floating Action Controls.
 *
 * @package KhaiKengAsset
 */

/* Sticky Filters Navigation Header */
.kka-archive-filters-sticky {
	position: sticky;
	top: 0;
	z-index: 40;
	background-color: #ffffff;
	border-bottom: 1.5px solid #e2e8f0;
	box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.05);
}

/* Mode Switcher Tabs */
.kka-mode-tab-btn {
	padding: 0.5rem 1.25rem;
	font-size: 0.875rem;
	font-weight: 600;
	border-radius: 9999px;
	transition: all 0.2s ease;
	color: #475569;
	background-color: #ffffff;
	border: 1.5px solid #cbd5e1;
}
.kka-mode-tab-btn:hover {
	color: var(--kka-color-primary, #b38b4d);
	border-color: var(--kka-color-primary, #b38b4d);
	background-color: #fffdfa;
}
.kka-mode-tab-btn.active {
	color: #ffffff !important;
	background-color: var(--kka-color-primary, #b38b4d) !important;
	border-color: var(--kka-color-primary, #b38b4d) !important;
	box-shadow: 0 2px 8px rgba(179, 139, 77, 0.3);
}

/* View Switcher Toggle Buttons (Grid vs Split Map) */
.kka-view-toggle-btn {
	padding: 0.5rem 0.75rem;
	font-size: 0.875rem;
	border-radius: 0.5rem;
	color: #64748b;
	background: transparent;
	transition: all 0.2s ease;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: none;
	cursor: pointer;
}
.kka-view-toggle-btn:hover {
	color: var(--kka-color-primary, #b38b4d);
}
.kka-view-toggle-btn.active {
	background-color: #ffffff;
	color: var(--kka-color-secondary, #3a241b);
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Card Flexbox Height Alignment (Forces bottom area to align perfectly across all cards) */
.kka-property-card {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	height: 100%;
}
.kka-card-details {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	flex: 1 1 0%;
}

/* Option 2: 1-Column Compact Horizontal Cards in Split View (PropertyGuru / Realtor Style) */
.kka-view-split #kka_cards_grid,
.kka-view-split #kka_property_grid_container > div {
	grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
}

.kka-view-split .kka-property-card {
	display: flex !important;
	flex-direction: row !important;
	align-items: stretch !important;
	min-height: 190px !important;
	border-radius: 0.875rem !important;
	transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease !important;
}

.kka-view-split .kka-property-card.highlighted {
	border-color: var(--kka-color-primary, #b38b4d) !important;
	box-shadow: 0 8px 20px rgba(179, 139, 77, 0.25) !important;
	transform: translateY(-2px) !important;
}

.kka-view-split .kka-card-image-wrap {
	width: 42% !important;
	min-width: 140px !important;
	max-width: 200px !important;
	aspect-ratio: auto !important;
	height: 100% !important;
	flex-shrink: 0 !important;
}

.kka-view-split .kka-card-details {
	width: 58% !important;
	padding: 0.875rem !important;
	display: flex !important;
	flex-direction: column !important;
	justify-content: space-between !important;
	gap: 0.375rem !important;
}

.kka-view-split .kka-card-details h3 {
	font-size: 0.9375rem !important;
	line-height: 1.3 !important;
}

.kka-view-split .kka-card-details p.line-clamp-2 {
	display: none !important; /* Hide long excerpt in split mode to keep card height compact */
}

/* Floating Map Action Toolbar (Locate Me, Fit Pins, Satellite) */
.kka-map-floating-controls {
	position: absolute;
	top: 3.5rem;
	left: 0.75rem;
	z-index: 20;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.kka-map-action-btn {
	width: 2.75rem;
	height: 2.75rem;
	border-radius: 0.75rem;
	background-color: #ffffff;
	color: var(--kka-color-secondary, #3a241b);
	border: 1.5px solid #cbd5e1;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 1.125rem;
	cursor: pointer;
	transition: all 0.2s ease;
}
.kka-map-action-btn:hover,
.kka-map-action-btn.active {
	background-color: var(--kka-color-primary, #b38b4d);
	color: #ffffff;
	border-color: var(--kka-color-primary, #b38b4d);
	transform: scale(1.05);
	box-shadow: 0 6px 16px rgba(179, 139, 77, 0.3);
}

/* POI Filter Buttons */
.kka-poi-btn {
	display: inline-flex;
	align-items: center;
	gap: 0.375rem;
	padding: 0.25rem 0.625rem;
	font-size: 0.75rem;
	font-weight: 600;
	border-radius: 9999px;
	background-color: #f8fafc;
	color: #475569;
	border: 1px solid #cbd5e1;
	transition: all 0.2s ease;
	cursor: pointer;
}
.kka-poi-btn:hover,
.kka-poi-btn.active {
	background-color: #fffdfa;
	color: var(--kka-color-primary, #b38b4d);
	border-color: var(--kka-color-primary, #b38b4d);
}

/* Visual Property Type Cards/Chips Bar */
.kka-property-type-scroll-bar {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	overflow-x: auto;
	padding-bottom: 0.5rem;
	scrollbar-width: thin;
	scrollbar-color: var(--kka-color-primary, #b38b4d) transparent;
}
.kka-type-chip-btn {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 0.75rem 1rem;
	min-width: 100px;
	border-radius: 0.75rem;
	border: 1.5px solid #cbd5e1;
	background-color: #ffffff;
	color: #475569;
	transition: all 0.2s ease;
	cursor: pointer;
	user-select: none;
}
.kka-type-chip-btn:hover {
	border-color: var(--kka-color-primary, #b38b4d);
	color: var(--kka-color-primary, #b38b4d);
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(179, 139, 77, 0.15);
}
.kka-type-chip-btn.active {
	border-color: var(--kka-color-primary, #b38b4d);
	background-color: #fffdfa;
	color: var(--kka-color-secondary, #3a241b);
	box-shadow: 0 4px 14px rgba(179, 139, 77, 0.2);
}
.kka-type-chip-btn i.huge {
	font-size: 1.5rem;
	line-height: 1;
	margin-bottom: 0.375rem;
	color: #64748b;
	transition: color 0.2s ease;
}
.kka-type-chip-btn:hover i.huge,
.kka-type-chip-btn.active i.huge {
	color: var(--kka-color-primary, #b38b4d);
}

/* Custom Inputs & Select Controls (Customizer Colors) */
#kka_smart_search_input {
	border: 1.5px solid #cbd5e1 !important;
	border-radius: 0.75rem !important;
	padding: 0.625rem 1rem !important;
	font-size: 0.875rem !important;
	color: var(--kka-color-secondary, #3a241b) !important;
	background-color: #ffffff !important;
	transition: all 0.2s ease !important;
}
#kka_smart_search_input:focus,
#kka_smart_search_input:hover {
	border-color: var(--kka-color-primary, #b38b4d) !important;
	outline: none !important;
	box-shadow: 0 0 0 3px rgba(179, 139, 77, 0.15) !important;
}

.kka-ajax-filter-input,
.kka-select-input {
	border: 1.5px solid #cbd5e1 !important;
	border-radius: 0.75rem !important;
	padding: 0.625rem 2.25rem 0.625rem 1rem !important;
	font-size: 0.875rem !important;
	font-weight: 600 !important;
	color: var(--kka-color-secondary, #3a241b) !important;
	background-color: #ffffff !important;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23a38344' stroke-width='2.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E") !important;
	background-repeat: no-repeat !important;
	background-position: right 0.75rem center !important;
	background-size: 1rem 1rem !important;
	appearance: none !important;
	-webkit-appearance: none !important;
	cursor: pointer !important;
	transition: all 0.2s ease !important;
}
.kka-ajax-filter-input:hover,
.kka-ajax-filter-input:focus,
.kka-select-input:hover,
.kka-select-input:focus {
	border-color: var(--kka-color-primary, #b38b4d) !important;
	outline: none !important;
	box-shadow: 0 0 0 3px rgba(179, 139, 77, 0.15) !important;
}

/* More Filters Drawer Trigger Button */
#kka_open_drawer {
	border: 1.5px solid #cbd5e1 !important;
	border-radius: 0.75rem !important;
	padding: 0.625rem 1rem !important;
	font-size: 0.875rem !important;
	font-weight: 600 !important;
	color: var(--kka-color-secondary, #3a241b) !important;
	background-color: #ffffff !important;
	transition: all 0.2s ease !important;
}
#kka_open_drawer svg {
	color: var(--kka-color-primary, #b38b4d) !important;
	transition: transform 0.2s ease;
}
#kka_open_drawer:hover {
	border-color: var(--kka-color-primary, #b38b4d) !important;
	color: var(--kka-color-primary, #b38b4d) !important;
	background-color: #fffdfa !important;
	box-shadow: 0 2px 8px rgba(179, 139, 77, 0.15) !important;
}

/* Primary Search & Action Buttons */
.kka-btn-primary {
	background-color: var(--kka-color-primary, #b38b4d) !important;
	color: #ffffff !important;
	border-radius: 0.75rem !important;
	font-weight: 700 !important;
	box-shadow: 0 4px 12px rgba(179, 139, 77, 0.25) !important;
	transition: all 0.2s ease !important;
}
.kka-btn-primary:hover {
	background-color: var(--kka-color-primary-hover, #926f3b) !important;
	transform: translateY(-1px) !important;
	box-shadow: 0 6px 16px rgba(179, 139, 77, 0.35) !important;
}

/* Smart Autocomplete Popup */
.kka-autocomplete-wrapper {
	position: relative;
}
.kka-autocomplete-popup {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	margin-top: 0.375rem;
	background-color: #ffffff;
	border: 1.5px solid var(--kka-color-primary, #b38b4d);
	border-radius: 0.75rem;
	box-shadow: 0 10px 25px -5px rgba(179, 139, 77, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
	z-index: 50;
	max-height: 24rem;
	overflow-y: auto;
}
.kka-ac-section-title {
	padding: 0.5rem 0.875rem 0.25rem;
	font-size: 0.75rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--kka-color-primary, #b38b4d);
	background-color: #fffdfa;
}
.kka-ac-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0.625rem 0.875rem;
	font-size: 0.875rem;
	color: #334155;
	cursor: pointer;
	transition: background-color 0.15s ease;
}
.kka-ac-item:hover,
.kka-ac-item.highlighted {
	background-color: #fffdfa;
	color: var(--kka-color-primary, #b38b4d);
}
.kka-ac-item-badge {
	font-size: 0.75rem;
	font-weight: 600;
	padding: 0.125rem 0.5rem;
	border-radius: 9999px;
	background-color: #fef3c7;
	color: var(--kka-color-secondary, #3a241b);
}

/* Custom Price Badge Markers on Google Maps & Leaflet */
.kka-map-price-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.375rem 0.75rem;
	font-size: 0.8125rem;
	font-weight: 800;
	color: #ffffff;
	background-color: var(--kka-color-secondary, #3a241b);
	border: 2px solid var(--kka-color-primary, #b38b4d);
	border-radius: 9999px;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
	cursor: pointer;
	white-space: nowrap;
	transition: transform 0.2s ease, background-color 0.2s ease;
	user-select: none;
}
.kka-map-price-badge:hover,
.kka-map-price-badge.active {
	background-color: var(--kka-color-primary, #b38b4d);
	color: #ffffff;
	transform: scale(1.1);
	z-index: 100;
}

/* InfoWindow Popup Styling */
.kka-map-infowindow {
	width: 16rem;
	background: #ffffff;
	border-radius: 0.75rem;
	overflow: hidden;
}
.kka-map-infowindow img {
	width: 100%;
	height: 8.5rem;
	object-fit: cover;
}
.kka-map-infowindow-body {
	padding: 0.75rem;
}
.kka-map-infowindow-price {
	font-size: 1rem;
	font-weight: 800;
	color: var(--kka-color-primary, #b38b4d);
}
.kka-map-infowindow-title {
	font-size: 0.875rem;
	font-weight: 700;
	color: #0f172a;
	margin-top: 0.25rem;
	line-height: 1.25;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* Leaflet Container Compatibility */
.leaflet-popup-content-wrapper {
	padding: 0 !important;
	border-radius: 0.75rem !important;
	overflow: hidden;
}
.leaflet-popup-content {
	margin: 0 !important;
	width: 16rem !important;
}

/* Slide-Over Advanced Filter Drawer */
.kka-filter-drawer-backdrop {
	position: fixed;
	inset: 0;
	background-color: rgba(15, 23, 42, 0.5);
	backdrop-filter: blur(4px);
	z-index: 50;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.3s ease;
}
.kka-filter-drawer-backdrop.open {
	opacity: 1;
	pointer-events: auto;
}
.kka-filter-drawer {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	width: 100%;
	max-width: 28rem;
	background-color: #ffffff;
	z-index: 51;
	transform: translateX(100%);
	transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
	box-shadow: -10px 0 25px rgba(0, 0, 0, 0.15);
	display: flex;
	flex-direction: column;
}
.kka-filter-drawer.open {
	transform: translateX(0);
}
.kka-drawer-header {
	padding: 1.25rem 1.5rem;
	border-bottom: 1.5px solid #e2e8f0;
	display: flex;
	align-items: center;
	justify-content: space-between;
}
.kka-drawer-body {
	padding: 1.5rem;
	overflow-y: auto;
	flex: 1;
}
.kka-drawer-footer {
	padding: 1rem 1.5rem;
	border-top: 1.5px solid #e2e8f0;
	background-color: #f8fafc;
	display: flex;
	gap: 0.75rem;
}

/* Active Filter Chips Badges */
.kka-chip {
	display: inline-flex !important;
	align-items: center !important;
	gap: 0.5rem !important;
	padding: 0.375rem 0.875rem !important;
	border-radius: 9999px !important;
	font-size: 0.8125rem !important;
	font-weight: 600 !important;
	background-color: #fffdfa !important;
	color: var(--kka-color-secondary, #3a241b) !important;
	border: 1.5px solid var(--kka-color-primary, #b38b4d) !important;
	box-shadow: 0 1px 3px rgba(179, 139, 77, 0.12) !important;
	transition: all 0.2s ease !important;
}
.kka-chip:hover {
	box-shadow: 0 2px 6px rgba(179, 139, 77, 0.22) !important;
}
.kka-chip-remove {
	cursor: pointer !important;
	border-radius: 9999px !important;
	padding: 0.125rem 0.375rem !important;
	color: var(--kka-color-primary, #b38b4d) !important;
	font-weight: 700 !important;
	transition: all 0.15s ease !important;
}
.kka-chip-remove:hover {
	background-color: var(--kka-color-primary, #b38b4d) !important;
	color: #ffffff !important;
}

/* Compare Drawer & Modal */
.kka-compare-floating-bar {
	position: fixed;
	bottom: 1.5rem;
	left: 50%;
	transform: translateX(-50%) translateY(120%);
	z-index: 45;
	background-color: var(--kka-color-secondary, #3a241b);
	color: #ffffff;
	padding: 0.75rem 1.25rem;
	border-radius: 9999px;
	box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
	display: flex;
	align-items: center;
	gap: 1rem;
	transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.kka-compare-floating-bar.active {
	transform: translateX(-50%) translateY(0);
}

/* Skeleton Loader */
.kka-skeleton-card {
	background-color: #ffffff;
	border-radius: 0.75rem;
	border: 1px solid #e2e8f0;
	overflow: hidden;
}
.kka-skeleton-img {
	height: 14rem;
	background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
	background-size: 200% 100%;
	animation: kka-skeleton-pulse 1.5s infinite;
}
.kka-skeleton-text {
	height: 1.25rem;
	background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
	background-size: 200% 100%;
	animation: kka-skeleton-pulse 1.5s infinite;
	border-radius: 0.25rem;
}
@keyframes kka-skeleton-pulse {
	0% { background-position: 200% 0; }
	100% { background-position: -200% 0; }
}

/* Quick Lifestyle & Feature Chips Bar (Minimal Luxury App Style) */
.kka-lifestyle-chip-btn {
	display: inline-flex !important;
	align-items: center !important;
	gap: 6px !important;
	padding: 6px 14px !important;
	border-radius: 9999px !important;
	font-size: 12px !important;
	font-weight: 600 !important;
	color: #475569 !important;
	background-color: #ffffff !important;
	border: 1px solid #cbd5e1 !important;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03) !important;
	transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
	cursor: pointer !important;
	user-select: none !important;
	white-space: nowrap !important;
	flex-shrink: 0 !important;
}

.kka-lifestyle-chip-btn:hover {
	color: var(--kka-color-secondary, #3a241b) !important;
	border-color: var(--kka-color-primary, #b38b4d) !important;
	background-color: #fffdfa !important;
	transform: translateY(-1px);
	box-shadow: 0 3px 6px -1px rgba(0, 0, 0, 0.08) !important;
}

.kka-lifestyle-chip-btn.active,
.kka-lifestyle-chip-btn:has(input:checked) {
	color: #ffffff !important;
	background-color: var(--kka-color-secondary, #3a241b) !important;
	border-color: var(--kka-color-secondary, #3a241b) !important;
	font-weight: 700 !important;
	box-shadow: 0 4px 10px rgba(58, 36, 27, 0.25) !important;
}

.kka-lifestyle-chip-btn.active .kka-chip-icon,
.kka-lifestyle-chip-btn:has(input:checked) .kka-chip-icon {
	transform: scale(1.15);
}

.kka-chip-icon {
	font-size: 13px;
	line-height: 1;
	transition: transform 0.2s ease;
}

/* Clean Luxury Drawer Checkbox Controls */
.kka-filter-drawer input[type="checkbox"] {
	appearance: none !important;
	-webkit-appearance: none !important;
	width: 1.125rem !important;
	height: 1.125rem !important;
	border-radius: 0.25rem !important;
	border: 1.5px solid #cbd5e1 !important;
	background-color: #ffffff !important;
	cursor: pointer !important;
	position: relative !important;
	display: inline-block !important;
	flex-shrink: 0 !important;
	transition: all 0.15s ease !important;
	margin: 0 !important;
}

.kka-filter-drawer input[type="checkbox"]:hover {
	border-color: var(--kka-color-primary, #b38b4d) !important;
	background-color: #fffdfa !important;
}

.kka-filter-drawer input[type="checkbox"]:checked {
	background-color: var(--kka-color-secondary, #3a241b) !important;
	border-color: var(--kka-color-secondary, #3a241b) !important;
}

.kka-filter-drawer input[type="checkbox"]:checked::after {
	content: "" !important;
	position: absolute !important;
	left: 5px !important;
	top: 1.5px !important;
	width: 5px !important;
	height: 9px !important;
	border: solid #ffffff !important;
	border-width: 0 2px 2px 0 !important;
	transform: rotate(45deg) !important;
}
