/**
 * Rivenditori – stili front-end.
 * Tutte le regole sono isolate nel contenitore .rvnd.
 */

.rvnd,
.rvnd *,
.rvnd *::before,
.rvnd *::after {
	box-sizing: border-box;
}

.rvnd {
	--rvnd-bg: #ffffff;
	--rvnd-surface: #f7f6f2;
	--rvnd-border: rgba(17, 24, 39, 0.12);
	--rvnd-border-strong: rgba(17, 24, 39, 0.22);
	--rvnd-text: #12161d;
	--rvnd-muted: #66707d;
	--rvnd-accent: #0c6b58;
	--rvnd-accent-strong: #095446;
	--rvnd-accent-soft: rgba(12, 107, 88, 0.09);
	--rvnd-on-accent: #ffffff;
	--rvnd-focus: rgba(12, 107, 88, 0.22);
	--rvnd-shadow: 0 2px 4px rgba(16, 24, 40, 0.04), 0 18px 40px -18px rgba(16, 24, 40, 0.28);
	--rvnd-radius: 14px;
	--rvnd-radius-lg: 18px;
	position: relative;
	width: 100%;
	max-width: 680px;
	color: var(--rvnd-text);
	font-family: inherit;
	font-size: 16px;
	font-weight: 400;
	line-height: 1.5;
	text-align: left;
	-webkit-font-smoothing: antialiased;
}

.rvnd p,
.rvnd h3,
.rvnd ul,
.rvnd li {
	margin: 0;
	padding: 0;
}

.rvnd ul {
	list-style: none;
}

.rvnd a {
	text-decoration: none;
}

/* ---------------------------------------------------------------
 * Campo di ricerca
 * --------------------------------------------------------------- */

.rvnd__search {
	position: relative;
}

.rvnd__label {
	display: block;
	margin: 0 0 9px;
	color: var(--rvnd-muted);
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.09em;
	line-height: 1.4;
	text-transform: uppercase;
}

.rvnd__field {
	position: relative;
}

.rvnd__control {
	display: flex;
	align-items: center;
	gap: 4px;
	height: 56px;
	padding: 0 8px 0 46px;
	background: var(--rvnd-bg);
	border: 1px solid var(--rvnd-border);
	border-radius: var(--rvnd-radius);
	box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
	transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.rvnd__control:focus-within {
	border-color: var(--rvnd-accent);
	box-shadow: 0 0 0 4px var(--rvnd-focus);
}

.rvnd__icon {
	position: absolute;
	left: 16px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--rvnd-muted);
	pointer-events: none;
	transition: color 0.18s ease;
}

.rvnd__control:focus-within .rvnd__icon {
	color: var(--rvnd-accent);
}

.rvnd__icon svg {
	display: block;
	width: 19px;
	height: 19px;
}

.rvnd__input {
	flex: 1 1 auto;
	width: 100%;
	min-width: 0;
	height: 100%;
	margin: 0;
	padding: 0;
	background: transparent;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	color: var(--rvnd-text);
	font-family: inherit;
	font-size: 1rem;
	font-weight: 400;
	line-height: 1.4;
	-webkit-appearance: none;
	appearance: none;
}

.rvnd__input:focus {
	outline: none;
	box-shadow: none;
}

.rvnd__input::placeholder {
	color: var(--rvnd-muted);
	opacity: 0.8;
}

.rvnd__clear,
.rvnd__toggle {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	margin: 0;
	padding: 0;
	background: transparent;
	border: 0;
	border-radius: 999px;
	box-shadow: none;
	color: var(--rvnd-muted);
	cursor: pointer;
	transition: background-color 0.18s ease, color 0.18s ease;
}

.rvnd__clear:hover,
.rvnd__toggle:hover {
	background: var(--rvnd-accent-soft);
	color: var(--rvnd-accent);
}

.rvnd__clear:focus-visible,
.rvnd__toggle:focus-visible {
	outline: 2px solid var(--rvnd-accent);
	outline-offset: 2px;
}

