/* =========================================================================
   Mediterranean ViviExtra
   Componenti del tema usati dai template Elementor e dall'archivio.
   Colori e font arrivano dal kit Elementor (stesso kit di immobiliare).
   ========================================================================= */

:root {
	--med-primary: var(--e-global-color-primary, #A61916);
	--med-secondary: var(--e-global-color-secondary, #333333);
	--med-text: var(--e-global-color-text, #323232);
	--med-accent: var(--e-global-color-accent, #1D7FBB);
	--med-navy: #001038;
	--med-blue: #015D96;
	--med-light: #EEF9FF;
	--med-border: #DCE9F2;
	--med-radius: 15px;
	--med-font: "DM Sans", sans-serif;
}

.med-icon {
	width: 1.15em;
	height: 1.15em;
	flex: 0 0 auto;
	vertical-align: -0.2em;
}

.container {
	max-width: 1210px;
	margin: 0 auto;
	padding: 0 20px;
}

.med-muted {
	color: #666;
}

/* Breadcrumb ------------------------------------------------------------- */

.med-breadcrumb ol {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	font-family: var(--med-font);
	font-size: 14px;
	color: #666;
}

.med-breadcrumb li + li::before {
	content: "»";
	margin-right: 4px;
	color: #999;
}

.med-breadcrumb a {
	color: var(--med-accent);
	text-decoration: none;
}

.med-breadcrumb a:hover {
	text-decoration: underline;
}

/* Menu di servizio nell'header (come il menu utente di immobiliare) -------- */

.viviextra-menu-utente ul {
	margin: 0;
	padding: 0;
	list-style-type: none;
	display: flex;
	flex-wrap: wrap;
}

.viviextra-menu-utente ul li {
	margin-left: 20px;
}

.viviextra-menu-utente ul a {
	color: #000;
	font-size: 13px;
	display: flex;
	align-items: center;
	gap: 5px;
	font-weight: 500;
	font-family: var(--med-font);
	text-decoration: none;
}

.viviextra-menu-utente ul a:hover {
	color: var(--med-accent);
}

.viviextra-menu-utente .med-icon {
	width: 14px;
	height: 14px;
}

.elementor-popup-modal .viviextra-menu-utente ul {
	flex-direction: column;
}

.elementor-popup-modal .viviextra-menu-utente ul li {
	margin: 0;
}

/* Griglia di card ---------------------------------------------------------- */

.med-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 30px;
}

@media (max-width: 1024px) {
	.med-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 767px) {
	.med-grid {
		grid-template-columns: 1fr;
	}
}

/* Card opportunità (struttura e stile della card di immobiliare) ----------- */

.annuncio-card {
	background: #fff;
	border-radius: var(--med-radius);
	border: 1px solid var(--med-text);
	overflow: hidden;
	height: 100%;
	display: flex;
	flex-direction: column;
	font-family: var(--med-font);
}

.card-image {
	position: relative;
	height: 260px;
	overflow: hidden;
}

.card-image > a {
	display: block;
	height: 100%;
}

.card-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: 500ms all ease-in-out;
}

.annuncio-card:hover .card-image img {
	transform: scale(1.1);
}

.card-overlay {
	position: absolute;
	top: 25px;
	left: 0;
	right: 0;
	display: flex;
	justify-content: space-between;
	align-items: center;
	pointer-events: none;
}

.card-status {
	padding: 4px 30px 4px 12px;
	font-size: 13px;
	font-weight: 500;
	color: #fff;
	letter-spacing: 0.8px;
	background: rgba(0, 0, 0, 0.6);
}

.med-card--reserved .card-status {
	background: rgba(1, 93, 150, 0.9);
}

.med-card--sold .card-status {
	background: rgba(166, 25, 22, 0.92);
}

.med-card__bp {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	margin-right: 15px;
	padding: 4px 10px;
	border-radius: 20px;
	background: rgba(255, 255, 255, 0.92);
	color: var(--med-blue);
	font-size: 12px;
	font-weight: 700;
}

.med-card__bp .med-icon {
	width: 14px;
	height: 14px;
}

.med-card__place {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 6px;
	padding: 40px 25px 16px;
	background: linear-gradient(to top, rgba(0, 16, 56, 0.75), rgba(0, 16, 56, 0));
	color: #fff;
	font-size: 20px;
	font-weight: 700;
	text-shadow: 0 0 10px rgba(0, 0, 0, 0.4);
	pointer-events: none;
}

.card-info {
	padding: 0 15px 15px;
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
}

.card-title {
	margin: 20px 0;
	font-size: 18px;
	font-weight: 700;
	line-height: 22px;
}

.card-title a {
	color: #333;
	text-decoration: none;
}

.card-title a:hover {
	color: var(--med-accent);
}

.card-details {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	flex-wrap: wrap;
	font-size: 14px;
	font-weight: 500;
	color: #999;
	margin: 0 0 18px;
}

.card-details .detail {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.med-card__tags {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: -6px 0 16px;
}

.med-tag {
	font-size: 12px;
	font-weight: 500;
	padding: 3px 10px;
	border-radius: 20px;
	background: var(--med-light);
	color: var(--med-blue);
}

.med-tag--yield {
	background: var(--med-blue);
	color: #fff;
}

.card-bottom {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-top: auto;
}

.card-code {
	font-size: 13px;
	color: var(--med-text);
	font-weight: 700;
}

.card-action .elementor-button,
.btn-dettagli {
	display: inline-flex;
	align-items: center;
	gap: 2px;
	padding: 8px 16px;
	border-radius: 30px;
	font-size: 12px;
	font-weight: 700;
	background-color: var(--med-accent);
	color: #fff;
	text-decoration: none;
}

.btn-dettagli:hover {
	background-color: var(--med-primary);
	color: #fff;
}

.btn-dettagli .med-icon {
	width: 14px;
	height: 14px;
}

/* Archivio ----------------------------------------------------------------- */

.med-archive__hero {
	position: relative;
	background-size: cover;
	background-position: center;
	padding: 50px 0 60px;
	color: #fff;
}

.med-archive__hero::before {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(90deg, rgba(0, 16, 56, 0.88), rgba(0, 16, 56, 0.35));
}

.med-archive__hero .container {
	position: relative;
}

.med-archive__hero .med-breadcrumb ol,
.med-archive__hero .med-breadcrumb li + li::before,
.med-archive__hero .med-breadcrumb a {
	color: rgba(255, 255, 255, 0.85);
}

.med-archive__hero h1.page-title {
	font-family: "Covered By Your Grace", cursive;
	font-weight: 400;
	font-size: 64px;
	line-height: 1.05;
	color: #fff;
	margin: 25px 0 15px;
}

.med-archive__intro {
	max-width: 680px;
	font-family: var(--med-font);
	font-size: 17px;
	line-height: 27px;
	margin: 0;
}

/* Filtri (come immobiliare) */
.annunci-filters {
	background: #C3E0F0;
	padding: 20px 0;
	margin-bottom: 30px;
	font-family: var(--med-font);
}

.annunci-filters .filters-title {
	display: none;
}

.filters-row {
	display: flex;
	gap: 15px;
	align-items: flex-end;
	justify-content: space-between;
}

.filter-group {
	flex: 1 0;
	min-width: 150px;
}

.filter-group.small {
	min-width: 110px;
}

.filter-group label {
	display: block;
	font-size: 12px;
	color: #444;
	margin-bottom: 5px;
}

.filter-group select,
.filter-group input[type="text"] {
	width: 100%;
	padding: 9px 12px;
	border: 1px solid #666;
	border-radius: 3px;
	font-size: 14px;
	background: #fff;
	font-family: var(--med-font);
}

.filter-checks {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 170px;
}

.filter-group .med-check {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 0;
	font-size: 14px;
	color: #222;
	cursor: pointer;
}

.filter-actions .elementor-button {
	padding: 11px 30px;
	border: 0;
	border-radius: 11px;
	cursor: pointer;
	font-size: 14px;
	font-weight: 500;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	background: var(--med-accent);
	color: #fff;
}

.filter-actions .elementor-button:hover {
	background: var(--med-primary);
}

.med-filters__close {
	background: none;
	border: 0;
	padding: 4px;
	color: var(--med-text);
	cursor: pointer;
}

.results-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 15px;
	padding-bottom: 15px;
	border-bottom: 1px solid #ddd;
	margin-bottom: 30px;
	font-family: var(--med-font);
}

.results-count {
	font-weight: 700;
	color: var(--med-secondary);
}

.results-controls {
	display: flex;
	gap: 15px;
	align-items: center;
}

.med-sort {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
}

.med-sort label {
	margin: 0;
	color: #666;
	white-space: nowrap;
}

.med-sort select {
	padding: 6px 10px;
	border: 1px solid #bbb;
	border-radius: 3px;
	font-family: var(--med-font);
}

.btn-filtra {
	display: none;
	align-items: center;
	gap: 6px;
	padding: 8px 15px;
	border: 1px solid var(--med-secondary);
	background: var(--med-secondary);
	color: #fff;
	cursor: pointer;
	font-size: 13px;
	border-radius: 3px;
}

.annunci-results {
	margin-bottom: 60px;
}

.navigation.pagination {
	display: flex;
	justify-content: center;
	margin: 35px 0 0;
}

.navigation.pagination .nav-links {
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
}

.navigation.pagination .nav-links > * {
	color: var(--med-text);
	font-size: 16px;
	padding: 6px 12px;
	background: #efefef;
	border-radius: 5px;
	text-decoration: none;
}

.navigation.pagination .nav-links .current {
	font-weight: 700;
	background: var(--med-accent);
	color: #fff;
}

@media (max-width: 1080px) {
	.annunci-filters {
		position: fixed;
		inset: 0;
		z-index: 9999;
		overflow-y: auto;
		padding-top: 30px;
		display: none;
		margin: 0;
	}

	.annunci-filters.active {
		display: block;
	}

	.annunci-filters .filters-title {
		display: flex;
		justify-content: space-between;
		align-items: center;
		font-size: 20px;
		font-weight: 700;
		margin-bottom: 20px;
	}

	.filters-row {
		flex-direction: column;
		align-items: stretch;
	}

	.filter-actions .elementor-button {
		width: 100%;
	}

	.btn-filtra {
		display: inline-flex;
	}

	.med-sort label {
		display: none;
	}

	.med-archive__hero h1.page-title {
		font-size: 46px;
	}
}

/* Stato vuoto */
.med-empty {
	text-align: center;
	max-width: 640px;
	margin: 20px auto;
	padding: 50px 30px;
	border-radius: 20px;
	background: var(--med-light);
	font-family: var(--med-font);
}

.med-empty__icon {
	width: 48px;
	height: 48px;
	color: var(--med-accent);
}

.med-empty h2,
.med-empty h3 {
	font-size: 26px;
	color: var(--med-secondary);
	margin: 15px 0 10px;
}

.med-empty p {
	font-size: 16px;
	line-height: 26px;
	margin: 0 0 25px;
}

.med-empty .elementor-button {
	display: inline-block;
	padding: 15px 40px;
	border-radius: 11px;
	background: var(--med-accent);
	color: #fff;
	font-size: 14px;
	font-weight: 500;
	letter-spacing: 0.14em;
	text-decoration: none;
}

.med-empty .elementor-button:hover {
	background: var(--med-primary);
}

/* Scheda: galleria --------------------------------------------------------- */

.med-gallery {
	display: flex;
	gap: 6px;
}

.med-gallery__thumbs {
	width: 15%;
	display: flex;
	flex-direction: column;
	gap: 6px;
	max-height: 520px;
	overflow-y: auto;
	scrollbar-width: none;
}

.med-gallery__thumbs::-webkit-scrollbar {
	display: none;
}

.med-gallery__thumb {
	padding: 0;
	border: 2px solid transparent;
	background: none;
	cursor: pointer;
	aspect-ratio: 1 / 1;
	flex: 0 0 auto;
	border-radius: 0;
	opacity: 0.75;
}

.med-gallery__thumb.is-active,
.med-gallery__thumb:hover {
	border-color: var(--med-accent);
	opacity: 1;
	background: none;
}

.med-gallery__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.med-gallery__main {
	position: relative;
	width: 85%;
	aspect-ratio: 1 / 1;
	max-height: 520px;
	overflow: hidden;
	background: #f3f3f3;
}

.med-gallery__slide {
	position: absolute;
	inset: 0;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.35s ease;
}

.med-gallery__slide.is-active {
	opacity: 1;
	visibility: visible;
}

.med-gallery__slide img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.med-gallery__nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 44px;
	height: 44px;
	border-radius: 50%;
	border: 0;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(255, 255, 255, 0.9);
	color: #000;
	cursor: pointer;
	opacity: 0;
	transition: opacity 0.2s;
	z-index: 2;
}

.med-gallery__main:hover .med-gallery__nav,
.med-gallery__nav:focus-visible {
	opacity: 1;
}

.med-gallery__nav:hover {
	background: #fff;
	color: var(--med-accent);
}

.med-gallery__nav--prev {
	left: 15px;
}

.med-gallery__nav--next {
	right: 15px;
}

.med-gallery__count {
	position: absolute;
	left: 15px;
	bottom: 15px;
	padding: 3px 10px;
	border-radius: 20px;
	background: rgba(0, 0, 0, 0.6);
	color: #fff;
	font-size: 13px;
	font-family: var(--med-font);
	z-index: 2;
}

.med-gallery--empty img {
	width: 100%;
	aspect-ratio: 1 / 1;
	object-fit: cover;
}

@media (max-width: 767px) {
	.med-gallery {
		flex-direction: column-reverse;
	}

	.med-gallery__thumbs {
		width: 100%;
		flex-direction: row;
		overflow-x: auto;
		max-height: none;
	}

	.med-gallery__thumb {
		width: 22%;
	}

	.med-gallery__main {
		width: 100%;
		aspect-ratio: 4 / 3;
	}

	.med-gallery__nav {
		opacity: 1;
	}
}

/* Scheda: dati ------------------------------------------------------------- */

.med-badge {
	display: inline-block;
	padding: 6px 14px;
	border-radius: 30px;
	background: rgba(0, 0, 0, 0.65);
	color: #fff;
	font-family: var(--med-font);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.8px;
	text-transform: uppercase;
}

.med-badge--reserved {
	background: var(--med-blue);
}

.med-badge--sold {
	background: var(--med-primary);
}

.med-location {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-family: var(--med-font);
	font-size: 24px;
	font-weight: 700;
	color: var(--med-blue);
}

.med-location .med-icon {
	color: var(--med-primary);
}

.med-facts {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	font-family: var(--med-font);
}

.med-facts li {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 9px 14px;
	border: 1px solid var(--med-border);
	border-radius: 10px;
	font-size: 15px;
	font-weight: 500;
	color: var(--med-secondary);
}

.med-facts .med-icon {
	color: var(--med-accent);
}

/* Box investimento */
.med-invest {
	padding: 22px;
	border-radius: var(--med-radius);
	background: var(--med-light);
	border: 1px solid var(--med-border);
	font-family: var(--med-font);
}

.med-invest__head {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 14px;
}

.med-invest__head > .med-icon {
	width: 42px;
	height: 42px;
	padding: 9px;
	border-radius: 50%;
	background: var(--med-accent);
	color: #fff;
}

.med-invest__head strong {
	display: block;
	font-size: 17px;
	color: var(--med-secondary);
}

.med-invest__head span {
	font-size: 13px;
	color: var(--med-blue);
	font-weight: 500;
}

.med-invest__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
	margin: 0 0 10px;
}

