/* =========================================================================
 * QuoVadis Core v2 — Esplora refinements
 * Layers ON TOP of qv-discovery.css (loaded after it via style dependency).
 * Scope: esplora head + results layout + sidebar + cards + states.
 * Goal: make Esplora + cards feel like the SAME premium product as the
 *       new home hero (AllTrails x Airbnb — warm, trustworthy, Ligurian).
 * Tokens-only. Mobile-first. Everything scoped under .qv-body.
 * Does NOT touch the search-form internals (Agent 2 owns those) — only the
 * sidebar container around the [qv_search_form compact] shortcode.
 * ========================================================================= */

/* -------------------------------------------------------------------------
 * ESPLORA HEAD — confident landing band echoing the home hero gradient.
 * ----------------------------------------------------------------------- */
.qv-body .qv-esplora-head {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	padding: var(--qv-sp-7) 0 var(--qv-sp-6);
	background: linear-gradient(180deg, var(--qv-green-50), var(--qv-neutral-0) 92%);
	border-bottom: 1px solid var(--qv-border);
}
/* Soft brand glow, same recipe as the home .qv-hero__bg radial accents. */
.qv-body .qv-esplora-head::before {
	content: '';
	position: absolute;
	inset: 0;
	background:
		radial-gradient(ellipse 70% 55% at 88% -10%, rgba(34, 197, 94, 0.16), transparent 60%),
		radial-gradient(ellipse 70% 55% at -5% 120%, rgba(0, 103, 215, 0.12), transparent 60%);
	z-index: -1;
}
.qv-body .qv-esplora-head__eyebrow {
	display: inline-flex;
	align-items: center;
	gap: var(--qv-sp-2);
	margin: 0 0 var(--qv-sp-2);
	font-size: var(--qv-fs-sm);
	font-weight: var(--qv-fw-semibold);
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--qv-green-700);
}
.qv-body .qv-esplora-head__eyebrow::before {
	content: '';
	width: 22px;
	height: 2px;
	border-radius: var(--qv-r-full);
	background: var(--qv-green-600);
}
.qv-body .qv-esplora-head h1 {
	margin: 0;
	font-size: clamp(1.875rem, 4vw + 1rem, var(--qv-fs-4xl));
	font-weight: var(--qv-fw-extra);
	letter-spacing: -0.02em;
	line-height: var(--qv-lh-tight);
	max-width: 20ch;
}
.qv-body .qv-esplora-head__sub {
	margin: var(--qv-sp-3) 0 0;
	font-size: var(--qv-fs-md);
	color: var(--qv-fg-muted);
	max-width: 56ch;
}

.qv-body .qv-esplora-body {
	padding: var(--qv-sp-6) 0 var(--qv-sp-8);
	background: var(--qv-bg-alt);
}

@media (min-width: 768px) {
	.qv-body .qv-esplora-head { padding: var(--qv-sp-8) 0 var(--qv-sp-7); }
}

/* -------------------------------------------------------------------------
 * BROWSE STATE — Esplora is always a catalogue with filters.
 * ----------------------------------------------------------------------- */
.qv-body .qv-results--browse .qv-results__main {
	min-width: 0;
}
.qv-body .qv-results__browse-head {
	position: relative;
	overflow: hidden;
	background:
		linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(238, 252, 242, 0.96)),
		var(--qv-neutral-0);
}
.qv-body .qv-results__browse-head::after {
	content: '';
	position: absolute;
	right: -40px;
	top: -70px;
	width: 170px;
	height: 170px;
	border-radius: var(--qv-r-full);
	background: radial-gradient(circle, rgba(0, 103, 215, 0.12), transparent 68%);
	pointer-events: none;
}
.qv-body .qv-results__browse-head h2 {
	font-weight: var(--qv-fw-extra);
	color: var(--qv-fg);
}
.qv-body .qv-results__inspire .qv-grid--poi {
	grid-template-columns: 1fr;
}