.rvnd__clear svg,
.rvnd__toggle svg {
	display: block;
	width: 18px;
	height: 18px;
}

.rvnd__toggle svg {
	transition: transform 0.2s ease;
}

.rvnd.is-open .rvnd__toggle svg {
	transform: rotate(180deg);
}

.rvnd__clear[hidden] {
	display: none;
}

/* ---------------------------------------------------------------
 * Elenco a tendina
 * --------------------------------------------------------------- */

.rvnd__list {
	position: absolute;
	top: calc(100% + 8px);
	right: 0;
	left: 0;
	z-index: 9999;
	max-height: 324px;
	margin: 0;
	padding: 6px;
	overflow-y: auto;
	overscroll-behavior: contain;
	background: var(--rvnd-bg);
	border: 1px solid var(--rvnd-border);
	border-radius: var(--rvnd-radius);
	box-shadow: var(--rvnd-shadow);
	animation: rvnd-pop 0.16s ease-out;
}

.rvnd__list[hidden] {
	display: none;
}

.rvnd__option {
	display: flex;
	flex-direction: column;
	gap: 1px;
	padding: 11px 12px;
	border-radius: 10px;
	cursor: pointer;
	transition: background-color 0.12s ease;
}

.rvnd__option + .rvnd__option {
	margin-top: 2px;
}

.rvnd__option.is-active {
	background: var(--rvnd-accent-soft);
}

.rvnd__option[aria-selected="true"] .rvnd__option-city {
	color: var(--rvnd-accent);
}

.rvnd__option-city {
	color: var(--rvnd-text);
	font-size: 0.95rem;
	font-weight: 600;
	letter-spacing: -0.01em;
	line-height: 1.35;
}

.rvnd__option-meta {
	color: var(--rvnd-muted);
	font-size: 0.8125rem;
	line-height: 1.4;
}

.rvnd__empty,
.rvnd__more {
	padding: 14px 12px;
	color: var(--rvnd-muted);
	font-size: 0.875rem;
	line-height: 1.45;
}

.rvnd__more {
	padding-top: 8px;
	padding-bottom: 10px;
	border-top: 1px solid var(--rvnd-border);
}

/* ---------------------------------------------------------------
 * Scheda del rivenditore
 * --------------------------------------------------------------- */

.rvnd__result {
	margin-top: 18px;
}

.rvnd__result[hidden] {
	display: none;
}

.rvnd__card {
	padding: 22px;
	background: var(--rvnd-surface);
	border: 1px solid var(--rvnd-border);
	border-radius: var(--rvnd-radius-lg);
	animation: rvnd-rise 0.34s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

.rvnd__name {
	margin: 0 0 7px;
	color: var(--rvnd-accent);
	font-size: 0.6875rem;
	font-weight: 700;
	letter-spacing: 0.11em;
	line-height: 1.4;
	text-transform: uppercase;
}

.rvnd__city {
	color: var(--rvnd-text);
	font-size: 1.625rem;
	font-weight: 700;
	letter-spacing: -0.025em;
	line-height: 1.15;
}

.rvnd__street {
	margin-top: 5px;
	color: var(--rvnd-muted);
	font-size: 0.9375rem;
	line-height: 1.5;
}

.rvnd__phone {
	display: flex;
	flex-direction: column;
	gap: 2px;
	margin-top: 18px;
	padding-top: 16px;
	border-top: 1px solid var(--rvnd-border);
}

.rvnd__phone-label {
	color: var(--rvnd-muted);
	font-size: 0.6875rem;
	font-weight: 600;
	letter-spacing: 0.1em;
	line-height: 1.4;
	text-transform: uppercase;
}

.rvnd__phone-number {
	align-self: flex-start;
	color: var(--rvnd-text);
	font-size: 1.5rem;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	letter-spacing: -0.02em;
	line-height: 1.25;
	transition: color 0.16s ease;
}

.rvnd__phone-number:hover {
	color: var(--rvnd-accent);
}

.rvnd__note {
	margin-top: 14px;
	color: var(--rvnd-muted);
	font-size: 0.875rem;
}

.rvnd__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 20px;
}