.med-invest__grid div {
	padding: 12px;
	border-radius: 10px;
	background: #fff;
}

.med-invest__grid dt {
	font-size: 12px;
	color: #666;
	font-weight: 400;
}

.med-invest__grid dd {
	margin: 4px 0 0;
	font-size: 22px;
	font-weight: 700;
	color: var(--med-blue);
}

.med-invest__text,
.med-invest__note {
	font-size: 14px;
	line-height: 22px;
	margin: 0 0 16px;
}

.med-invest__note {
	font-size: 12px;
	color: #666;
}

.med-invest .med-invest__cta {
	display: inline-block;
	padding: 13px 28px;
	border-radius: 11px;
	background: var(--med-accent);
	color: #fff;
	font-size: 13px;
	font-weight: 500;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	text-decoration: none;
}

.med-invest .med-invest__cta:hover {
	background: var(--med-primary);
	color: #fff;
}

/* Partner nella scheda */
.med-partner {
	display: flex;
	align-items: center;
	gap: 18px;
	margin: 10px 0 15px;
	font-family: var(--med-font);
}

.med-partner img {
	width: 80px;
	height: auto;
	padding: 10px;
	background: #fff;
	border: 1px solid #BCBCBC;
	border-radius: 15px;
}

.med-partner strong {
	display: block;
	font-size: 16px;
	color: var(--med-secondary);
}