/* -------------------------------------------------------------------------
 * SIDEBAR — refined container around the (Agent 2) compact form.
 * We style only the wrapper, never the form internals.
 * ----------------------------------------------------------------------- */
.qv-body .qv-results__sidebar {
	box-shadow: var(--qv-shadow-sm);
	border-color: rgba(0, 103, 215, 0.12);
	border-radius: 22px;
	background:
		linear-gradient(180deg, rgba(236, 255, 208, 0.42), rgba(255, 255, 255, 0.96) 38%),
		var(--qv-neutral-0);
}
.qv-body .qv-results__sidebar-toggle {
	font-size: var(--qv-fs-base);
	gap: var(--qv-sp-2);
	min-height: 52px;
	padding: var(--qv-sp-3) var(--qv-sp-5);
	background: var(--qv-neutral-0);
}
.qv-body .qv-results__sidebar-toggle:hover,
.qv-body .qv-results__sidebar-toggle:focus-visible {
	background: var(--qv-green-50);
	color: var(--qv-green-800);
}
.qv-body .qv-results__filters {
	padding: clamp(var(--qv-sp-4), 3vw, var(--qv-sp-5));
}
.qv-body .qv-results__filter-intro {
	margin-bottom: var(--qv-sp-5);
	padding: 0 0 var(--qv-sp-4);
	border-bottom-color: rgba(0, 103, 215, 0.12);
}
.qv-body .qv-results__filter-intro h2 {
	font-weight: var(--qv-fw-extra);
}
.qv-body .qv-results__filter-intro p {
	line-height: var(--qv-lh-relaxed);
}
.qv-body .qv-results__filter-locked .qv-btn {
	min-height: 44px;
	white-space: normal;
	text-align: center;
}
.qv-body .qv-results__filter-locked .qv-btn--primary,
.qv-body .qv-results__filter-locked .qv-btn--primary:hover,
.qv-body .qv-results__filter-locked .qv-btn--primary:focus-visible {
	color: var(--qv-neutral-0);
}
.qv-body .qv-search-form--filters {
	gap: var(--qv-sp-5);
}
.qv-body .qv-search-form--filters .qv-search-form__location-wrap {
	gap: var(--qv-sp-2);
}
.qv-body .qv-search-form--filters .qv-search-form__location {
	font-size: var(--qv-fs-sm);
	padding-left: calc(var(--qv-sp-5) + var(--qv-sp-2));
}
.qv-body .qv-search-form--filters .qv-search-form__location::placeholder {
	font-size: var(--qv-fs-sm);
}
.qv-body .qv-search-form--filters .qv-chips {
	gap: var(--qv-sp-2);
}
.qv-body .qv-search-form--filters .qv-chip {
	padding: var(--qv-sp-2) var(--qv-sp-3);
	font-size: var(--qv-fs-sm);
	min-height: 36px;
	max-width: 100%;
}
.qv-body .qv-search-form--filters .qv-search-form__row--zone {
	background: var(--qv-neutral-0);
	border-color: rgba(0, 103, 215, 0.12);
	border-radius: 18px;
	overflow: hidden;
}
.qv-body .qv-search-form--filters .qv-search-form__row--zone summary {
	min-height: 48px;
	align-items: center;
	gap: var(--qv-sp-2);
}
.qv-body .qv-search-form--filters .qv-search-form__radius-scale {
	padding-inline: 1px;
}
.qv-body .qv-search-form--filters .qv-search-form__submit {
	min-width: 0;
	width: 100%;
	min-height: 46px;
}

