/**
 * DoctorSearch — Frontend Styles
 * Tema medico: azzurro / bianco / blu
 */

:root {
	--rm-primary: #0B6E99;
	--rm-secondary: #1496C4;
	--rm-accent: #084C6E;
	--rm-white: #FFFFFF;
	--rm-light: #E8F6FB;
	--rm-bg: #F5FBFD;
	--rm-text: #16324A;
	--rm-text-light: #5C7388;
	--rm-border: #D5E8F0;
	--rm-shadow: 0 4px 18px rgba(8, 76, 110, 0.07);
	--rm-shadow-hover: 0 12px 32px rgba(8, 76, 110, 0.14);
	--rm-radius: 16px;
	--rm-radius-sm: 10px;
	--rm-transition: 0.22s ease;
}

/* Reset scoped */
.rm-search-bar,
.rm-full-search,
.rm-section,
.rm-card,
.rm-single,
.rm-archive,
.rm-detail-page {
	box-sizing: border-box;
	font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
	color: var(--rm-text);
	line-height: 1.55;
}

.rm-search-bar *,
.rm-full-search *,
.rm-section *,
.rm-card *,
.rm-single *,
.rm-archive *,
.rm-detail-page * {
	box-sizing: border-box;
}

/* ═══════════════════════════════════════
   SEARCH BAR
═══════════════════════════════════════ */
.rm-search-bar {
	width: 100%;
	max-width: 980px;
	margin: 0 auto 1.5rem;
	position: relative;
	z-index: 20;
}

.rm-search-bar form.rm-search-form {
	margin: 0;
	padding: 0;
	width: 100%;
	background: transparent;
	border: 0;
	box-shadow: none;
}

.rm-search-bar input[type="text"],
.rm-search-bar input[type="search"],
.rm-search-bar input[type="radio"],
.rm-search-bar select,
.rm-search-bar button {
	box-sizing: border-box;
	font-family: inherit;
	line-height: 1.3;
	margin: 0;
	max-width: 100%;
}

/* Variante light — card bianca su hero */
.rm-search-bar--light {
	background: var(--rm-white);
	padding: 1.15rem 1.25rem 1rem;
	border-radius: 18px;
	box-shadow: 0 16px 48px rgba(8, 76, 110, 0.18);
	border: 1px solid rgba(255, 255, 255, 0.8);
}

.rm-search-bar--brand {
	background: linear-gradient(135deg, var(--rm-primary) 0%, var(--rm-accent) 100%);
	padding: 1.1rem 1.2rem 1rem;
	border-radius: 18px;
	box-shadow: var(--rm-shadow-hover);
	border: none;
}

.rm-search-form {
	display: flex;
	flex-direction: column;
	gap: 0.85rem;
}

.rm-search-main {
	display: flex;
	align-items: stretch;
	gap: 0.65rem;
}

.rm-search-field {
	flex: 1 1 0;
	min-width: 0;
}

.rm-search-field-query {
	flex: 2.2 1 0;
}

.rm-search-field-location {
	flex: 1.35 1 0;
	max-width: 260px;
}

.rm-search-input-wrap {
	position: relative;
	display: block;
	width: 100%;
}

/* Icone: spazio dedicato, mai sopra il testo */
.rm-search-icon {
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: 2.75rem;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--rm-text-light);
	pointer-events: none;
	z-index: 2;
}

.rm-location-icon {
	color: var(--rm-secondary);
}

.rm-search-bar input.rm-search-input,
.rm-search-bar .rm-search-input {
	width: 100% !important;
	height: 48px !important;
	min-height: 48px !important;
	padding: 0 1rem 0 2.75rem !important;
	border: 1.5px solid var(--rm-border) !important;
	border-radius: 12px !important;
	font-size: 0.95rem !important;
	line-height: 1.3 !important;
	background: var(--rm-bg) !important;
	color: var(--rm-text) !important;
	box-shadow: none !important;
	transition: border-color var(--rm-transition), box-shadow var(--rm-transition), background var(--rm-transition);
	-webkit-appearance: none;
	appearance: none;
}

.rm-search-bar .rm-location-wrap .rm-search-input {
	padding-right: 2.85rem !important;
}

.rm-search-bar .rm-search-input::placeholder {
	color: #8AA0B2 !important;
	opacity: 1 !important;
}

.rm-search-bar .rm-search-input:focus {
	outline: none !important;
	border-color: var(--rm-secondary) !important;
	background: var(--rm-white) !important;
	box-shadow: 0 0 0 3px rgba(20, 150, 196, 0.18) !important;
}

