/* AdQuickly homepage redesign (2026-12). Loaded only on the homepage (see sections/home/search-form.blade.php).
   Reference design: design/homepage-reference.webp */
:root {
	--aq-red: var(--theme-color, #e3262c);
	--aq-red-dark: #c81d23;
	--aq-ink: #1f2433;
	--aq-text: #3b4254;
	--aq-muted: #7a8194;
	--aq-line: #e8ebf2;
	--aq-card: #ffffff;
	--aq-radius: 12px;
	--aq-shadow: 0 2px 10px rgba(31, 36, 51, .06);
	--aq-shadow-hover: 0 10px 24px rgba(31, 36, 51, .12);
}

#homepage { overflow-x: clip; }
#homepage .container { max-width: 1140px; }

/* ---------- Hero ---------- */
.aq-hero { position: relative; padding: 34px 0 8px; text-align: center; }
.aq-hero-globe {
	position: absolute; top: -70px; left: 50%; width: 560px; max-width: 90vw;
	transform: translateX(-50%); opacity: .28; pointer-events: none; z-index: 0;
}
.aq-hero .container { position: relative; z-index: 1; }
.aq-hero-title {
	margin: 0 0 6px; font-size: clamp(30px, 5.2vw, 58px); font-weight: 700; line-height: 1.1;
	letter-spacing: -1.5px; color: var(--aq-ink); text-transform: none;
}
.aq-hero-title span { color: var(--aq-red); }
.aq-hero-subtitle { margin: 0 0 26px; font-size: clamp(14px, 1.7vw, 20px); color: var(--aq-text); font-weight: 400; }

.aq-search {
	display: flex; align-items: center; max-width: 790px; margin: 0 auto; padding: 8px 8px 8px 10px;
	background: #fff; border-radius: 999px; border: 1px solid var(--aq-line);
	box-shadow: 0 12px 30px rgba(31, 36, 51, .10);
}
.aq-search-field { display: flex; align-items: center; gap: 12px; flex: 1 1 0; min-width: 0; margin: 0; padding: 0 18px; cursor: text; }
.aq-search-field i { font-size: 20px; color: var(--aq-ink); flex: none; }
.aq-search-field input {
	width: 100%; min-width: 0; height: 46px; border: 0; outline: 0; background: transparent;
	font-size: 15px; color: var(--aq-ink); box-shadow: none; padding: 0;
}
.aq-search-field input::placeholder { color: #6b7285; }
.aq-search-q { flex-grow: 1.35; }
.aq-search-loc { border-left: 1px solid var(--aq-line); }
.aq-search-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px; flex: none;
	height: 50px; padding: 0 30px; border: 0; border-radius: 999px; cursor: pointer;
	background: linear-gradient(180deg, var(--aq-red) 0%, var(--aq-red-dark) 100%); color: #fff;
	font-size: 17px; font-weight: 600; box-shadow: 0 6px 14px rgba(227, 38, 44, .28); transition: transform .15s, box-shadow .15s;
}
.aq-search-btn:hover { transform: translateY(-1px); box-shadow: 0 10px 20px rgba(227, 38, 44, .32); }
.aq-search-btn:focus-visible, .aq-chip:focus-visible, .aq-cat-card:focus-visible { outline: 3px solid rgba(227, 38, 44, .35); outline-offset: 2px; }

.aq-chips { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 22px auto 0; max-width: 790px; }
.aq-chips-label { font-size: 13px; font-weight: 600; color: var(--aq-ink); white-space: nowrap; }
.aq-chips-list { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.aq-chip {
	display: inline-block; padding: 7px 16px; border-radius: 999px; background: #fff; border: 1px solid var(--aq-line);
	font-size: 12.5px; color: var(--aq-text); white-space: nowrap; box-shadow: 0 1px 3px rgba(31, 36, 51, .05);
	transition: border-color .15s, color .15s;
}
.aq-chip:hover { border-color: var(--aq-red); color: var(--aq-red); }

/* ---------- Section shell ---------- */
.aq-section { padding: 34px 0 0; }
.aq-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.aq-section-title { margin: 0; font-size: clamp(20px, 2.4vw, 26px); font-weight: 700; color: var(--aq-ink); letter-spacing: -.4px; }
.aq-view-more { font-size: 13px; font-weight: 600; color: var(--aq-red); white-space: nowrap; }
.aq-view-more:hover { color: var(--aq-red-dark); text-decoration: underline; }

/* ---------- Categories ---------- */
.aq-cat-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.aq-cat-card {
	position: relative; display: flex; flex-direction: column; justify-content: space-between; height: 102px;
	padding: 12px 12px 6px 14px; background: var(--aq-card); border: 1px solid var(--aq-line); border-radius: var(--aq-radius);
	box-shadow: var(--aq-shadow); overflow: hidden; transition: transform .15s, box-shadow .15s;
}
.aq-cat-card:hover { transform: translateY(-2px); box-shadow: var(--aq-shadow-hover); }
.aq-cat-name { position: relative; z-index: 1; font-size: 13px; font-weight: 600; line-height: 1.25; color: var(--aq-ink); }
.aq-cat-name small { font-weight: 400; color: var(--aq-muted); }
.aq-cat-img {
	position: absolute; right: 8px; bottom: 6px; width: 62%; height: 62%; object-fit: contain; object-position: right bottom;
}

/* ---------- Latest listings ---------- */
.aq-post-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.aq-card {
	display: flex; flex-direction: column; background: var(--aq-card); border: 1px solid var(--aq-line); border-radius: 10px;
	box-shadow: var(--aq-shadow); overflow: hidden; transition: transform .15s, box-shadow .15s;
}
.aq-card:hover { transform: translateY(-2px); box-shadow: var(--aq-shadow-hover); }
.aq-card-media { position: relative; display: block; aspect-ratio: 2 / 1; background: #eef1f6; overflow: hidden; }
.aq-card-media picture, .aq-card-media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.aq-photo-count {
	position: absolute; top: 8px; right: 8px; padding: 2px 7px; border-radius: 4px; background: rgba(31, 36, 51, .72);
	color: #fff; font-size: 11px; font-weight: 600; line-height: 1.5;
}
.aq-photo-count i { font-size: 10px; }
.aq-badge {
	position: absolute; top: 8px; left: 8px; padding: 2px 8px; border-radius: 4px; background: var(--aq-red);
	color: #fff; font-size: 11px; font-weight: 600;
}
.aq-card-body { display: flex; flex-direction: column; flex: 1; padding: 10px 12px 10px; }
.aq-card-title { margin: 0 0 6px; font-size: 13px; font-weight: 600; line-height: 1.3; min-height: 2.6em; }
.aq-card-title a {
	color: var(--aq-ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.aq-card-title a:hover { color: var(--aq-red); }
.aq-card-meta { display: flex; flex-wrap: wrap; gap: 3px 12px; margin: 0 0 6px; padding: 0; list-style: none; font-size: 10.5px; color: var(--aq-muted); }
.aq-card-meta li { display: inline-flex; align-items: center; gap: 4px; min-width: 0; }
.aq-card-meta i { font-size: 10px; }
.aq-meta-cat a { color: var(--aq-red); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 130px; display: inline-block; }
.aq-meta-city { flex-basis: 100%; }
.aq-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; }
.aq-price { font-size: 17px; font-weight: 700; color: var(--aq-red); line-height: 1.2; }
.aq-price * { font-size: inherit; color: inherit; margin: 0; }
.aq-fav { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; color: var(--aq-ink); font-size: 17px; cursor: pointer; flex: none; }
.aq-fav:hover { background: #fdecec; color: var(--aq-red); }
/* The shared save-listing script swaps bookmark icons; show them as hearts here, like the design */
.aq-fav .bi-bookmark::before { content: "\f417"; }
.aq-fav .bi-bookmark-fill::before { content: "\f415"; color: var(--aq-red); }

/* ---------- Choose a city ---------- */
.aq-cities { padding-top: 46px; }
.aq-city-card {
	position: relative; padding: 30px 40px 22px; background: #fff; border-radius: 22px; border: 1px solid var(--aq-line);
	box-shadow: 0 8px 26px rgba(31, 36, 51, .07);
}
.aq-city-pin {
	position: absolute; top: -24px; left: 50%; transform: translateX(-50%); font-size: 40px; line-height: 1; color: var(--aq-red);
	filter: drop-shadow(0 4px 6px rgba(227, 38, 44, .25));
}
.aq-city-title { margin: 4px 0 18px; text-align: center; font-size: clamp(20px, 2.3vw, 26px); font-weight: 700; color: var(--aq-ink); }
.aq-city-list { columns: 6; column-gap: 0; margin: 0 0 18px; padding: 0; list-style: none; column-rule: 1px solid var(--aq-line); }
.aq-city-list li { padding: 1px 0 1px 18%; font-size: 12.5px; line-height: 1.45; break-inside: avoid; color: var(--aq-text); }
.aq-city-list a { color: var(--aq-text); }
.aq-city-list a:hover { color: var(--aq-red); }
.aq-city-list small { color: var(--aq-muted); }
.aq-city-more a { font-weight: 700; color: var(--aq-ink); }
.aq-btn-red {
	display: inline-flex; align-items: center; gap: 8px; padding: 9px 22px; border-radius: 999px; color: #fff !important;
	background: linear-gradient(180deg, var(--aq-red) 0%, var(--aq-red-dark) 100%); font-size: 13px; font-weight: 600;
	box-shadow: 0 6px 14px rgba(227, 38, 44, .25);
}
.aq-btn-red:hover { filter: brightness(1.05); }

/* ---------- Stats ---------- */
.aq-stats { padding: 26px 0 30px; }
.aq-stats-row { display: grid; grid-template-columns: repeat(3, 1fr); }
.aq-stat { display: flex; align-items: center; justify-content: center; gap: 18px; }
.aq-stat + .aq-stat { border-left: 1px solid #d9dde6; }
.aq-stat i { font-size: 34px; color: var(--aq-red); }
.aq-stat strong { display: block; font-size: 22px; font-weight: 700; color: var(--aq-ink); line-height: 1.1; }
.aq-stat span { display: block; font-size: 13px; color: var(--aq-muted); }

/* ---------- Tablet ---------- */
@media (max-width: 991.98px) {
	.aq-cat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
	.aq-post-grid { gap: 10px; }
	.aq-city-list { columns: 4; }
	.aq-chips { flex-direction: column; gap: 8px; }
}

/* ---------- Mobile: app-like layout ---------- */
@media (max-width: 767.98px) {
	#homepage .container { padding-left: 14px; padding-right: 14px; }
	.aq-hero { padding: 18px 0 0; text-align: left; }
	.aq-hero-globe { top: -40px; width: 340px; opacity: .2; }
	.aq-hero-title { font-size: 30px; letter-spacing: -.8px; }
	.aq-hero-subtitle { margin-bottom: 16px; font-size: 14px; }

	/* Search becomes an app-style card */
	.aq-search { flex-wrap: wrap; gap: 0; padding: 6px; border-radius: 18px; }
	.aq-search-field { flex: 1 1 100%; padding: 0 12px; }
	.aq-search-field i { font-size: 17px; }
	.aq-search-field input { height: 48px; font-size: 16px; } /* 16px stops iOS zooming in */
	.aq-search-loc { border-left: 0; border-top: 1px solid var(--aq-line); }
	.aq-search-btn { flex: 1 1 100%; height: 48px; margin-top: 4px; border-radius: 14px; }

	/* Chips: one swipeable row */
	.aq-chips { align-items: stretch; margin: 14px -14px 0; gap: 8px; }
	.aq-chips-label { padding: 0 14px; }
	.aq-chips-list { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; padding: 2px 14px 6px; scroll-snap-type: x proximity; scrollbar-width: none; }
	.aq-chips-list::-webkit-scrollbar { display: none; }
	.aq-chip { padding: 8px 14px; font-size: 13px; scroll-snap-align: start; }

	.aq-section { padding-top: 24px; }
	.aq-section-head { margin-bottom: 12px; }

	/* Categories: two swipeable rows of tiles */
	.aq-cat-grid {
		grid-template-columns: none; grid-auto-flow: column; grid-template-rows: repeat(2, auto); grid-auto-columns: 31%;
		gap: 10px; margin: 0 -14px; padding: 2px 14px 8px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none;
	}
	.aq-cat-grid::-webkit-scrollbar { display: none; }
	.aq-cat-card { height: 104px; padding: 10px; scroll-snap-align: start; }
	.aq-cat-name { font-size: 12px; }
	.aq-cat-img { width: 70%; height: 58%; right: 6px; bottom: 6px; }
	.aq-cat-card:hover, .aq-card:hover { transform: none; }

	/* Listings: compact two-column feed */
	.aq-post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
	.aq-card-media { aspect-ratio: 4 / 3; }
	.aq-card-body { padding: 8px 10px 8px; }
	.aq-card-title { font-size: 12.5px; }
	.aq-card-meta li:first-child { flex-basis: 100%; }
	.aq-meta-cat a { max-width: 100px; }
	.aq-price { font-size: 15px; }

	.aq-cities { padding-top: 40px; }
	.aq-city-card { padding: 28px 16px 18px; border-radius: 18px; }
	.aq-city-list { columns: 3; column-rule: 0; }
	.aq-city-list li { padding: 0 0 0 4px; font-size: 13px; line-height: 2; }

	.aq-stats { padding: 20px 0 24px; }
	.aq-stat { flex-direction: column; gap: 6px; text-align: center; }
	.aq-stat i { font-size: 24px; }
	.aq-stat strong { font-size: 17px; }
	.aq-stat span { font-size: 11px; }
}

@media (max-width: 359.98px) {
	.aq-cat-grid { grid-auto-columns: 42%; }
	.aq-city-list { columns: 2; }
}

@media (prefers-reduced-motion: reduce) {
	.aq-cat-card, .aq-card, .aq-search-btn { transition: none; }
}

/* The theme colours every link; keep the design's colours inside the homepage blocks */
#homepage .aq-chip { color: var(--aq-text); }
#homepage .aq-chip:hover { color: var(--aq-red); }
#homepage .aq-view-more, #homepage .aq-meta-cat a { color: var(--aq-red); }
#homepage .aq-cat-card, #homepage .aq-card-title a, #homepage .aq-fav, #homepage .aq-city-more a { color: var(--aq-ink); }
#homepage .aq-city-list a { color: var(--aq-text); }
#homepage .aq-card-title a:hover, #homepage .aq-city-list a:hover, #homepage .aq-fav:hover { color: var(--aq-red); }
.aq-view-more, .aq-city-title { text-transform: capitalize; }
@media (max-width: 767.98px) {
	/* Keep the first chip/tile aligned with the page margin when the rows snap */
	.aq-chips-list, .aq-cat-grid { scroll-padding-inline: 14px; }
}