.med-partner span {
	display: block;
	font-size: 13px;
	color: #666;
	margin-bottom: 4px;
}

.med-partner a {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-size: 14px;
	font-weight: 700;
	color: var(--med-accent);
	text-decoration: none;
}

/* Caratteristiche */
ul.caratteristiche-immobile {
	list-style-type: none;
	margin: 0 0 20px;
	padding: 0;
	font-size: 16px;
	line-height: 31px;
	columns: 2;
	font-family: var(--med-font);
}

.med-amenities,
.med-feature-list {
	list-style: none;
	margin: 0 0 20px;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	font-family: var(--med-font);
}

.med-amenities li {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 12px;
	border-radius: 20px;
	background: #fff;
	border: 1px solid var(--med-border);
	font-size: 14px;
	font-weight: 500;
}

.med-amenities .med-icon {
	color: var(--med-accent);
}

.med-feature-list {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 6px 20px;
}

.med-feature-list li {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	font-size: 15px;
	line-height: 22px;
}

.med-feature-list .med-icon {
	color: var(--med-accent);
	margin-top: 2px;
}

@media (max-width: 767px) {
	ul.caratteristiche-immobile,
	.med-feature-list {
		columns: 1;
		grid-template-columns: 1fr;
	}

	.med-invest__grid {
		grid-template-columns: 1fr;
	}
}