.rm-geo-btn {
	position: absolute;
	right: 0.4rem;
	top: 50%;
	transform: translateY(-50%);
	width: 34px;
	height: 34px;
	border: none;
	border-radius: 8px;
	background: transparent;
	color: var(--rm-primary);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all var(--rm-transition);
	padding: 0;
	z-index: 3;
}

.rm-geo-btn:hover {
	background: var(--rm-light);
	color: var(--rm-accent);
}

.rm-geo-btn.is-loading {
	pointer-events: none;
	opacity: 0.6;
}

.rm-geo-spinner {
	width: 14px;
	height: 14px;
	border: 2px solid var(--rm-light);
	border-top-color: var(--rm-primary);
	border-radius: 50%;
	animation: rm-spin 0.7s linear infinite;
}

@keyframes rm-spin {
	to { transform: rotate(360deg); }
}

.rm-search-bar button.rm-search-submit {
	flex: 0 0 auto;
	height: 48px !important;
	min-height: 48px;
	padding: 0 1.4rem !important;
	border-radius: 12px !important;
	font-size: 0.95rem !important;
	font-weight: 700 !important;
	background: var(--rm-primary) !important;
	color: var(--rm-white) !important;
	border: none !important;
	cursor: pointer;
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	gap: 0.45rem;
	white-space: nowrap;
	text-transform: none !important;
	letter-spacing: normal !important;
	box-shadow: 0 4px 14px rgba(11, 110, 153, 0.28) !important;
	transition: background var(--rm-transition), transform var(--rm-transition), box-shadow var(--rm-transition);
}

.rm-search-bar button.rm-search-submit:hover {
	background: var(--rm-accent) !important;
	color: var(--rm-white) !important;
	transform: translateY(-1px);
	box-shadow: 0 6px 18px rgba(8, 76, 110, 0.32) !important;
}

.rm-search-bar--brand button.rm-search-submit {
	background: var(--rm-white) !important;
	color: var(--rm-primary) !important;
	box-shadow: none !important;
}

.rm-search-bar--brand button.rm-search-submit:hover {
	background: var(--rm-light) !important;
	color: var(--rm-accent) !important;
}

.rm-search-bar--brand .rm-search-input {
	background: rgba(255, 255, 255, 0.95) !important;
	border-color: transparent !important;
}

.rm-search-bar--brand .rm-search-icon {
	color: var(--rm-primary);
}

/* Filtri: chip + select */
.rm-search-filters {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.65rem;
	padding-top: 0.85rem;
	border-top: 1px solid var(--rm-border);
}

.rm-search-bar--brand .rm-search-filters {
	border-top-color: rgba(255, 255, 255, 0.22);
}

.rm-filter-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
}

.rm-chip {
	display: inline-flex;
	align-items: center;
	cursor: pointer;
	margin: 0;
	padding: 0;
}

.rm-chip input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
	width: 0;
	height: 0;
}

.rm-chip span {
	display: inline-flex;
	align-items: center;
	padding: 0.4rem 0.95rem;
	border-radius: 999px;
	font-size: 0.82rem;
	font-weight: 600;
	color: var(--rm-text-light);
	background: var(--rm-bg);
	border: 1.5px solid var(--rm-border);
	transition: all var(--rm-transition);
	user-select: none;
}

.rm-chip:hover span {
	border-color: var(--rm-secondary);
	color: var(--rm-primary);
}

.rm-chip.is-active span,
.rm-chip input:checked + span {
	background: var(--rm-primary);
	border-color: var(--rm-primary);
	color: var(--rm-white);
}

.rm-search-bar--brand .rm-chip span {
	background: rgba(255, 255, 255, 0.12);
	border-color: rgba(255, 255, 255, 0.28);
	color: rgba(255, 255, 255, 0.9);
}

.rm-search-bar--brand .rm-chip.is-active span,
.rm-search-bar--brand .rm-chip input:checked + span {
	background: var(--rm-white);
	border-color: var(--rm-white);
	color: var(--rm-primary);
}

.rm-search-bar select.rm-filter-select {
	height: 36px !important;
	min-width: 10rem;
	max-width: 14rem;
	width: auto !important;
	flex: 0 0 auto !important;
	padding: 0 2rem 0 0.85rem !important;
	border: 1.5px solid var(--rm-border) !important;
	border-radius: 999px !important;
	background-color: var(--rm-bg) !important;
	color: var(--rm-text) !important;
	font-size: 0.82rem !important;
	font-weight: 600;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23084C6E' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 0.75rem center;
	background-size: 8px;
}

.rm-filter-select option {
	color: var(--rm-text);
	background: var(--rm-white);
}

.rm-geo-status {
	margin: 0;
	font-size: 0.75rem;
	line-height: 1.35;
}