@media (min-width: 1024px) {
	.qv-body .qv-results__sidebar {
		box-shadow: var(--qv-shadow);
		overflow-x: hidden;
	}
	.qv-body .qv-results__inspire .qv-grid--poi {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

/* -------------------------------------------------------------------------
 * RESULTS HEAD — count + origin + view toggle, more confident hierarchy.
 * ----------------------------------------------------------------------- */
.qv-body .qv-results__count {
	font-size: var(--qv-fs-xl);
	font-weight: var(--qv-fw-extra);
	letter-spacing: -0.01em;
	color: var(--qv-fg);
}
.qv-body .qv-results__origin {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--qv-sp-1);
}
.qv-body .qv-results__origin strong { color: var(--qv-green-700); }

/* View toggle: pill segmented control on a tinted track. */
.qv-body .qv-results__view-toggle {
	gap: 2px;
	padding: 3px;
	border: 1px solid var(--qv-border);
	border-radius: var(--qv-r-full);
	background: var(--qv-neutral-100);
}
.qv-body .qv-results__view {
	border: 0;
	border-radius: var(--qv-r-full);
	padding: var(--qv-sp-2) var(--qv-sp-4);
	background: transparent;
	color: var(--qv-fg-muted);
	font-weight: var(--qv-fw-semibold);
	transition: background var(--qv-tr-fast), color var(--qv-tr-fast), box-shadow var(--qv-tr-fast);
}
.qv-body .qv-results__view:hover { color: var(--qv-green-700); }
.qv-body .qv-results__view.is-active {
	background: var(--qv-neutral-0);
	color: var(--qv-green-700);
	box-shadow: var(--qv-shadow-sm);
}

/* -------------------------------------------------------------------------
 * MAP WRAP — softer frame, consistent rounding.
 * ----------------------------------------------------------------------- */
.qv-body .qv-results__map-wrap {
	box-shadow: var(--qv-shadow-sm);
}

/* -------------------------------------------------------------------------
 * CARDS — premium discovery cards. Refines qv-discovery base, no class
 * changes (PHP partial + JS template stay structurally identical).
 * ----------------------------------------------------------------------- */
.qv-body .qv-card {
	border-radius: var(--qv-r-lg);
	box-shadow: var(--qv-shadow-sm);
}
.qv-body .qv-card:hover {
	transform: translateY(-3px);
	box-shadow: var(--qv-shadow-lg);
	border-color: var(--qv-green-200);
}

/* Media: gentle gradient scrim at the bottom so overlaid pills stay legible. */
.qv-body .qv-card__media::after {
	content: '';
	position: absolute;
	inset: 0;
	pointer-events: none;
	background: linear-gradient(180deg, rgba(0, 0, 0, 0.16) 0%, transparent 28%, transparent 100%);
	opacity: 0;
	transition: opacity var(--qv-tr-normal);
}
.qv-body .qv-card:hover .qv-card__media::after { opacity: 1; }

.qv-body .qv-card__media-placeholder {
	position: relative;
	background:
		radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.5), transparent 55%),
		linear-gradient(135deg, var(--qv-green-100) 0%, var(--qv-blue-100) 100%);
}
/* Little compass mark in the placeholder so empty media still feels branded. */
.qv-body .qv-card__media-placeholder::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 34px;
	height: 34px;
	transform: translate(-50%, -50%);
	border-radius: var(--qv-r-full);
	border: 2px solid rgba(22, 163, 74, 0.35);
	box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.45);
}

.qv-body .qv-card__body { gap: var(--qv-sp-3); padding: var(--qv-sp-5); }

.qv-body .qv-card__title {
	font-size: var(--qv-fs-lg);
	font-weight: var(--qv-fw-extra);
	letter-spacing: -0.01em;
}

/* Pills: clearer affordances with subtle inset borders. */
.qv-body .qv-card__pill {
	gap: var(--qv-sp-1);
	padding: 3px var(--qv-sp-3);
	font-weight: var(--qv-fw-semibold);
}
.qv-body .qv-card__pill--zona {
	background: var(--qv-green-50);
	color: var(--qv-green-800);
	box-shadow: inset 0 0 0 1px var(--qv-green-100);
}
.qv-body .qv-card__pill--durata {
	background: var(--qv-blue-50);
	color: var(--qv-blue-700);
	box-shadow: inset 0 0 0 1px var(--qv-blue-100);
}
/* Distance pill: frosted dark chip pinned over the media. */
.qv-body .qv-card__pill--distance {
	top: var(--qv-sp-3);
	left: var(--qv-sp-3);
	z-index: 1;
	background: rgba(23, 23, 23, 0.72);
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
	box-shadow: var(--qv-shadow-sm);
}

