/**
 * Property Search Widget Styles
 *
 * Reusable styles for property search form widget
 * Used by both Elementor widget and shortcode
 *
 * @package SIR_Theme
 */

/* Search Section */
.property-search-widget.search-section {
	background-color: white;
	padding: 2rem 0;
	color: #333;
}

.property-search-widget .search-wrapper {
	margin: 0 auto;
	padding: 0 2rem;
}

.property-search-widget .search-prompt {
	margin-bottom: 1.5rem;
}

.property-search-widget .prompt-label {
	font-size: 1.1rem;
	font-weight: 300;
	color: #333;
}

.property-search-widget .prompt-highlight {
	font-size: 1.1rem;
	font-weight: 600;
	margin-left: 0.3rem;
	color: #0a2540;
}

.property-search-widget .search-controls {
	display: flex;
	gap: 0.5rem;
	align-items: flex-end;
	flex-wrap: wrap;
}

@media (min-width: 1200px) {
	.property-search-widget .search-controls {
		flex-wrap: nowrap;
	}

	/* Tighten select internals so long labels fit and overall row stays compact */
	.property-search-widget .search-control select {
		padding: 1rem 0.5rem;
		letter-spacing: 0;
		font-size: 0.9rem;
		min-width: 0;
	}

	.property-search-widget .property-type-dropdown {
		width: 13rem;
		flex: 0 0 13rem;
	}

	.property-search-widget .property-type-dropdown select {
		width: 100%;
		max-width: 100%;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}

	/* Prevent labels from overflowing into neighbour controls when compressed */
	.property-search-widget .search-control label,
	.property-search-widget .search-input-wrapper label,
	.property-search-widget .search-price-label {
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}

	/* Let the search input absorb extra space and shrink when needed */
	.property-search-widget .search-input-wrapper {
		flex: 1 1 0;
		min-width: 0;
	}

	.property-search-widget .search-input-wrapper input {
		min-width: 0;
		width: 100%;
	}

	/* Currency selector — tighter */
	.property-search-widget .currency-selector select {
		min-width: 80px;
		padding: 1rem 0.4rem;
	}

	/* Compress buttons so everything fits down to ~1200px viewport */
	.property-search-widget .search-submit-btn {
		padding: 0.75rem 1.25rem;
	}

	.property-search-widget .toggle-btn {
		padding: 0.75rem 0.9rem;
		font-size: 0.8rem;
		letter-spacing: 0.3px;
	}
}