.rm-geo-privacy {
	margin: 0;
	font-size: 0.72rem;
	line-height: 1.4;
	color: var(--rm-text-light);
}

.rm-search-bar--brand .rm-geo-privacy {
	color: rgba(255, 255, 255, 0.8);
}

.rm-geo-status:empty {
	display: none;
}

.rm-geo-success { color: var(--rm-text-light); }
.rm-geo-error   { color: #c0392b; }
.rm-geo-loading { color: var(--rm-text-light); }

.rm-geo-results-note {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	font-size: 0.85rem;
	color: var(--rm-primary);
	margin-bottom: 1rem;
	padding: 0.45rem 0.85rem;
	background: var(--rm-light);
	border-radius: 8px;
	font-weight: 600;
}

/* Autocomplete */
.rm-autocomplete-list {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	right: 0;
	background: var(--rm-white);
	border: 1px solid var(--rm-border);
	border-radius: 12px;
	box-shadow: var(--rm-shadow-hover);
	z-index: 100;
	max-height: 240px;
	overflow-y: auto;
}

.rm-autocomplete-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	padding: 0.7rem 1rem;
	border: none;
	background: none;
	text-align: left;
	cursor: pointer;
	font-size: 0.88rem;
	color: var(--rm-text);
	border-bottom: 1px solid var(--rm-border);
	transition: background var(--rm-transition);
}

.rm-autocomplete-item:last-child { border-bottom: none; }
.rm-autocomplete-item:hover,
.rm-autocomplete-item.is-active { background: var(--rm-bg); }

.rm-ac-label { font-weight: 600; color: var(--rm-accent); }
.rm-ac-type {
	font-size: 0.7rem;
	color: var(--rm-primary);
	background: var(--rm-light);
	padding: 0.15rem 0.5rem;
	border-radius: 999px;
	font-weight: 600;
}

.rm-search-loading {
	text-align: center;
	padding: 2rem;
	color: var(--rm-text-light);
	font-size: 0.95rem;
}

.rm-search-results.rm-loading {
	opacity: 0.55;
	pointer-events: none;
}

.rm-sr-only {
	position: absolute;
	width: 1px; height: 1px;
	padding: 0; margin: -1px;
	overflow: hidden;
	clip: rect(0,0,0,0);
	border: 0;
}

/* ═══════════════════════════════════════
   BUTTONS
═══════════════════════════════════════ */
.rm-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.45rem;
	padding: 0.7rem 1.25rem;
	border-radius: var(--rm-radius-sm);
	font-size: 0.88rem;
	font-weight: 650;
	text-decoration: none !important;
	cursor: pointer;
	border: 1.5px solid transparent;
	transition: all var(--rm-transition);
	white-space: nowrap;
	line-height: 1.2;
}

.rm-btn-primary {
	background: var(--rm-primary);
	color: var(--rm-white) !important;
	border-color: var(--rm-primary);
}

.rm-btn-primary:hover {
	background: var(--rm-accent);
	border-color: var(--rm-accent);
	color: var(--rm-white) !important;
	transform: translateY(-1px);
	box-shadow: var(--rm-shadow-hover);
}

.rm-btn-outline {
	background: transparent;
	color: var(--rm-primary) !important;
	border-color: var(--rm-border);
}

.rm-btn-outline:hover {
	background: var(--rm-light);
	border-color: var(--rm-secondary);
	color: var(--rm-accent) !important;
}

.rm-btn-large {
	padding: 0.95rem 1.75rem;
	font-size: 1rem;
	border-radius: 12px;
}

.rm-btn-booking {
	background: var(--rm-accent);
	border-color: var(--rm-accent);
	color: var(--rm-white) !important;
}

.rm-btn-booking:hover {
	background: var(--rm-primary);
	border-color: var(--rm-primary);
}

/* ═══════════════════════════════════════
   SECTIONS & GRID
═══════════════════════════════════════ */
.rm-section {
	margin-bottom: 2.75rem;
}

.rm-section-title {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	font-size: 1.35rem;
	font-weight: 750;
	color: var(--rm-accent);
	margin: 0 0 1.25rem;
	padding-bottom: 0.7rem;
	border-bottom: 2px solid var(--rm-light);
}

.rm-grid {
	display: grid;
	gap: 1.35rem;
}

.rm-cols-2 { grid-template-columns: repeat(2, 1fr); }
.rm-cols-3 { grid-template-columns: repeat(3, 1fr); }
.rm-cols-4 { grid-template-columns: repeat(4, 1fr); }

