/**
 * Aqarova homepage styles — hero search banner, stats bar, browse-by
 * grids, CTA banner. Loaded only on pages containing a homepage
 * shortcode (see Aqarova\Public_Site\Public_Site::needs_home_styles()).
 * Depends on the CSS variables defined in public.css.
 */

/* ---------- Hero ---------- */
.aqarova-hero {
	position: relative;
	background-color: var(--aqarova-hero-bg, var(--aqarova-section, #F5F5F5));
	background-size: cover;
	background-position: center;
	padding: var(--aqarova-hero-padding-top, 90px) 0 var(--aqarova-hero-padding-bottom, 50px);
	color: var(--aqarova-hero-title-color, var(--aqarova-ink));
	overflow: hidden;
}

.aqarova-hero::before {
	content: '';
	position: absolute;
	inset: 0;
	background: var(--aqarova-hero-overlay, none);
	z-index: 0;
}

.aqarova-hero__overlay {
	display: none; /* gradient handled by ::before for a single paint layer */
}

.aqarova-hero__inner {
	position: relative;
	z-index: 1;
	text-align: center;
	max-width: 900px;
}

.aqarova-hero__title {
	font-size: clamp(28px, 4vw, 44px);
	font-weight: 700;
	color: var(--aqarova-hero-title-color, var(--aqarova-ink));
	margin: 0 0 12px;
	letter-spacing: -0.01em;
}

.aqarova-hero__title .aqarova-hero__title-accent {
	color: var(--aqarova-hero-accent-color, #BF1E2E);
}
.aqarova-hero__title {
	overflow-wrap: anywhere;
}

.aqarova-hero__subtitle {
	font-size: 16px;
	color: var(--aqarova-hero-subtitle-color, var(--aqarova-muted));
	margin: 0 0 32px;
}

.aqarova-hero-search {
	background: var(--aqarova-hero-search-bg, #fff);
	border: 1px solid var(--aqarova-border);
	border-radius: var(--aqarova-hero-search-radius, 14px);
	color: var(--aqarova-hero-search-text, var(--aqarova-ink));
	padding: 18px;
	box-shadow: 0 12px 28px rgba(0, 0, 0, 0.07);
	container-type: inline-size;
	text-align: left;
	transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.aqarova-hero-search__tabs {
	display: flex;
	gap: 6px;
	margin-bottom: 14px;
}

.aqarova-hero-search__tab {
	position: relative;
	cursor: pointer;
}

.aqarova-hero-search__tab input {
	position: absolute;
	opacity: 0;
}

.aqarova-hero-search__tab span {
	display: inline-block;
	padding: 8px 18px;
	border: 1px solid transparent;
	border-radius: 20px;
	font-size: 13px;
	font-weight: 600;
	color: var(--aqarova-muted);
	background: var(--aqarova-bg);
	transition: all 0.15s ease;
}

.aqarova-hero-search__tab input:checked + span {
	background: var(--aqarova-crimson);
	color: #fff;
}

.aqarova-hero-search__fields {
	display: grid;
	/* v2.1.40: each configurable desktop row declares its own field count.
	   A sensible minimum keeps native select arrows from sitting on text. */
	grid-template-columns: repeat(var(--aqarova-hero-row-count, 4), minmax(110px, 1fr));
	column-gap: var(--aqarova-hero-column-gap, 10px);
	row-gap: 10px;
	align-items: stretch;
}

.aqarova-hero-search__fields + .aqarova-hero-search__fields {
	margin-top: var(--aqarova-hero-row-gap, 10px);
}

/* v2.1.44: Row 2 can be conditionally collapsed for New inventory.
   It is a fieldset so disabled state excludes every hidden Row 2 control
   from the submitted GET request without interfering with dependent selects. */
fieldset.aqarova-hero-search__fields {
	min-inline-size: 0;
	margin-inline: 0;
	padding: 0;
	border: 0;
}

.aqarova-hero-search__fields[hidden] {
	display: none !important;
}

.aqarova-hero-search__fields > * {
	min-width: 0;
	box-sizing: border-box;
}

.aqarova-hero-search__fields input,
.aqarova-hero-search__fields select {
	width: 100%;
	height: auto;
	min-height: 42px;
	box-sizing: border-box;
	padding: 10px 14px;
	border: 1px solid var(--aqarova-border);
	border-radius: 8px;
	font-family: inherit;
	font-size: 14px;
	line-height: 1.35;
	vertical-align: middle;
	color: var(--aqarova-hero-search-text, var(--aqarova-ink));
	transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.aqarova-hero-search__fields select {
	/* Extra room protects the selected text from the browser's native arrow. */
	padding-right: 34px;
	line-height: normal;
	white-space: nowrap;
	text-overflow: ellipsis;
}

/* Switch before the desktop row becomes cramped. This keeps every select
   readable instead of squeezing its selected option beneath the native arrow. */
@media (max-width: 1024px) {
	.aqarova-hero-search__fields {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.aqarova-hero-search__keyword {
		grid-column: 1 / -1;
	}

	.aqarova-hero-search__filters-btn,
	.aqarova-hero-search__submit {
		width: 100%;
		justify-content: center;
	}
}

@media (max-width: 640px) {
	.aqarova-hero-search__fields {
		grid-template-columns: 1fr;
	}

	.aqarova-hero-search__keyword {
		grid-column: auto;
	}
}

.aqarova-hero-search__filters-btn {
	position: relative;
	display: inline-flex;
	min-height: 42px;
	box-sizing: border-box;
	align-items: center;
	gap: 6px;
	background: var(--aqarova-bg);
	border: 1px solid var(--aqarova-border);
	border-radius: 8px;
	padding: 12px 18px;
	font-size: 14px;
	font-weight: 600;
	color: var(--aqarova-hero-search-text, var(--aqarova-ink));
	cursor: pointer;
	white-space: nowrap;
	transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.aqarova-hero-search__filters-btn:hover {
	border-color: var(--aqarova-crimson);
	color: var(--aqarova-crimson);
}

.aqarova-hero-search__submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 42px;
	box-sizing: border-box;
	background: var(--aqarova-crimson);
	color: #fff;
	border: none;
	border-radius: 8px;
	padding: 12px 28px;
	font-weight: 600;
	font-size: 14px;
	cursor: pointer;
	white-space: nowrap;
	transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.aqarova-hero-search__submit:hover {
	background: var(--aqarova-crimson-dark);
}

/* ---------- Stats bar ---------- */
.aqarova-stats-bar {
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	gap: 40px;
	margin-top: 32px;
}

.aqarova-stats-bar__item {
	display: flex;
	flex-direction: column;
	align-items: center;
}

.aqarova-stats-bar__value {
	font-size: 26px;
	font-weight: 700;
	color: var(--aqarova-crimson);
}

.aqarova-stats-bar__label {
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--aqarova-muted);
	margin-top: 2px;
}

/* Standalone stats are independent of other widgets on the page. */
.aqarova-stats-bar {
    background: var(--aqarova-section, #F5F5F5);
    border-radius: var(--aqarova-radius);
    padding: 24px;
}
:where(.aqarova-hero) .aqarova-stats-bar {
    background: transparent;
    padding: 0;
}
:where(.aqarova-hero) .aqarova-stats-bar__value {
    color: var(--aqarova-hero-title-color, var(--aqarova-crimson));
}
:where(.aqarova-hero) .aqarova-stats-bar__label {
    color: var(--aqarova-hero-subtitle-color, var(--aqarova-muted));
}

/* ---------- Section wrappers ---------- */
.aqarova-home-section {
	padding: 56px 0;
}

.aqarova-home-section--locations {
	background: var(--aqarova-bg);
}

.aqarova-home-section__title {
	text-align: center;
	font-size: 26px;
	margin: 0 0 32px;
	color: var(--aqarova-ink);
}

/* ---------- Featured property card consistency ----------
   Featured inventory can be rendered through either the full Home Featured
   Elementor widget or the standalone Featured Properties widget. Mark featured
   grids explicitly and lock the actual image canvas — not only the outer card
   — so every thumbnail occupies the exact same frame regardless of the source
   image dimensions or WordPress thumbnail attributes. */
.aqarova-home-section--featured .aqarova-card__media,
.aqarova-grid--featured .aqarova-card__media {
	position: relative;
	aspect-ratio: 16 / 10;
	overflow: hidden;
}

.aqarova-home-section--featured .aqarova-card__media > a,
.aqarova-grid--featured .aqarova-card__media > a {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	overflow: hidden;
}

.aqarova-home-section--featured .aqarova-card__media img,
.aqarova-grid--featured .aqarova-card__media img {
	position: absolute;
	inset: 0;
	display: block;
	width: 100% !important;
	height: 100% !important;
	min-width: 100%;
	min-height: 100%;
	max-width: none !important;
	max-height: none !important;
	margin: 0 !important;
	object-fit: cover !important;
	object-position: 50% 50% !important;
}

.aqarova-home-section--featured .aqarova-card__placeholder,
.aqarova-grid--featured .aqarova-card__placeholder {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
}

/* Condition and featured badge geometry is shared in public.css. */

/* Keep the monetary overlay badge at one height too; its width remains
   content-aware so long currencies/prices are never clipped. */
.aqarova-home-section--featured .aqarova-card__price-badge,
.aqarova-grid--featured .aqarova-card__price-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 120px;
	min-height: 28px;
	box-sizing: border-box;
	line-height: 1;
	white-space: nowrap;
}

/* ---------- Browse by Location ---------- */
.aqarova-browse-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 20px;
}

.aqarova-browse-card {
	display: block;
	border-radius: var(--aqarova-radius);
	overflow: hidden;
	text-decoration: none;
	color: inherit;
	background: #fff;
	border: 1px solid var(--aqarova-border);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.aqarova-browse-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

.aqarova-browse-card__media {
	height: 130px;
	background: linear-gradient(135deg, var(--aqarova-crimson), var(--aqarova-crimson-dark));
	background-size: cover;
	background-position: center;
	display: flex;
	align-items: center;
	justify-content: center;
}

.aqarova-browse-card__initial {
	font-size: 40px;
	font-weight: 700;
	color: rgba(255, 255, 255, 0.85);
}

.aqarova-browse-card__body {
	padding: 14px 16px;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.aqarova-browse-card__name {
	font-weight: 600;
	font-size: 15px;
	color: var(--aqarova-ink);
}

.aqarova-browse-card__count {
	font-size: 12px;
	color: var(--aqarova-muted);
}

/* ---------- Browse by Type ---------- */
.aqarova-browse-grid--types {
	grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

.aqarova-type-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	text-align: center;
	padding: 24px 12px;
	border-radius: var(--aqarova-radius);
	border: 1px solid var(--aqarova-border);
	background: #fff;
	text-decoration: none;
	color: inherit;
	transition: border-color 0.15s ease, transform 0.15s ease;
}

.aqarova-type-card:hover {
	border-color: var(--aqarova-crimson);
	transform: translateY(-3px);
}

.aqarova-type-card__icon {
	width: 40px;
	height: 40px;
	color: var(--aqarova-crimson);
}

.aqarova-type-card__icon svg {
	width: 100%;
	height: 100%;
}

.aqarova-type-card__name {
	font-weight: 600;
	font-size: 14px;
	color: var(--aqarova-ink);
}

.aqarova-type-card__count {
	font-size: 12px;
	color: var(--aqarova-muted);
}

/* ---------- CTA banner ---------- */
.aqarova-cta-banner {
	background: linear-gradient(120deg, var(--aqarova-ink), var(--aqarova-crimson-dark));
	color: #fff;
	padding: 48px 0;
}

.aqarova-cta-banner__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 20px;
}

.aqarova-cta-banner__title {
	margin: 0 0 6px;
	font-size: 24px;
}

.aqarova-cta-banner__subtitle {
	margin: 0;
	color: rgba(255, 255, 255, 0.8);
	font-size: 14px;
}

.aqarova-cta-banner__button {
	background: var(--aqarova-crimson);
	color: #FFFFFF;
	border: none;
	white-space: nowrap;
	font-weight: 600;
}

.aqarova-cta-banner__button:hover {
	background: #A61928;
	color: #FFFFFF;
}


/* Elementor live-preview safety: keep hero search child controls visually isolated.
   Low-specificity defaults preserve visibility without overriding Elementor instance controls. */
:where(.aqarova-hero-search__fields input, .aqarova-hero-search__fields select) {
	color: var(--aqarova-hero-search-text, var(--aqarova-ink));
	background-color: #fff;
}

:where(.aqarova-hero-search__filters-btn) {
	color: var(--aqarova-hero-search-text, var(--aqarova-ink));
	background-color: var(--aqarova-bg);
}

:where(.aqarova-hero-search__submit) {
	color: #fff;
	background-color: var(--aqarova-crimson);
}

:where(.aqarova-hero-search__fields input, .aqarova-hero-search__fields select, .aqarova-hero-search__filters-btn, .aqarova-hero-search__submit):focus,
:where(.aqarova-hero-search__fields input, .aqarova-hero-search__fields select, .aqarova-hero-search__filters-btn, .aqarova-hero-search__submit):focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/* ---------- Elementor native homepage composition ----------
 * The generated Elementor Home intentionally keeps Stats as its own native
 * Aqarova widget. Do not infer its context from the presence of a Hero
 * elsewhere on the page; make the standalone widget readable explicitly.
 */
.elementor-widget-aqarova_stats_bar .aqarova-stats-bar,
.elementor-element.elementor-widget-aqarova_stats_bar .aqarova-stats-bar {
	margin-top: 0;
	background: var(--aqarova-bg);
	padding: 24px;
}

.elementor-widget-aqarova_stats_bar .aqarova-stats-bar__label,
.elementor-element.elementor-widget-aqarova_stats_bar .aqarova-stats-bar__label {
	color: var(--aqarova-muted);
}

/* Use actual search-box width, not only viewport width, to avoid clipped
   fields when the hero is inside a narrow theme or Elementor container. */
@container (max-width: 880px) {
    .aqarova-hero-search__fields { grid-template-columns: repeat(auto-fit, minmax(min(100%, 205px), 1fr)); }
}
@container (max-width: 420px) {
    .aqarova-hero-search__fields { grid-template-columns: 1fr; }
}


/* v1.0.3: property-first search; legacy row CSS remains available. */
.aqarova-hero-search--property { padding: clamp(14px, 3vw, 24px); }
.aqarova-hero-search--property .aqarova-hero-search__tabs { margin-bottom: 16px; }
.aqarova-hero-search--property .aqarova-hero-property-location { grid-template-columns: minmax(0,1fr); }
.aqarova-hero-search--property .aqarova-hero-property-criteria { grid-template-columns: repeat(auto-fit,minmax(min(100%,190px),1fr)); align-items: end; }
.aqarova-hero-search--property .aqarova-hero-property-actions { grid-template-columns: minmax(0,1fr) minmax(0,2fr); }
.aqarova-hero-search--property .aqarova-hero-property-actions > :only-child { grid-column: 1 / -1; }
.aqarova-hero-property-budget { min-width:0; margin:0; padding:0; border:0; }
.aqarova-hero-property-budget legend { font-size: 12px; font-weight: 600; padding:0; margin-bottom: 4px; color:var(--aqarova-hero-search-text,var(--aqarova-ink)); }
.aqarova-hero-property-budget__inputs { display:grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap:6px; }
.aqarova-hero-property-budget__inputs input { min-width: 0; padding-inline: 9px; }
.aqarova-hero-property-budget small { display:block; color:var(--aqarova-muted); font-size:11px; margin-top:4px; line-height:1.35; }
.aqarova-hero-property-advanced { grid-template-columns:repeat(auto-fit,minmax(min(100%,180px),1fr)); margin-bottom: 16px; }
.aqarova-home-section { padding-block: clamp(28px,4vw,44px); }
.aqarova-home-section__title { margin-bottom: 24px; }
.aqarova-hero-search__tab input:focus-visible + span { outline: 2px solid var(--aqarova-crimson); outline-offset: 2px; }
@container (max-width: 480px) {
 .aqarova-hero-search--property .aqarova-hero-property-criteria,
 .aqarova-hero-search--property .aqarova-hero-property-actions { grid-template-columns: minmax(0,1fr); }
}

.aqarova-hero-property-field { display:block; min-width:0; }
.aqarova-hero-property-field > span { display:block; font-size:12px; font-weight:600; margin-bottom:4px; color:var(--aqarova-hero-search-text,var(--aqarova-ink)); }
.aqarova-hero-budget-note { font-size:11px; color:var(--aqarova-muted); margin:6px 0 10px; line-height:1.4; }
.aqarova-hero-search--property .aqarova-hero-property-criteria { align-items: start; }


/* v1.0.4 — component defaults above theme-wide button and heading rules.
 * Do not use !important: Elementor's instance-specific controls must win. */
body .aqarova-hero-search button.aqarova-hero-search__filters-btn {
	background-color: var(--aqarova-surface, #FFFFFF);
	color: var(--aqarova-hero-search-text, var(--aqarova-ink, #111111));
	border-color: var(--aqarova-border, #DDDDDD);
	justify-content: center;
}
body .aqarova-hero-search button.aqarova-hero-search__filters-btn:is(:hover, :focus, :active, [aria-expanded="true"]) {
	background-color: var(--aqarova-soft-red, #F7E8EB);
	color: var(--aqarova-crimson, #BF1E2E);
	border-color: var(--aqarova-crimson, #BF1E2E);
}
body .aqarova-hero-search button.aqarova-hero-search__submit {
	background-color: var(--aqarova-button-primary, #BF1E2E);
	color: var(--aqarova-button-primary-text, #FFFFFF);
	border-color: var(--aqarova-button-primary, #BF1E2E);
}
body .aqarova-hero-search button.aqarova-hero-search__submit:is(:hover, :focus, :active) {
	background-color: var(--aqarova-button-primary-hover, #A61928);
	color: var(--aqarova-button-primary-text, #FFFFFF);
	border-color: var(--aqarova-button-primary-hover, #A61928);
}
body .aqarova-hero-search button:is(.aqarova-hero-search__filters-btn, .aqarova-hero-search__submit):focus-visible {
	outline: 2px solid var(--aqarova-crimson, #BF1E2E);
	outline-offset: 2px;
}
body .aqarova-cta-banner h2.aqarova-cta-banner__title {
	color: #FFFFFF;
}
body .aqarova-cta-banner p.aqarova-cta-banner__subtitle {
	color: #F5F5F5;
}
body .aqarova-cta-banner a.aqarova-cta-banner__button {
	background-color: var(--aqarova-button-primary, #BF1E2E);
	color: var(--aqarova-button-primary-text, #FFFFFF);
	text-decoration: none;
	border: 1px solid rgba(255,255,255,.55);
}
body .aqarova-cta-banner a.aqarova-cta-banner__button:is(:hover, :focus, :active) {
	background-color: var(--aqarova-button-primary-hover, #A61928);
	color: var(--aqarova-button-primary-text, #FFFFFF);
	text-decoration: none;
}
body .aqarova-cta-banner a.aqarova-cta-banner__button:focus-visible {
	outline: 2px solid #FFFFFF;
	outline-offset: 3px;
}