/* Mappa e planimetrie */
.med-map {
	border-radius: var(--med-radius);
	overflow: hidden;
	background: #eef2f5;
}

.med-map--image {
	background: none;
}

.med-map iframe {
	display: block;
	width: 100%;
	height: 400px;
	border: 0;
}

.med-map--image img {
	display: block;
	width: 100%;
	height: auto;
}

.med-floorplans h3 {
	font-family: var(--med-font);
	font-size: 18px;
	margin: 10px 0 12px;
}

.med-floorplans__grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 10px;
}

.med-floorplans__grid img {
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: contain;
	background: #fff;
	border: 1px solid var(--med-border);
	border-radius: 10px;
}

/* Chip località */
.med-chips {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	font-family: var(--med-font);
}

.med-chips a {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 16px;
	border-radius: 30px;
	background: #fff;
	border: 1px solid var(--med-border);
	color: var(--med-secondary);
	text-decoration: none;
	font-weight: 500;
}

.med-chips a span {
	color: var(--med-accent);
	font-weight: 700;
}

/* Elementor: card con icona alla stessa altezza nelle griglie */
.elementor-widget-icon-box .elementor-icon-box-description {
	margin-bottom: 0;
}

/* Pagina 404 --------------------------------------------------------------- */

.med-404 {
	position: relative;
	padding: 110px 0 120px;
	background-size: cover;
	background-position: center;
	color: #fff;
	font-family: var(--med-font);
}

