/* ==========================================================================
   Joyee Spa - Pagina Rivenditori
   ========================================================================== */

.rivenditori-page {
	--riv-color-dark: var(--wp--preset--color--dark, #181818);
	--riv-color-primary: var(--wp--preset--color--primary, #c89b5a);
	--riv-color-accent: var(--wp--preset--color--accent, #8a5a2b);
	--riv-color-soft: var(--wp--preset--color--soft, #faf7f2);
	--riv-color-muted: var(--wp--preset--color--muted, #f4efe8);
	--riv-color-bg: var(--wp--preset--color--bg, #ffffff);
	--riv-color-water: var(--wp--preset--color--water, #7fafc3);

	--riv-pin-existing: #168a4a;
	--riv-pin-upcoming: #d9a400;
	--riv-pin-cat: #1976d2;

	--riv-shadow-soft: 0 18px 48px rgba(24, 24, 24, 0.08);
	--riv-shadow-card: 0 14px 36px rgba(24, 24, 24, 0.07);

	--riv-radius-lg: 28px;
	--riv-radius-md: 18px;
	--riv-radius-sm: 12px;
}

.rivenditori-page .container {
	width: min(1180px, calc(100% - 32px));
	margin-inline: auto;
}

/* ==========================================================================
   Hero
   ========================================================================== */

.rivenditori-hero {
	position: relative;
	overflow: hidden;
	padding: clamp(5rem, 9vw, 8rem) 0 clamp(3rem, 6vw, 5rem);
	background:
		radial-gradient(circle at 18% 20%, rgba(127, 175, 195, 0.22), transparent 34%),
		linear-gradient(135deg, #fff 0%, var(--riv-color-soft) 48%, #f1e7da 100%);
}

.rivenditori-hero::before {
	content: "";
	position: absolute;
	inset: auto -14vw -22vw auto;
	width: 46vw;
	height: 46vw;
	border-radius: 999px;
	background: rgba(200, 155, 90, 0.14);
	pointer-events: none;
}

.rivenditori-hero::after {
	content: "";
	position: absolute;
	inset: -18vw auto auto -18vw;
	width: 42vw;
	height: 42vw;
	border-radius: 999px;
	background: rgba(127, 175, 195, 0.12);
	pointer-events: none;
}

.rivenditori-hero__inner {
	position: relative;
	z-index: 1;
	display: block;
}

.rivenditori-hero__content {
	max-width: 800px;
}

.rivenditori-page .eyebrow {
	margin: 0 0 0.75rem;
	color: var(--riv-color-primary);
	font-size: 0.82rem;
	font-weight: 700;
	letter-spacing: 0.16em;
	text-transform: uppercase;
}

.rivenditori-hero h1 {
	max-width: 800px;
	margin: 0;
	font-size: clamp(2.6rem, 6vw, 5.4rem);
	line-height: 0.96;
	letter-spacing: -0.04em;
}

.rivenditori-hero__content > p:not(.eyebrow) {
	max-width: 660px;
	margin: 1.4rem 0 0;
	color: rgba(24, 24, 24, 0.76);
	font-size: clamp(1.02rem, 1.4vw, 1.22rem);
	line-height: 1.7;
}

.rivenditori-hero__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.85rem;
	margin-top: 2rem;
}

.rivenditori-page .button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	padding: 0.85rem 1.25rem;
	border: 1px solid transparent;
	border-radius: 999px;
	font-size: 0.92rem;
	font-weight: 700;
	line-height: 1;
	text-decoration: none;
	transition:
		transform 180ms ease,
		background-color 180ms ease,
		border-color 180ms ease,
		color 180ms ease,
		box-shadow 180ms ease;
}

.rivenditori-page .button:hover,
.rivenditori-page .button:focus-visible {
	transform: translateY(-2px);
	text-decoration: none;
}

.rivenditori-page .button-primary {
	background: var(--riv-color-dark);
	color: #fff;
	box-shadow: 0 14px 28px rgba(24, 24, 24, 0.16);
}

.rivenditori-page .button-primary:hover,
.rivenditori-page .button-primary:focus-visible {
	background: var(--riv-color-primary);
	color: #fff;
	box-shadow: 0 18px 32px rgba(200, 155, 90, 0.26);
}

.rivenditori-page .button-secondary {
	background: rgba(255, 255, 255, 0.58);
	color: var(--riv-color-dark);
	border-color: rgba(24, 24, 24, 0.12);
	backdrop-filter: blur(10px);
}

.rivenditori-page .button-secondary:hover,
.rivenditori-page .button-secondary:focus-visible {
	background: #fff;
	border-color: rgba(200, 155, 90, 0.52);
	color: var(--riv-color-accent);
}

/* ==========================================================================
   Network section
   ========================================================================== */

.rivenditori-network {
	padding: clamp(3.5rem, 7vw, 6rem) 0;
	background: #fff;
}

.section-header {
	max-width: 780px;
	margin-bottom: 2rem;
}

.section-header h2 {
	margin: 0;
	font-size: clamp(2rem, 4vw, 3.5rem);
	line-height: 1;
	letter-spacing: -0.03em;
}

.section-header p:not(.eyebrow) {
	margin: 1rem 0 0;
	color: rgba(24, 24, 24, 0.7);
	font-size: 1.03rem;
	line-height: 1.75;
}

.rivenditori-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem 1rem;
	align-items: center;
	width: fit-content;
	max-width: 100%;
	margin-bottom: 1.2rem;
	padding: 0.85rem 1rem;
	border: 1px solid rgba(24, 24, 24, 0.08);
	border-radius: 999px;
	background: var(--riv-color-soft);
}

.rivenditori-legend span {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	color: rgba(24, 24, 24, 0.72);
	font-size: 0.9rem;
	font-weight: 650;
	line-height: 1.2;
}

/* ==========================================================================
   Map
   ========================================================================== */

.rivenditori-map {
	position: relative;
	z-index: 1;
	width: 100%;
	height: clamp(360px, 54vw, 620px);
	margin: 0 0 clamp(2rem, 5vw, 4rem);
	overflow: hidden;
	border: 1px solid rgba(24, 24, 24, 0.08);
	border-radius: var(--riv-radius-lg);
	background: var(--riv-color-muted);
	box-shadow: var(--riv-shadow-soft);
}

.rivenditori-map--empty {
	display: grid;
	place-items: center;
	min-height: 320px;
	height: auto;
	padding: 2rem;
	text-align: center;
}

.rivenditori-map--empty p {
	max-width: 560px;
	margin: 0;
	color: rgba(24, 24, 24, 0.7);
}

.rivenditori-map .leaflet-control-container {
	font-family: inherit;
}

.rivenditori-map .leaflet-control-zoom {
	overflow: hidden;
	border: 0;
	border-radius: 14px;
	box-shadow: 0 12px 28px rgba(24, 24, 24, 0.12);
}

.rivenditori-map .leaflet-control-zoom a {
	width: 36px;
	height: 36px;
	border: 0;
	color: var(--riv-color-dark);
	line-height: 36px;
}

.rivenditori-map .leaflet-control-attribution {
	font-size: 0.68rem;
}

/* ==========================================================================
   Pins / markers
   ========================================================================== */

.pin {
	display: inline-block;
	width: 0.72rem;
	height: 0.72rem;
	border-radius: 999px;
	background: var(--riv-pin-existing);
	box-shadow: 0 0 0 4px rgba(22, 138, 74, 0.12);
}

.pin--existing {
	background: var(--riv-pin-existing);
	box-shadow: 0 0 0 4px rgba(22, 138, 74, 0.12);
}

.pin--upcoming {
	background: var(--riv-pin-upcoming);
	box-shadow: 0 0 0 4px rgba(217, 164, 0, 0.14);
}

.pin--cat {
	background: var(--riv-pin-cat);
	box-shadow: 0 0 0 4px rgba(25, 118, 210, 0.14);
}

.joyee-marker {
	background: transparent;
	border: 0;
}

.joyee-marker__pin {
	position: relative;
	display: block;
	width: 26px;
	height: 26px;
	border: 3px solid #fff;
	border-radius: 50% 50% 50% 0;
	background: var(--marker-color, #168a4a);
	box-shadow: 0 9px 20px rgba(24, 24, 24, 0.32);
	transform: rotate(-45deg);
}

.joyee-marker__pin::before {
	content: "";
	position: absolute;
	inset: 50% auto auto 50%;
	width: 8px;
	height: 8px;
	border-radius: 999px;
	background: #fff;
	transform: translate(-50%, -50%);
}

.joyee-marker__pin::after {
	content: "";
	position: absolute;
	inset: auto auto -11px 50%;
	width: 18px;
	height: 7px;
	border-radius: 50%;
	background: rgba(24, 24, 24, 0.24);
	filter: blur(2px);
	transform: translateX(-50%) rotate(45deg);
}

/* ==========================================================================
   Leaflet popup
   ========================================================================== */

.leaflet-popup-content-wrapper {
	border-radius: 18px;
	box-shadow: 0 18px 42px rgba(24, 24, 24, 0.22);
}

.leaflet-popup-content {
	width: min(260px, 70vw) !important;
	margin: 1rem 1.05rem;
	font-family: var(--wp--preset--font-family--inter, system-ui, sans-serif);
}

.dealer-popup {
	color: var(--riv-color-dark);
}

.dealer-popup__title {
	display: block;
	margin: 0 0 0.5rem;
	font-size: 1rem;
	font-weight: 800;
	line-height: 1.25;
}

.dealer-popup__address {
	margin: 0;
	color: rgba(24, 24, 24, 0.72);
	font-size: 0.9rem;
	line-height: 1.45;
	white-space: pre-line;
}

.dealer-popup__link {
	display: inline-flex;
	margin-top: 0.72rem;
	color: var(--riv-color-primary);
	font-size: 0.9rem;
	font-weight: 800;
	text-decoration: none;
}

.dealer-popup__link:hover,
.dealer-popup__link:focus-visible {
	color: var(--riv-color-accent);
	text-decoration: underline;
}

/* ==========================================================================
   Accordion
   ========================================================================== */

.rivenditori-accordion {
	display: grid;
	gap: 0.85rem;
}

.rivenditori-region {
	overflow: hidden;
	border: 1px solid rgba(24, 24, 24, 0.08);
	border-radius: var(--riv-radius-md);
	background: #fff;
	box-shadow: 0 10px 30px rgba(24, 24, 24, 0.05);
}

.rivenditori-region summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	min-height: 64px;
	padding: 1rem 1.25rem;
	color: var(--riv-color-dark);
	font-weight: 800;
	cursor: pointer;
	list-style: none;
	transition:
		background-color 180ms ease,
		color 180ms ease;
}

.rivenditori-region summary::-webkit-details-marker {
	display: none;
}

.rivenditori-region summary::after {
	content: "⌄";
	display: inline-grid;
	place-items: center;
	width: 32px;
	height: 32px;
	flex: 0 0 auto;
	border-radius: 999px;
	background: var(--riv-color-soft);
	color: var(--riv-color-primary);
	font-size: 1.1rem;
	line-height: 1;
	transition:
		transform 180ms ease,
		background-color 180ms ease;
}

.rivenditori-region[open] summary::after {
	transform: rotate(180deg);
	background: var(--riv-color-primary);
	color: #fff;
}

.rivenditori-region summary:hover,
.rivenditori-region summary:focus-visible {
	background: var(--riv-color-soft);
	outline: none;
}

.rivenditori-region summary span {
	font-size: clamp(1.05rem, 1.6vw, 1.28rem);
}

.rivenditori-region summary em {
	display: inline-grid;
	place-items: center;
	min-width: 34px;
	height: 28px;
	margin-left: auto;
	padding: 0 0.65rem;
	border-radius: 999px;
	background: rgba(200, 155, 90, 0.14);
	color: var(--riv-color-accent);
	font-size: 0.82rem;
	font-style: normal;
	font-weight: 800;
}

.rivenditori-region__content {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1rem;
	padding: 0 1.25rem 1.25rem;
}

/* ==========================================================================
   Dealer card
   ========================================================================== */

.dealer-card {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 1rem;
	min-height: 100%;
	padding: 1.2rem;
	border: 1px solid rgba(24, 24, 24, 0.08);
	border-radius: var(--riv-radius-md);
	background:
		linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(250, 247, 242, 0.5));
	box-shadow: 0 10px 24px rgba(24, 24, 24, 0.045);
	transition:
		transform 180ms ease,
		box-shadow 180ms ease,
		border-color 180ms ease;
}

.dealer-card:hover {
	transform: translateY(-3px);
	border-color: rgba(200, 155, 90, 0.26);
	box-shadow: 0 18px 40px rgba(24, 24, 24, 0.09);
}

.dealer-card::before {
	content: "";
	position: absolute;
	inset: 0 auto 0 0;
	width: 4px;
	border-radius: var(--riv-radius-md) 0 0 var(--riv-radius-md);
	background: var(--riv-pin-existing);
}

.dealer-card--upcoming::before {
	background: var(--riv-pin-upcoming);
}

.dealer-card--cat::before {
	background: var(--riv-pin-cat);
}

.dealer-card__header {
	padding-left: 0.25rem;
}

.dealer-card__status {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	margin: 0 0 0.65rem;
	color: rgba(24, 24, 24, 0.62);
	font-size: 0.78rem;
	font-weight: 800;
	letter-spacing: 0.08em;
	line-height: 1.2;
	text-transform: uppercase;
}

.dealer-card h3 {
	margin: 0;
	font-size: clamp(1.35rem, 2vw, 1.85rem);
	line-height: 1.05;
	letter-spacing: -0.025em;
}

.dealer-card h3 a {
	color: inherit;
	text-decoration: none;
}

.dealer-card h3 a:hover,
.dealer-card h3 a:focus-visible {
	color: var(--riv-color-primary);
	text-decoration: none;
}

.dealer-card__location {
	margin: 0.4rem 0 0;
	color: rgba(24, 24, 24, 0.62);
	font-size: 0.95rem;
	font-weight: 650;
}

.dealer-card__contacts {
	display: grid;
	gap: 0.8rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.dealer-card__contacts li {
	display: grid;
	gap: 0.12rem;
}

.dealer-card__contacts strong {
	color: rgba(24, 24, 24, 0.52);
	font-size: 0.74rem;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.dealer-card__contacts span,
.dealer-card__contacts a {
	color: rgba(24, 24, 24, 0.78);
	font-size: 0.96rem;
	line-height: 1.45;
}

.dealer-card__contacts a {
	width: fit-content;
	text-decoration: none;
}

.dealer-card__contacts a:hover,
.dealer-card__contacts a:focus-visible {
	color: var(--riv-color-primary);
	text-decoration: underline;
}

.dealer-card__link {
	display: inline-flex;
	align-items: center;
	width: fit-content;
	margin-top: auto;
	color: var(--riv-color-primary);
	font-size: 0.9rem;
	font-weight: 800;
	text-decoration: none;
}

.dealer-card__link::after {
	content: "→";
	margin-left: 0.45rem;
	transition: transform 180ms ease;
}

.dealer-card__link:hover,
.dealer-card__link:focus-visible {
	color: var(--riv-color-accent);
	text-decoration: none;
}

.dealer-card__link:hover::after,
.dealer-card__link:focus-visible::after {
	transform: translateX(3px);
}

.rivenditori-empty {
	padding: 2rem;
	border-radius: var(--riv-radius-md);
	background: var(--riv-color-soft);
	text-align: center;
}

.rivenditori-empty p {
	margin: 0;
	color: rgba(24, 24, 24, 0.68);
}

/* ==========================================================================
   CTA
   ========================================================================== */

.rivenditori-cta {
	padding: clamp(3.5rem, 7vw, 6rem) 0;
	background:
		linear-gradient(135deg, rgba(24, 24, 24, 0.94), rgba(24, 24, 24, 0.86)),
		radial-gradient(circle at 82% 18%, rgba(200, 155, 90, 0.4), transparent 34%);
	color: #fff;
}

.rivenditori-cta__inner {
	display: grid;
	grid-template-columns: minmax(0, 0.9fr) minmax(300px, 1fr);
	gap: clamp(2rem, 5vw, 4rem);
	align-items: start;
}

.rivenditori-cta .eyebrow {
	color: var(--riv-color-primary);
}

.rivenditori-cta h2 {
	margin: 0;
	color: #fff;
	font-size: clamp(2.1rem, 4vw, 3.8rem);
	line-height: 1;
	letter-spacing: -0.035em;
}

.rivenditori-cta__content p:not(.eyebrow) {
	max-width: 600px;
	margin: 1rem 0 0;
	color: rgba(255, 255, 255, 0.76);
	font-size: 1.04rem;
	line-height: 1.75;
}

.rivenditori-cta__form {
	padding: clamp(1.25rem, 3vw, 2rem);
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: var(--riv-radius-lg);
	background: rgba(255, 255, 255, 0.08);
	box-shadow: 0 18px 48px rgba(0, 0, 0, 0.18);
	backdrop-filter: blur(12px);
}

.rivenditori-cta__form :where(label, p, span, legend) {
	color: rgba(255, 255, 255, 0.82);
}

.rivenditori-cta__form :where(input, textarea, select) {
	width: 100%;
	border-color: rgba(255, 255, 255, 0.18);
	background: rgba(255, 255, 255, 0.96);
	color: var(--riv-color-dark);
}

.rivenditori-cta__form :where(input[type="submit"], button[type="submit"]) {
	width: auto;
	border: 0;
	background: var(--riv-color-primary);
	color: #fff;
	font-weight: 800;
	cursor: pointer;
}

.rivenditori-cta__form :where(input[type="submit"], button[type="submit"]):hover,
.rivenditori-cta__form :where(input[type="submit"], button[type="submit"]):focus-visible {
	background: #fff;
	color: var(--riv-color-dark);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 960px) {
	.rivenditori-cta__inner {
		grid-template-columns: 1fr;
	}

	.rivenditori-region__content {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 720px) {
	.rivenditori-page .container {
		width: min(100% - 24px, 1180px);
	}

	.rivenditori-hero {
		padding-top: 4.2rem;
	}

	.rivenditori-hero__actions {
		flex-direction: column;
	}

	.rivenditori-page .button {
		width: 100%;
	}

	.rivenditori-legend {
		width: 100%;
		border-radius: var(--riv-radius-md);
	}

	.rivenditori-map {
		height: 420px;
		border-radius: var(--riv-radius-md);
	}

	.rivenditori-region summary {
		min-height: 58px;
		padding: 0.95rem 1rem;
	}

	.rivenditori-region__content {
		padding: 0 1rem 1rem;
	}

	.dealer-card {
		padding: 1rem;
	}

	.leaflet-popup-content {
		width: min(240px, 72vw) !important;
	}
}

@media (max-width: 420px) {
	.rivenditori-map {
		height: 360px;
	}

	.rivenditori-region summary {
		gap: 0.65rem;
	}

	.rivenditori-region summary::after {
		width: 28px;
		height: 28px;
	}

	.rivenditori-region summary em {
		min-width: 30px;
		height: 26px;
		padding-inline: 0.55rem;
	}

	.dealer-card__contacts span,
	.dealer-card__contacts a {
		font-size: 0.92rem;
	}
}

/* ==========================================================================
   Reduced motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
	.rivenditori-page *,
	.rivenditori-page *::before,
	.rivenditori-page *::after {
		transition-duration: 0.001ms !important;
		scroll-behavior: auto !important;
	}
}