.rm-view-list {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.rm-view-list .rm-card {
	display: flex;
	flex-direction: row;
	align-items: stretch;
}

.rm-view-list .rm-card-image {
	width: 180px;
	flex-shrink: 0;
	aspect-ratio: auto;
	min-height: 100%;
}

.rm-view-list .rm-card-body {
	flex: 1;
	display: flex;
	flex-direction: column;
}

/* ═══════════════════════════════════════
   CARDS
═══════════════════════════════════════ */
.rm-card {
	background: var(--rm-white);
	border-radius: var(--rm-radius);
	box-shadow: var(--rm-shadow);
	overflow: hidden;
	transition: transform var(--rm-transition), box-shadow var(--rm-transition), border-color var(--rm-transition);
	border: 1px solid var(--rm-border);
	display: flex;
	flex-direction: column;
	height: 100%;
}

.rm-card:hover {
	transform: translateY(-5px);
	box-shadow: var(--rm-shadow-hover);
	border-color: rgba(20, 150, 196, 0.35);
}

.rm-card-image {
	position: relative;
	aspect-ratio: 16 / 10;
	overflow: hidden;
	background: linear-gradient(145deg, var(--rm-light) 0%, #cfeaf4 100%);
}

.rm-card-medico .rm-card-image {
	background: linear-gradient(145deg, #E8F6FB 0%, #B8DFF0 100%);
}

.rm-card-struttura .rm-card-image {
	background: linear-gradient(145deg, #EAF0F8 0%, #C5D4E8 100%);
}

.rm-card-visita .rm-card-image {
	background: linear-gradient(145deg, #E6F7F2 0%, #B8E6D8 100%);
}

.rm-card-image img,
.rm-thumbnail {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.35s ease;
}

.rm-card:hover .rm-card-image img {
	transform: scale(1.04);
}

.rm-placeholder-image {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	color: var(--rm-primary);
	opacity: 0.55;
}

.rm-placeholder-image svg {
	width: 52px;
	height: 52px;
}

.rm-placeholder-large {
	min-height: 280px;
}

.rm-price-badge {
	position: absolute;
	top: 0.85rem;
	right: 0.85rem;
	background: var(--rm-accent);
	color: var(--rm-white);
	padding: 0.4rem 0.8rem;
	border-radius: 999px;
	font-size: 0.82rem;
	font-weight: 750;
	box-shadow: 0 4px 12px rgba(8, 76, 110, 0.25);
	z-index: 2;
}

.rm-card-type-badge {
	position: absolute;
	top: 0.85rem;
	left: 0.85rem;
	background: rgba(255, 255, 255, 0.95);
	color: var(--rm-accent);
	padding: 0.35rem 0.75rem;
	border-radius: 999px;
	font-size: 0.72rem;
	font-weight: 750;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	box-shadow: 0 2px 8px rgba(8, 76, 110, 0.12);
	z-index: 2;
}

.rm-card-visita .rm-card-type-badge {
	left: 0.85rem;
}

.rm-card-meta {
	min-height: 4.5rem;
}

.rm-card-meta .rm-meta-item {
	display: -webkit-box;
	-webkit-line-clamp: 1;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.rm-card-actions {
	margin-top: auto;
	padding-top: 0.35rem;
	border-top: 1px solid var(--rm-border);
}

.rm-card-actions .rm-btn-primary {
	flex: 1 1 auto;
}

.rm-card-actions .rm-btn-outline {
	flex: 0 1 auto;
}

.rm-btn-booking.rm-btn-outline {
	color: var(--rm-accent) !important;
	border-color: var(--rm-border);
}

.rm-btn-booking.rm-btn-outline:hover {
	background: var(--rm-accent);
	border-color: var(--rm-accent);
	color: var(--rm-white) !important;
}

.rm-price-large {
	font-size: 1.05rem;
	padding: 0.5rem 1rem;
}

.rm-card-body {
	padding: 1.2rem 1.25rem 1.3rem;
	display: flex;
	flex-direction: column;
	flex: 1;
}

.rm-card-title {
	margin: 0 0 0.55rem;
	font-size: 1.08rem;
	font-weight: 750;
	line-height: 1.3;
}

.rm-card-title a {
	color: var(--rm-accent);
	text-decoration: none;
	transition: color var(--rm-transition);
}

.rm-card-title a:hover {
	color: var(--rm-primary);
}

.rm-qualifica {
	color: var(--rm-secondary);
	font-weight: 600;
	margin-right: 0.2rem;
}

.rm-card-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
	margin-bottom: 0.7rem;
}

.rm-tag {
	display: inline-block;
	padding: 0.22rem 0.65rem;
	background: var(--rm-light);
	color: var(--rm-primary);
	border-radius: 999px;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.01em;
}

.rm-tag-struttura {
	background: rgba(8, 76, 110, 0.1);
	color: var(--rm-accent);
}

.rm-card-excerpt {
	color: var(--rm-text-light);
	font-size: 0.88rem;
	margin: 0 0 0.85rem;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	line-height: 1.5;
}

.rm-card-meta {
	display: flex;
	flex-direction: column;
	gap: 0.45rem;
	margin-bottom: 1rem;
	margin-top: auto;
}

.rm-meta-item {
	display: flex;
	align-items: flex-start;
	gap: 0.5rem;
	font-size: 0.84rem;
	color: var(--rm-text-light);
}

.rm-meta-item svg {
	flex-shrink: 0;
	margin-top: 2px;
	color: var(--rm-secondary);
	width: 15px;
	height: 15px;
}

.rm-meta-item a {
	color: var(--rm-primary);
	text-decoration: none;
	font-weight: 550;
}

.rm-meta-item a:hover {
	text-decoration: underline;
}

.rm-servizi-list {
	list-style: none;
	padding: 0;
	margin: 0 0 1rem;
}

.rm-servizi-list li {
	padding: 0.28rem 0 0.28rem 1.3rem;
	font-size: 0.85rem;
	color: var(--rm-text-light);
	position: relative;
}

.rm-servizi-list li::before {
	content: "✓";
	position: absolute;
	left: 0;
	color: var(--rm-secondary);
	font-weight: 700;
}

.rm-card-actions {
	display: flex;
	gap: 0.5rem;
	flex-wrap: wrap;
	padding-top: 0.15rem;
}

.rm-card-actions .rm-btn {
	flex: 1 1 auto;
	min-width: 0;
	justify-content: center;
}

/* Welcome */
.rm-welcome-message {
	text-align: center;
	padding: 3rem 2rem;
	background: var(--rm-bg);
	border-radius: var(--rm-radius);
	border: 2px dashed var(--rm-border);
}

.rm-welcome-icon {
	color: var(--rm-secondary);
	margin-bottom: 1rem;
}

.rm-welcome-message h3 {
	color: var(--rm-accent);
	font-size: 1.25rem;
	margin-bottom: 0.5rem;
}

.rm-welcome-message p {
	color: var(--rm-text-light);
	margin: 0;
}

/* Single (legacy) */
.rm-single {
	max-width: 1100px;
	margin: 0 auto;
	padding: 2rem 1rem;
}

.rm-single-header {
	display: flex;
	gap: 2rem;
	margin-bottom: 2rem;
	flex-wrap: wrap;
}

.rm-single-image {
	flex: 0 0 300px;
	border-radius: var(--rm-radius);
	overflow: hidden;
	position: relative;
	box-shadow: var(--rm-shadow);
}

.rm-single-image img {
	width: 100%;
	height: auto;
	display: block;
}

.rm-single-info {
	flex: 1;
	min-width: 280px;
}

.rm-single-title {
	font-size: 2rem;
	color: var(--rm-accent);
	margin-bottom: 0.75rem;
}

.rm-single-content {
	display: flex;
	gap: 2rem;
	flex-wrap: wrap;
}

.rm-single-main {
	flex: 1;
	min-width: 300px;
}

.rm-single-sidebar {
	flex: 0 0 300px;
}

.rm-contact-box {
	background: var(--rm-white);
	border: 1px solid var(--rm-border);
	border-radius: var(--rm-radius);
	padding: 1.4rem;
	box-shadow: var(--rm-shadow);
}

.rm-contact-box h3 {
	color: var(--rm-accent);
	margin: 0 0 1rem;
	font-size: 1.05rem;
	padding-bottom: 0.6rem;
	border-bottom: 2px solid var(--rm-light);
}

.rm-contact-item {
	margin-bottom: 0.75rem;
	font-size: 0.9rem;
}

.rm-contact-item a {
	color: var(--rm-primary);
}

.rm-iscrizione,
.rm-durata {
	color: var(--rm-text-light);
	font-size: 0.95rem;
}

.rm-servizi-section {
	margin-top: 2rem;
}

.rm-servizi-section h3 {
	color: var(--rm-accent);
}

/* Detail pages continue below — keep existing detail styles */
.rm-detail-page {
	max-width: 1100px;
	margin: 0 auto;
	padding: 1.5rem 1rem 3rem;
}

.rm-breadcrumb {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.35rem;
	font-size: 0.8rem;
	color: var(--rm-text-light);
	margin-bottom: 1.25rem;
}

.rm-breadcrumb a {
	color: var(--rm-primary);
	text-decoration: none;
}

.rm-breadcrumb a:hover { text-decoration: underline; }
.rm-breadcrumb-sep { opacity: 0.4; }
.rm-breadcrumb-current { color: var(--rm-accent); font-weight: 600; }

.rm-detail-hero {
	display: flex;
	gap: 0;
	margin-bottom: 2rem;
	background: var(--rm-white);
	border-radius: var(--rm-radius);
	box-shadow: var(--rm-shadow);
	border: 1px solid var(--rm-border);
	overflow: hidden;
}

.rm-detail-hero-image {
	flex: 0 0 300px;
	background: linear-gradient(145deg, var(--rm-light), #c5e4f0);
	position: relative;
}

.rm-detail-hero-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	min-height: 280px;
}

.rm-detail-hero-info {
	flex: 1;
	padding: 1.75rem 1.75rem;
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.rm-detail-badge {
	display: inline-block;
	background: var(--rm-light);
	color: var(--rm-primary);
	font-size: 0.78rem;
	font-weight: 700;
	padding: 0.28rem 0.7rem;
	border-radius: 999px;
	margin-bottom: 0.55rem;
	width: fit-content;
}

.rm-detail-title {
	font-size: 1.75rem;
	color: var(--rm-accent);
	margin: 0 0 0.65rem;
	line-height: 1.25;
	font-weight: 750;
}

.rm-detail-location {
	display: flex;
	align-items: center;
	gap: 0.4rem;
	color: var(--rm-text-light);
	font-size: 0.9rem;
	margin: 0 0 0.5rem;
}

.rm-detail-location svg { color: var(--rm-secondary); flex-shrink: 0; }

.rm-detail-meta-line {
	font-size: 0.9rem;
	color: var(--rm-text-light);
	margin: 0 0 0.35rem;
}

.rm-detail-meta-line a { color: var(--rm-primary); }

.rm-detail-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
	margin-top: 1.25rem;
}

/* Body dettaglio */
.rm-detail-body {
	display: flex;
	gap: 2rem;
	align-items: flex-start;
}

.rm-detail-main {
	flex: 1;
	min-width: 0;
}

.rm-detail-sidebar {
	flex: 0 0 300px;
	position: sticky;
	top: 1.5rem;
}

.rm-detail-section {
	margin-bottom: 2rem;
}

.rm-detail-section h2 {
	font-size: 1.2rem;
	color: var(--rm-accent);
	margin: 0 0 1rem;
	padding-bottom: 0.5rem;
	border-bottom: 2px solid var(--rm-light);
}

.rm-detail-content {
	font-size: 0.95rem;
	line-height: 1.75;
	color: var(--rm-text);
}

.rm-detail-content p { margin-bottom: 1rem; }

/* Contatti sidebar */
.rm-contact-box {
	background: var(--rm-bg);
	border: 1px solid var(--rm-border);
	border-radius: var(--rm-radius);
	padding: 1.25rem;
	margin-bottom: 1rem;
}

.rm-contact-box h3 {
	color: var(--rm-accent);
	margin: 0 0 1rem;
	font-size: 1rem;
	padding-bottom: 0.5rem;
	border-bottom: 2px solid var(--rm-light);
}

.rm-contact-row {
	display: flex;
	gap: 0.75rem;
	margin-bottom: 1rem;
}

.rm-contact-row:last-child { margin-bottom: 0; }

.rm-contact-icon {
	flex-shrink: 0;
	width: 36px;
	height: 36px;
	background: var(--rm-light);
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--rm-primary);
}

.rm-contact-row strong {
	display: block;
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.4px;
	color: var(--rm-text-light);
	margin-bottom: 0.15rem;
}

.rm-contact-row p {
	margin: 0;
	font-size: 0.9rem;
	color: var(--rm-text);
	line-height: 1.4;
}

.rm-contact-row a { color: var(--rm-primary); text-decoration: none; }
.rm-contact-row a:hover { text-decoration: underline; }

.rm-link-directions {
	display: inline-block;
	font-size: 0.8rem;
	color: var(--rm-secondary);
	margin-top: 0.25rem;
	text-decoration: none;
	font-weight: 600;
}

.rm-link-directions:hover { text-decoration: underline; }

/* Servizi grid */
.rm-servizi-grid {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.rm-servizio-chip {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	background: var(--rm-bg);
	border: 1px solid var(--rm-border);
	border-radius: 20px;
	padding: 0.4rem 0.85rem;
	font-size: 0.85rem;
	color: var(--rm-text);
}

.rm-servizio-chip svg { color: var(--rm-secondary); flex-shrink: 0; }

/* Struttura collegata */
.rm-linked-struttura {
	background: var(--rm-white);
	border: 1px solid var(--rm-border);
	border-radius: var(--rm-radius);
	padding: 1.25rem;
}

.rm-linked-struttura h3 {
	font-size: 0.95rem;
	color: var(--rm-accent);
	margin: 0 0 0.75rem;
}

.rm-linked-struttura .rm-linked-card {
	display: flex;
	gap: 0.75rem;
	align-items: center;
	text-decoration: none;
	color: inherit;
	padding: 0.5rem;
	border-radius: 8px;
	transition: background var(--rm-transition);
	margin-bottom: 0.5rem;
}

.rm-linked-struttura .rm-linked-card:last-child {
	margin-bottom: 0;
}

.rm-linked-card:hover { background: var(--rm-bg); }

.rm-linked-card img {
	width: 56px;
	height: 56px;
	object-fit: cover;
	border-radius: 8px;
	flex-shrink: 0;
}

.rm-linked-card strong {
	display: block;
	color: var(--rm-accent);
	font-size: 0.9rem;
	margin-bottom: 0.15rem;
}

.rm-linked-card span {
	font-size: 0.78rem;
	color: var(--rm-text-light);
}

/* Mappa */
.rm-map-section {
	margin-top: 1rem;
}

.rm-map-section h3 {
	font-size: 1rem;
	color: var(--rm-accent);
	margin: 0 0 0.75rem;
}

.rm-map-embed {
	border-radius: var(--rm-radius-sm);
	overflow: hidden;
	border: 1px solid var(--rm-border);
}

.rm-map-embed iframe {
	width: 100%;
	height: 280px;
	border: none;
	display: block;
}

.rm-detail-visite-grid .rm-card { margin-bottom: 0; }

/* Archive */
.rm-archive {
	max-width: 1200px;
	margin: 0 auto;
	padding: 2rem 1rem;
}

.rm-archive-header {
	margin-bottom: 2rem;
}

.rm-archive-header h1 {
	color: var(--rm-accent);
	font-size: 2rem;
	margin-bottom: 1.5rem;
}

.rm-pagination {
	margin-top: 2rem;
	text-align: center;
}

.rm-pagination .nav-links {
	display: flex;
	justify-content: center;
	gap: 0.5rem;
}

.rm-pagination a,
.rm-pagination span {
	padding: 0.5rem 1rem;
	border-radius: var(--rm-radius-sm);
	background: var(--rm-bg);
	color: var(--rm-primary);
	text-decoration: none;
	border: 1px solid var(--rm-border);
}

.rm-pagination .current {
	background: var(--rm-primary);
	color: var(--rm-white);
	border-color: var(--rm-primary);
}

/* No results / errors */
.rm-no-results {
	text-align: center;
	padding: 2rem;
	color: var(--rm-text-light);
	font-size: 1.1rem;
}

.rm-error {
	color: #c0392b;
	padding: 1rem;
	background: #fdf0ef;
	border-radius: var(--rm-radius-sm);
}

/* Responsive — tutti gli schermi */
@media (max-width: 1200px) {
	.rm-cols-4 {
		grid-template-columns: repeat(3, 1fr);
	}

	.rm-full-search,
	.rm-archive,
	.rm-single {
		padding-left: 1rem;
		padding-right: 1rem;
	}
}

@media (max-width: 992px) {
	.rm-cols-3,
	.rm-cols-4 {
		grid-template-columns: repeat(2, 1fr);
	}

	.rm-search-field-location {
		max-width: none;
	}

	.rm-single-title {
		font-size: 1.65rem;
	}

	.rm-section-title {
		font-size: 1.3rem;
	}

	.rm-single-sidebar {
		flex: 1 1 100%;
	}
}

@media (max-width: 768px) {
	.rm-search-bar--light,
	.rm-search-bar--brand {
		padding: 0.9rem 0.95rem 0.85rem;
		border-radius: 14px;
	}

	.rm-search-main {
		flex-wrap: wrap;
	}

	.rm-search-field-query {
		flex: 1 1 100%;
	}

	.rm-search-field-location {
		flex: 1 1 calc(100% - 100px);
		max-width: none;
	}

	.rm-search-bar button.rm-search-submit {
		flex: 0 0 90px;
		padding: 0 0.75rem !important;
	}

	.rm-search-bar button.rm-search-submit span {
		display: none;
	}

	.rm-search-bar input.rm-search-input {
		height: 46px !important;
		font-size: 16px !important;
	}

	.rm-filter-chips {
		width: 100%;
	}

	.rm-search-bar select.rm-filter-select {
		min-width: calc(50% - 0.3rem);
		max-width: 100%;
	}

	.rm-view-list .rm-card {
		flex-direction: column;
	}

	.rm-view-list .rm-card-image {
		width: 100%;
		aspect-ratio: 16/9;
		min-height: 0;
	}

	.rm-card-body {
		padding: 1.05rem 1.1rem 1.15rem;
	}

	.rm-card-title {
		font-size: 1.02rem;
	}

	.rm-archive-header h1,
	.preview-title {
		font-size: 1.5rem;
	}

	.rm-welcome-message {
		padding: 2rem 1.25rem;
	}

	.rm-welcome-message h3 {
		font-size: 1.15rem;
	}

	.rm-pagination .nav-links {
		flex-wrap: wrap;
	}

	.rm-pagination a,
	.rm-pagination span {
		min-width: 40px;
		min-height: 40px;
		display: inline-flex;
		align-items: center;
		justify-content: center;
	}

	.rm-detail-hero {
		flex-direction: column;
	}

	.rm-detail-hero-image {
		flex: none;
		width: 100%;
	}

	.rm-detail-hero-info {
		padding: 1.25rem;
	}

	.rm-detail-title {
		font-size: 1.45rem;
	}

	.rm-detail-body {
		flex-direction: column;
		gap: 1.5rem;
	}

	.rm-detail-sidebar {
		flex: none;
		width: 100%;
		position: static;
	}
}

@media (max-width: 640px) {
	.rm-cols-2,
	.rm-cols-3,
	.rm-cols-4 {
		grid-template-columns: 1fr;
	}

	.rm-grid {
		gap: 1rem;
	}

	.rm-search-main {
		flex-direction: column;
		gap: 0.55rem;
	}

	.rm-search-field,
	.rm-search-field-query,
	.rm-search-field-location {
		flex: 1 1 100%;
		width: 100%;
		max-width: none;
	}

	.rm-search-bar button.rm-search-submit {
		width: 100%;
		flex: 1 1 100%;
		height: 48px !important;
	}

	.rm-search-bar button.rm-search-submit span {
		display: inline;
	}

	.rm-search-filters {
		width: 100%;
	}

	.rm-filter-select {
		flex: 0 0 auto !important;
		width: auto !important;
		min-width: calc(50% - 0.2rem);
		max-width: 100%;
	}

	.rm-section {
		margin-bottom: 2rem;
	}

	.rm-section-title {
		font-size: 1.2rem;
		margin-bottom: 1rem;
	}

	.rm-card-actions {
		flex-direction: column;
	}

	.rm-card-actions .rm-btn {
		width: 100%;
		justify-content: center;
	}

	.rm-single {
		padding: 1.25rem 0.75rem;
	}

	.rm-single-header {
		flex-direction: column;
		gap: 1.25rem;
		margin-bottom: 1.5rem;
	}

	.rm-single-image {
		flex: none;
		width: 100%;
	}

	.rm-single-title {
		font-size: 1.4rem;
	}

	.rm-single-content {
		flex-direction: column;
		gap: 1.25rem;
	}

	.rm-single-main,
	.rm-single-sidebar {
		min-width: 0;
		width: 100%;
	}

	.rm-contact-box {
		padding: 1.15rem;
	}

	.rm-detail-actions {
		flex-direction: column;
	}

	.rm-detail-actions .rm-btn {
		width: 100%;
		justify-content: center;
	}

	.rm-archive {
		padding: 1.25rem 0.75rem;
	}
}

@media (max-width: 480px) {
	.rm-search-bar {
		padding: 0.6rem;
		border-radius: 8px;
	}

	.rm-search-input {
		padding-left: 2rem;
	}

	.rm-search-icon {
		left: 0.55rem;
	}

	.rm-filter-select {
		flex: 0 0 auto !important;
		width: 100% !important;
		max-width: 100%;
	}

	.rm-card-image {
		aspect-ratio: 4/3;
	}

	.rm-meta-item {
		font-size: 0.8rem;
	}

	.rm-tag {
		font-size: 0.7rem;
	}

	.rm-no-results {
		padding: 1.5rem 1rem;
		font-size: 1rem;
	}
}

/* Schermi molto larghi */
@media (min-width: 1400px) {
	.rm-full-search {
		max-width: 1280px;
		margin-left: auto;
		margin-right: auto;
	}

	.rm-archive {
		max-width: 1320px;
	}
}

/* Accessibilità touch e overflow */
.rm-search-bar,
.rm-full-search,
.rm-section,
.rm-card,
.rm-single,
.rm-archive {
	max-width: 100%;
	overflow-x: clip;
}

.rm-table-wrap {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

@supports (padding: max(0px)) {
	.rm-full-search,
	.rm-archive,
	.rm-single {
		padding-left: max(0.75rem, env(safe-area-inset-left));
		padding-right: max(0.75rem, env(safe-area-inset-right));
	}

	.rm-search-bar {
		margin-left: env(safe-area-inset-left);
		margin-right: env(safe-area-inset-right);
	}
}