.property-search-widget .search-control,
.property-search-widget .search-input-wrapper {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.property-search-widget .search-control label,
.property-search-widget .search-input-wrapper label {
	display: block;
	color: #696969;
	font-size: 0.7rem;
	font-weight: 600;
	letter-spacing: 1px;
}

/* Modern Select Styles */
.property-search-widget .search-control select {
	height: 50px;
}

.property-search-widget .search-control select,
.property-search-widget ::picker(select) {
	appearance: base-select;
}

.property-search-widget .search-control select {
	border: 0;
	flex: 1;
	border-radius: 0;
	background-color: white;
	color: #010202;
	font-size: 1.05rem;
	font-weight: 700;
	letter-spacing: 2px;
	line-height: 1;
	padding: 1rem;
	text-transform: uppercase;
	transition: 0.4s;
	width: 100%;
	min-width: 150px;
	cursor: pointer;
}

.property-search-widget .search-control select::picker-icon {
	color: #002349;
	transition: 0.4s rotate;
	content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1em' height='1em' viewBox='0 0 24 24'%3E%3Cpath fill='currentColor' d='M11 14.2V6q0-.425.288-.712T12 5t.713.288T13 6v8.2l2.9-2.9q.275-.275.7-.275t.7.275t.275.7t-.275.7l-4.6 4.6q-.3.3-.7.3t-.7-.3l-4.6-4.6q-.275-.275-.275-.7t.275-.7t.7-.275t.7.275z'/%3E%3C/svg%3E");
}

.property-search-widget .search-control select:open::picker-icon {
	rotate: 180deg;
}

.property-search-widget ::picker(select) {
	border: none;
	border-radius: 0.25rem;
	box-shadow: 0 2px 1rem rgba(0, 0, 0, 0.125);
}

.property-search-widget .search-control select option {
	padding: 0.5rem;
	font-size: 1rem;
	font-weight: 400;
	letter-spacing: normal;
	text-transform: none;
}

.property-search-widget .search-control select option:checked {
	font-weight: bold;
	background: #EEE;
}

.property-search-widget .search-control select option::checkmark {
	order: 1;
	margin-left: auto;
	content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1em' height='1em' viewBox='0 0 24 24'%3E%3Cpath fill='currentColor' d='m10.6 13.8l-2.15-2.15q-.275-.275-.7-.275t-.7.275t-.275.7t.275.7L9.9 15.9q.3.3.7.3t.7-.3l5.65-5.65q.275-.275.275-.7t-.275-.7t-.7-.275t-.7.275zM12 22q-2.075 0-3.9-.788t-3.175-2.137T2.788 15.9T2 12t.788-3.9t2.137-3.175T8.1 2.788T12 2t3.9.788t3.175 2.137T21.213 8.1T22 12t-.788 3.9t-2.137 3.175t-3.175 2.138T12 22m0-2q3.35 0 5.675-2.325T20 12t-2.325-5.675T12 4T6.325 6.325T4 12t2.325 5.675T12 20m0-8'/%3E%3C/svg%3E");
}

.property-search-widget .search-input-wrapper input {
	background-color: white;
	border: 1px solid #ddd;
	color: #333;
	padding: 0.75rem 1rem;
	font-size: 0.85rem;
	border-radius: 0;
	min-width: 300px;
	letter-spacing: 0.5px;
	height: 50px;
}

.property-search-widget .search-input-wrapper input::placeholder {
	color: #999;
	letter-spacing: 0.5px;
}

/* Currency and Price Range Group */
.property-search-widget .currency-price-group {
	display: flex;
	gap: 1rem;
	align-items: flex-end;
	flex-direction: row;
}

.property-search-widget .currency-selector {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.property-search-widget .currency-selector label {
	display: block;
	color: #696969;
	font-size: 0.7rem;
	font-weight: 600;
	letter-spacing: 1px;
}

.property-search-widget .currency-selector select {
	min-width: 100px;
	cursor: pointer;
	height: 50px;
}

.property-search-widget .price-range-inputs {
	display: flex;
	gap: 0.75rem;
	align-items: flex-end;
}

.property-search-widget .price-input-group {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.property-search-widget .price-input-group label {
	font-size: 0.85rem;
	text-transform: uppercase;
	font-weight: 300;
	letter-spacing: 0.5px;
}

.property-search-widget .price-input-group input {
	background-color: transparent;
	border: 1px solid rgba(255, 255, 255, 0.3);
	padding: 0.75rem 1rem;
	font-size: 0.85rem;
	border-radius: 0;
	min-width: 140px;
	letter-spacing: 0.5px;
}

.property-search-widget .price-input-group input::placeholder {
	color: rgba(255, 255, 255, 0.5);
	letter-spacing: 0.5px;
}

/* Remove number input arrows */
.property-search-widget .price-input-group input[type="number"]::-webkit-inner-spin-button,
.property-search-widget .price-input-group input[type="number"]::-webkit-outer-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.property-search-widget .price-input-group input[type="number"] {
	-moz-appearance: textfield;
}

/* Buy/Rent Toggle */
.property-search-widget .buy-rent-toggle {
	display: flex;
	gap: 0;
	margin-left: auto;
	flex-direction: row;
}

.property-search-widget .toggle-btn {
	background-color: white;
	border: 1px solid #ddd;
	color: #333;
	padding: 0.75rem 1.5rem;
	font-size: 0.9rem;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.3s, color 0.3s;
	letter-spacing: 0.5px;
	border-radius: 4px;
}

.property-search-widget .toggle-btn:first-child {
	border-right: none;
	border-top-right-radius: 0;
	border-bottom-right-radius: 0;
}

.property-search-widget .toggle-btn:last-child {
	border-top-left-radius: 0;
	border-bottom-left-radius: 0;
}

.property-search-widget .toggle-btn.active {
	background-color: #0a2540;
	color: white;
	border-color: #0a2540;
}

.property-search-widget .toggle-btn:hover {
	background-color: #f5f5f5;
}

.property-search-widget .toggle-btn.active:hover {
	background-color: #0d2f52;
}

/* Buttons */
.property-search-widget .advanced-search-btn {
	background-color: white;
	border: 1px solid #ddd;
	color: #002349;
	padding: 0;
	width: 40px;
	height: 40px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: background-color 0.3s;
	flex: 0 0 40px;
}

.property-search-widget .advanced-search-btn svg {
	display: block;
}

.property-search-widget .advanced-search-btn:hover {
	background-color: #f5f5f5;
}

.property-search-widget .search-submit-btn {
	background-color: #0a2540;
	border: none;
	color: white;
	padding: 0.75rem 2rem;
	font-size: 0.9rem;
	font-weight: 600;
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: 0.5rem;
	transition: background-color 0.3s;
	letter-spacing: 0.5px;
}

.property-search-widget .search-submit-btn:hover {
	background-color: #0d2f52;
}

/* Responsive Design - Tablet (and small desktops where single row doesn't fit) */
@media (max-width: 1199px) {
	.property-search-widget .search-controls {
		display: grid;
		grid-template-columns: auto 1fr auto auto;
		grid-template-rows: auto auto;
		gap: 0.75rem;
		align-items: end;
	}

	/* Row 1: Property type, price range, buy/rent, search input */
	.property-search-widget .property-type-dropdown {
		grid-column: 1;
		grid-row: 1;
	}

	.property-search-widget .currency-price-group {
		grid-column: 2;
		grid-row: 1;
		justify-self: center;
	}

	.property-search-widget .buy-rent-toggle {
		grid-column: 3;
		grid-row: 1;
		margin-left: 0;
	}

	.property-search-widget .search-input-wrapper {
		grid-column: 4;
		grid-row: 1;
	}

	.property-search-widget .search-input-wrapper input {
		min-width: 180px;
	}

	/* Row 2: Search button and filters button */
	.property-search-widget .search-submit-btn {
		grid-column: 1 / 4;
		grid-row: 2;
		width: 100%;
		justify-content: center;
	}

	.property-search-widget .advanced-search-btn {
		grid-column: 4;
		grid-row: 2;
	}
}

/* Responsive Design - Mobile */
@media (max-width: 768px) {
	.property-search-widget .search-wrapper {
		padding: 0 1rem;
	}

	.property-search-widget .search-controls {
		display: grid;
		grid-template-columns: 1fr 1fr;
		grid-template-rows: auto auto auto auto;
		gap: 0.5rem;
		align-items: end;
	}

	/* Hide currency selector on mobile */
	.property-search-widget .currency-selector {
		display: none;
	}

	/* Row 1: Property type (full width) */
	.property-search-widget .property-type-dropdown {
		grid-column: 1 / -1;
		grid-row: 1;
	}

	.property-search-widget .property-type-dropdown select {
		min-width: 0;
		width: 100%;
	}

	/* Row 2: Price range and buy/rent */
	.property-search-widget .currency-price-group {
		grid-column: 1;
		grid-row: 2;
		min-width: 0;
	}

	.property-search-widget .buy-rent-toggle {
		grid-column: 2;
		grid-row: 2;
		margin-left: 0;
		justify-self: end;
	}

	.property-search-widget .toggle-btn {
		padding: 0.75rem 1rem;
		font-size: 0.8rem;
	}

	/* Row 3: Search input (full width) */
	.property-search-widget .search-input-wrapper {
		grid-column: 1 / -1;
		grid-row: 3;
	}

	.property-search-widget .search-input-wrapper input {
		min-width: 0;
		width: 100%;
	}

	/* Row 4: Buttons */
	.property-search-widget .search-submit-btn {
		grid-column: 1;
		grid-row: 4;
		width: 100%;
		justify-content: center;
	}

	.property-search-widget .advanced-search-btn {
		grid-column: 2;
		grid-row: 4;
		width: 100%;
		text-align: center;
	}
}

/* Price Slider Styles */
.property-search-widget .slider-wrapper {
	padding: 0 1em;
	width: 200px;
}

@media (max-width: 1024px) {
	.property-search-widget .slider-wrapper {
		width: 150px;
	}
}

@media (max-width: 768px) {
	.property-search-widget .currency-price-group {
		width: 100%;
	}

	.property-search-widget .slider-wrapper {
		width: 100%;
		min-width: 0;
		flex: 1;
	}
}

.property-search-widget .slider-wrapper .noUi-handle {
	height: 1rem;
	width: 1rem;
	top: -0.5rem;
	right: -10px;
	background: #D4A574;
	border: none;
	border-radius: 2px;
	box-shadow: none;
	cursor: pointer;
}

.property-search-widget .slider-wrapper .noUi-target {
	background: #B5BFCC;
	border-radius: 0;
	border: none;
	box-shadow: none;
	height: 2px;
	margin: 10px 0;
}

.property-search-widget .slider-wrapper .noUi-handle:before,
.property-search-widget .slider-wrapper .noUi-handle:after {
	display: none;
}

.property-search-widget .slider-wrapper .noUi-connect {
	background: #D4A574;
}

.property-search-widget .slider-wrapper .price-labels {
	display: flex;
	justify-content: space-between;
	font-size: 0.65rem;
	color: #666;
	margin-top: 10px;
}

.property-search-widget .slider-wrapper .price-labels span {
	font-weight: 500;
}

.property-search-widget .slider-wrapper .search-price-label {
	display: block;
	color: #696969;
	font-size: 0.7rem;
	font-weight: 600;
	letter-spacing: 1px;
}