.rvnd__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	height: 44px;
	margin: 0;
	padding: 0 18px;
	border: 1px solid transparent;
	border-radius: 12px;
	font-family: inherit;
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.18s ease, border-color 0.18s ease,
		color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.rvnd__btn svg {
	display: block;
	flex: 0 0 auto;
	width: 17px;
	height: 17px;
}

.rvnd__btn--primary {
	background: var(--rvnd-accent);
	box-shadow: 0 1px 2px rgba(8, 40, 32, 0.2);
	color: var(--rvnd-on-accent);
}

.rvnd__btn--primary:hover {
	background: var(--rvnd-accent-strong);
	box-shadow: 0 4px 12px -4px rgba(8, 40, 32, 0.45);
	color: var(--rvnd-on-accent);
	transform: translateY(-1px);
}

.rvnd__btn--ghost {
	background: transparent;
	border-color: var(--rvnd-border-strong);
	color: var(--rvnd-text);
}

.rvnd__btn--ghost:hover {
	background: var(--rvnd-accent-soft);
	border-color: var(--rvnd-accent);
	color: var(--rvnd-accent);
	transform: translateY(-1px);
}

.rvnd__btn:focus-visible {
	outline: 2px solid var(--rvnd-accent);
	outline-offset: 2px;
}

.rvnd__btn:active {
	transform: translateY(0);
}

/* ---------------------------------------------------------------
 * Utility
 * --------------------------------------------------------------- */

.rvnd__sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

.rvnd-empty {
	max-width: 680px;
	margin: 0;
	padding: 18px 20px;
	color: #66707d;
	font-size: 0.9375rem;
	line-height: 1.5;
	background: #f7f6f2;
	border: 1px solid rgba(17, 24, 39, 0.12);
	border-radius: 14px;
}

.rvnd__fallback {
	margin-top: 18px !important;
	padding-left: 18px !important;
	color: inherit;
	list-style: disc;
}

.rvnd__fallback li {
	margin: 0 0 8px !important;
	line-height: 1.5;
}

/* ---------------------------------------------------------------
 * Tema scuro
 * --------------------------------------------------------------- */

.rvnd[data-theme="scuro"] {
	--rvnd-bg: #15181e;
	--rvnd-surface: #1a1f27;
	--rvnd-border: rgba(255, 255, 255, 0.13);
	--rvnd-border-strong: rgba(255, 255, 255, 0.24);
	--rvnd-text: #f1f4f8;
	--rvnd-muted: #9aa3b2;
	--rvnd-accent: #43c7a9;
	--rvnd-accent-strong: #5fd6bb;
	--rvnd-accent-soft: rgba(67, 199, 169, 0.13);
	--rvnd-on-accent: #06221b;
	--rvnd-focus: rgba(67, 199, 169, 0.25);
	--rvnd-shadow: 0 2px 4px rgba(0, 0, 0, 0.3), 0 18px 40px -18px rgba(0, 0, 0, 0.8);
}

/* ---------------------------------------------------------------
 * Animazioni e responsive
 * --------------------------------------------------------------- */

@keyframes rvnd-pop {
	from {
		opacity: 0;
		transform: translateY(-4px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes rvnd-rise {
	from {
		opacity: 0;
		transform: translateY(6px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@media (max-width: 480px) {
	.rvnd__card {
		padding: 18px;
	}

	.rvnd__city {
		font-size: 1.4375rem;
	}

	.rvnd__phone-number {
		font-size: 1.375rem;
	}

	.rvnd__list {
		max-height: 280px;
	}
}

@media (max-width: 420px) {
	.rvnd__actions {
		flex-direction: column;
	}

	.rvnd__btn {
		width: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.rvnd *,
	.rvnd *::before,
	.rvnd *::after {
		animation-duration: 0.001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.001ms !important;
		scroll-behavior: auto !important;
	}
}