.qv-body .qv-card__excerpt {
	line-height: var(--qv-lh-snug);
	color: var(--qv-fg-muted);
}

/* Actions: primary "Scopri" grows, pick button is a clear secondary. */
.qv-body .qv-card__actions {
	margin-top: var(--qv-sp-4);
	padding-top: var(--qv-sp-4);
	border-top: 1px solid var(--qv-border);
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--qv-sp-2);
	align-items: stretch;
}
.qv-body .qv-card__actions .qv-btn {
	width: 100%;
	min-width: 0;
	min-height: 42px;
	justify-content: center;
	text-align: center;
	white-space: normal;
	line-height: 1.15;
}
.qv-body .qv-card__actions .qv-btn--primary {
	flex: none;
	background: var(--qv-blue-600);
	border-color: var(--qv-blue-600);
	color: var(--qv-neutral-0);
}
.qv-body .qv-card__actions .qv-btn--primary:hover,
.qv-body .qv-card__actions .qv-btn--primary:focus-visible {
	background: var(--qv-blue-700);
	border-color: var(--qv-blue-700);
	color: var(--qv-neutral-0);
}

/* -------------------------------------------------------------------------
 * PICK AFFORDANCE — the core step-2 of the funnel ("build my day").
 * Inviting by default; satisfying confirmed state. JS contract untouched:
 * it still just toggles .is-picked + swaps the <span> text.
 * ----------------------------------------------------------------------- */
.qv-body .qv-card__pick {
	flex: none;
	gap: var(--qv-sp-2);
	border-color: var(--qv-green-600);
	color: var(--qv-green-700);
	background: var(--qv-neutral-0);
	font-weight: var(--qv-fw-semibold);
}
.qv-body .qv-card__pick svg {
	transition: transform var(--qv-tr-normal);
}
.qv-body .qv-card__pick:hover,
.qv-body .qv-card__pick:focus-visible {
	background: var(--qv-green-50);
	border-color: var(--qv-green-700);
	color: var(--qv-green-800);
}
.qv-body .qv-card__pick:hover svg { transform: rotate(90deg); }

/* Picked: filled, confident "in your day" state. */
.qv-body .qv-card__pick.is-picked {
	background: var(--qv-green-600);
	border-color: var(--qv-green-600);
	color: var(--qv-neutral-0);
}
.qv-body .qv-card__pick.is-picked:hover,
.qv-body .qv-card__pick.is-picked:focus-visible {
	background: var(--qv-green-700);
	border-color: var(--qv-green-700);
	color: var(--qv-neutral-0);
}
.qv-body .qv-card__pick.is-picked svg { transform: rotate(0deg); }

@media (min-width: 520px) {
	.qv-body .qv-card__actions {
		grid-template-columns: minmax(0, 1fr) minmax(118px, auto);
	}
}

@media (min-width: 1024px) {
	.qv-body .qv-card__actions {
		grid-template-columns: 1fr;
	}
}

@media (min-width: 1600px) {
	.qv-body .qv-card__actions {
		grid-template-columns: minmax(0, 1fr) minmax(112px, auto);
	}
	.qv-body .qv-card__pick {
		padding-inline: var(--qv-sp-3);
	}
}

/* -------------------------------------------------------------------------
 * ATTIVITÀ CARD — same family; lift the tier badge + sconto pill.
 * ----------------------------------------------------------------------- */