.med-404::before {
	content: "";
	position: absolute;
	inset: 0;
	background: rgba(0, 16, 56, 0.62);
}

.med-404 .container {
	position: relative;
	max-width: 760px;
	text-align: center;
}

.med-404__code {
	display: block;
	font-size: 15px;
	font-weight: 700;
	letter-spacing: 3px;
	color: rgba(255, 255, 255, 0.8);
}

.med-404__title {
	font-family: "Covered By Your Grace", cursive;
	font-weight: 400;
	font-size: 64px;
	line-height: 1.05;
	color: #fff;
	margin: 15px 0 20px;
}

.med-404 p {
	font-size: 18px;
	line-height: 28px;
	margin: 0 0 30px;
}

.med-404__actions {
	display: flex;
	gap: 15px;
	justify-content: center;
	flex-wrap: wrap;
}

.med-404 .elementor-button {
	padding: 15px 40px;
	border-radius: 11px;
	background: #fff;
	color: var(--med-blue);
	font-size: 14px;
	font-weight: 500;
	letter-spacing: 0.14em;
	text-decoration: none;
}

.med-404 .elementor-button.med-404__ghost {
	background: transparent;
	color: #fff;
	border: 1px solid #fff;
}

.med-404 .elementor-button:hover {
	background: var(--med-primary);
	color: #fff;
	border-color: var(--med-primary);
}

@media (max-width: 767px) {
	.med-404 {
		padding: 70px 0 80px;
	}

	.med-404__title {
		font-size: 44px;
	}
}

/* Loop Grid di Elementor: card alla stessa altezza nella riga */
.e-loop-item > .e-con,
.e-loop-item .elementor-widget-shortcode,
.e-loop-item .elementor-widget-shortcode > .elementor-widget-container,
.e-loop-item .elementor-shortcode {
	height: 100%;
}

.e-loop-item .elementor-widget-shortcode {
	flex-grow: 1;
}