.qv-body .qv-card--attivita .qv-card__media { display: block; }
.qv-body .qv-tier-badge {
	position: absolute;
	top: var(--qv-sp-3);
	left: var(--qv-sp-3);
	z-index: 1;
	display: inline-flex;
	align-items: center;
	padding: 3px var(--qv-sp-3);
	border-radius: var(--qv-r-full);
	font-size: var(--qv-fs-xs);
	font-weight: var(--qv-fw-bold);
	letter-spacing: 0.02em;
	color: var(--qv-neutral-0);
	background: var(--qv-green-700);
	box-shadow: var(--qv-shadow-sm);
}
.qv-body .qv-tier-badge--ambassador { background: linear-gradient(135deg, var(--qv-green-600), var(--qv-blue-600)); }
.qv-body .qv-tier-badge--partner    { background: var(--qv-blue-600); }
.qv-body .qv-tier-badge--friend     { background: var(--qv-green-600); }
.qv-body .qv-tier-badge--consigliata{ background: var(--qv-warning); }

.qv-body .qv-card--attivita .qv-card__meta {
	font-size: var(--qv-fs-sm);
	color: var(--qv-fg-muted);
}
.qv-body .qv-card--attivita .qv-card__zona { font-weight: var(--qv-fw-semibold); color: var(--qv-green-800); }
.qv-body .qv-pill--sconto {
	align-self: flex-start;
	margin: var(--qv-sp-1) 0 0;
	padding: 3px var(--qv-sp-3);
	border-radius: var(--qv-r-full);
	font-size: var(--qv-fs-xs);
	font-weight: var(--qv-fw-bold);
	background: var(--qv-warning-bg);
	color: var(--qv-warning);
}

/* -------------------------------------------------------------------------
 * EMPTY / ERROR STATES — warmer, on-brand, with an icon mark.
 * ----------------------------------------------------------------------- */
.qv-body .qv-results__empty,
.qv-body .qv-results__error {
	background: var(--qv-neutral-0);
	border: 1px solid var(--qv-border);
	box-shadow: var(--qv-shadow-sm);
	padding: var(--qv-sp-7) var(--qv-sp-6);
}
.qv-body .qv-results__empty::before,
.qv-body .qv-results__error::before {
	content: '';
	display: block;
	width: 56px;
	height: 56px;
	margin: 0 auto var(--qv-sp-4);
	border-radius: var(--qv-r-full);
	background: var(--qv-green-50);
	background-repeat: no-repeat;
	background-position: center;
	background-size: 28px 28px;
}
.qv-body .qv-results__empty::before {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2316a34a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E");
}
.qv-body .qv-results__error::before {
	background: var(--qv-danger-bg);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23dc2626' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 9v4M12 17h.01'/%3E%3Cpath d='M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: center;
	background-size: 28px 28px;
}
.qv-body .qv-results__empty h3,
.qv-body .qv-results__error h3 {
	font-weight: var(--qv-fw-extra);
	letter-spacing: -0.01em;
}
.qv-body .qv-results__empty-suggest .qv-chip { cursor: pointer; }

/* Load-more: make it feel like a deliberate "see more" affordance. */
.qv-body .qv-results__more { margin-top: var(--qv-sp-6); }
.qv-body .qv-results__more .qv-btn { min-width: 220px; }

/* -------------------------------------------------------------------------
 * SKELETON — round the line ends to match the new card radius.
 * ----------------------------------------------------------------------- */
.qv-body .qv-card--skeleton { box-shadow: var(--qv-shadow-sm); }
.qv-body .qv-skel { border-radius: var(--qv-r-full); }
.qv-body .qv-skel--title { border-radius: var(--qv-r-sm); }

/* -------------------------------------------------------------------------
 * MAP POPUP — tighten the mini-card to match the new cards.
 * ----------------------------------------------------------------------- */
.qv-body .qv-map-popup__title { font-weight: var(--qv-fw-extra); }

/* -------------------------------------------------------------------------
 * REDUCED MOTION
 * ----------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
	.qv-body .qv-card,
	.qv-body .qv-card:hover,
	.qv-body .qv-card__pick svg,
	.qv-body .qv-card__media::after {
		transition: none;
		transform: none;
	}
}
