/**
 * Visual polish — premium UX/UI layer (desktop + mobile).
 * Keeps brand (black/gold), fonts, logo, layout and content intact.
 * Elevates hierarchy, rhythm, depth, CTA, cards and microinteractions.
 */

/* —— Tokens —— */
body.cbr-theme {
	--cbr-polish-radius: 10px;
	--cbr-polish-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
	--cbr-polish-shadow-hover: 0 18px 48px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(201, 162, 39, 0.12);
	/* Soft under-glow — lighter, tighter, mostly below the button */
	--cbr-polish-glow: 0 4px 10px rgba(201, 162, 39, 0.22), 0 8px 18px rgba(201, 162, 39, 0.1);
	--cbr-polish-glow-strong: 0 5px 12px rgba(201, 162, 39, 0.28), 0 10px 22px rgba(201, 162, 39, 0.14);
	--cbr-polish-ease: cubic-bezier(0.22, 1, 0.36, 1);
	--cbr-polish-duration: 320ms;
	--cbr-text-measure: 38rem; /* ~65–70ch for readable luxury body */
	--cbr-body-line-polish: 1.55;
}

/* —— Tipografia: titoli non-hero più contenuti; body più leggibile —— */
/* UX: gerarchia chiara — hero resta dominante, sezioni non competono */
body.cbr-theme {
	--cbr-section-title-size: calc(var(--cbr-hero-title-size) / 1.25);
}

body.cbr-theme :is(
	.cbr-section-title,
	.cbr-nol-section-title,
	.cbr-evt-section-title,
	.cbr-per-section-title,
	.cbr-chi-section-title,
	.cbr-chi-story__title,
	.cbr-home-partners__title,
	.cbr-home-andrea__title,
	.cbr-home-events-signed__title,
	.cbr-home-service--hero .cbr-home-service__title,
	.cbr-home-events .cbr-hero__title,
	[class*="showroom__headline"],
	.cbr-contact__title,
	.cbr-con-block__title,
	.cbr-nol-mise__title,
	.cbr-card__title,
	.cbr-card--service .cbr-card__title-text
) {
	font-size: var(--cbr-section-title-size) !important;
	line-height: 1.18;
	letter-spacing: 0.01em;
}

body.cbr-theme .cbr-page--home .cbr-home-service--coverage:not(.cbr-home-service--coverage-events) :is(
	.cbr-home-service__title,
	.cbr-hero__title,
	.cbr-hero__title-accent,
	.cbr-hero__title-line.cbr-hero__title-accent
) {
	font-size: var(--cbr-section-title-size) !important;
	font-weight: 400 !important;
	line-height: 1.15 !important;
	letter-spacing: 0.01em !important;
	white-space: nowrap !important;
	text-wrap: nowrap !important;
	max-width: none !important;
}

/* Hero page titles keep full scale (wow without competing with brand mark) */
body.cbr-theme :is(
	.cbr-home-hero [class*="-hero__title"],
	.cbr-nol-hero [class*="-hero__title"],
	.cbr-per-hero [class*="-hero__title"],
	.cbr-evt-hero [class*="-hero__title"],
	.cbr-chi-hero [class*="-hero__title"],
	.cbr-con-hero [class*="-hero__title"],
	.cbr-nol-catalog-hero [class*="-hero__title"],
	.cbr-page-hero__title,
	.cbr-home-hero .cbr-hero__headline
) {
	font-size: var(--cbr-hero-title-size) !important;
	line-height: 1.12;
}

/* Body measure + line-height — scansione più calma, meno “Elementor blocky” */
body.cbr-theme :is(
	[class*="-hero__text"],
	[class*="-hero__lead"],
	.cbr-section-lead,
	.cbr-copy,
	.cbr-home-service__text,
	.cbr-home-partners__text,
	.cbr-home-andrea__text,
	.cbr-home-events-signed__text,
	.cbr-card__text,
	.cbr-chi-story__text,
	.cbr-con-card__text,
	.cbr-site-footer__text
) {
	max-width: min(100%, var(--cbr-text-measure));
	line-height: var(--cbr-body-line-polish);
}

/* —— Sfondi: solo nero pieno, nessuna alternanza —— */
body.cbr-theme,
body.cbr-theme :is(.cbr-page, .cbr-home, .cbr-nol, .cbr-per, .cbr-evt, .cbr-chi, .cbr-con),
body.cbr-theme :is(.cbr-page, .cbr-home, .cbr-nol, .cbr-per, .cbr-evt, .cbr-chi, .cbr-con) > section,
body.cbr-theme .cbr-site-footer {
	background-color: var(--cbr-bg) !important;
	background-image: none !important;
}

/* Divider ritmo — linee più eleganti, spacing uniforme già via --cbr-section-gap */
body.cbr-theme :is(.cbr-page, .cbr-home, .cbr-nol, .cbr-per, .cbr-evt, .cbr-chi, .cbr-con) > section + section::before {
	opacity: 0.85;
	height: 1px;
	background: linear-gradient(
		90deg,
		transparent 0%,
		rgba(201, 162, 39, 0.15) 18%,
		rgba(249, 226, 156, 0.45) 50%,
		rgba(201, 162, 39, 0.15) 82%,
		transparent 100%
	) !important;
}

/* —— Hero: profondità e CTA più evidenti (struttura invariata) —— */
@media (min-width: 1024px) {
	body.cbr-theme :is(.cbr-home-hero, .cbr-nol-hero, .cbr-per-hero, .cbr-evt-hero, .cbr-chi-hero, .cbr-con-hero) {
		isolation: isolate;
	}

	/* Soft vignette on media column only — depth without overlapping copy */
	body.cbr-theme :is(.cbr-home-hero__media, [class*="-hero__media"]):not(.cbr-home-service__media)::before {
		content: "";
		position: absolute;
		inset: 0;
		z-index: 1;
		pointer-events: none;
		background:
			radial-gradient(ellipse 70% 80% at 70% 45%, transparent 35%, rgba(0, 0, 0, 0.28) 100%),
			linear-gradient(90deg, rgba(0, 0, 0, 0.35) 0%, transparent 28%);
		opacity: 1;
	}

	body.cbr-theme .cbr-page--home .cbr-home-hero .cbr-home-hero__copy {
		/* Subtle inner glow — elevates copy frame vs flat black */
		box-shadow: inset -24px 0 48px -28px rgba(0, 0, 0, 0.65);
	}

	body.cbr-theme :is(.cbr-home-hero, .cbr-nol-hero, .cbr-per-hero, .cbr-evt-hero, .cbr-chi-hero) [class*="-hero__cta"] .cbr-btn,
	body.cbr-theme :is(.cbr-home-hero, .cbr-nol-hero, .cbr-per-hero, .cbr-evt-hero, .cbr-chi-hero) [class*="-hero__cta"] :is(.cbr-nol-btn, .cbr-per-btn, .cbr-evt-btn, .cbr-chi-btn, .cbr-con-btn) {
		min-height: 54px;
		box-shadow: var(--cbr-btn-glow, var(--cbr-polish-glow));
		transition:
			transform var(--cbr-polish-duration) var(--cbr-polish-ease),
			box-shadow var(--cbr-polish-duration) var(--cbr-polish-ease),
			background-color var(--cbr-polish-duration) var(--cbr-polish-ease),
			color var(--cbr-polish-duration) var(--cbr-polish-ease),
			border-color var(--cbr-polish-duration) var(--cbr-polish-ease);
	}
}

/* —— CTA: glow oro su TUTTI i bottoni (stato normale + hover più acceso) —— */
body.cbr-theme {
	--cbr-btn-glow: var(--cbr-polish-glow);
	--cbr-btn-glow-hover: var(--cbr-polish-glow-strong);
}

body.cbr-theme :is(
	.cbr-btn,
	.cbr-nol-btn,
	.cbr-per-btn,
	.cbr-con-btn,
	.cbr-evt-btn,
	.cbr-chi-btn,
	.cbr-catalog-pdf-btn,
	.cbr-nol-catalog__filters-toggle,
	a.cbr-btn,
	button.cbr-btn,
	button.cbr-nol-btn,
	button.cbr-per-btn,
	button.cbr-con-btn
):not(.cbr-btn--ghost):not(.cbr-link):not(.cbr-cart-widget__toggle):not(.cbr-cart-widget__quote) {
	border-radius: var(--cbr-polish-radius);
	box-shadow: none !important;
	transition:
		transform var(--cbr-polish-duration) var(--cbr-polish-ease),
		box-shadow var(--cbr-polish-duration) var(--cbr-polish-ease),
		background-color var(--cbr-polish-duration) var(--cbr-polish-ease),
		background-image var(--cbr-polish-duration) var(--cbr-polish-ease),
		color var(--cbr-polish-duration) var(--cbr-polish-ease),
		border-color var(--cbr-polish-duration) var(--cbr-polish-ease);
}

body.cbr-theme :is(
	.cbr-btn,
	.cbr-nol-btn,
	.cbr-per-btn,
	.cbr-con-btn,
	.cbr-evt-btn,
	.cbr-chi-btn,
	.cbr-catalog-pdf-btn,
	.cbr-nol-catalog__filters-toggle,
	a.cbr-btn,
	button.cbr-btn
):not(.cbr-btn--ghost):not(.cbr-link):not(.cbr-cart-widget__toggle):not(.cbr-cart-widget__quote):hover,
body.cbr-theme :is(
	.cbr-btn,
	.cbr-nol-btn,
	.cbr-per-btn,
	.cbr-con-btn,
	.cbr-evt-btn,
	.cbr-chi-btn,
	.cbr-catalog-pdf-btn,
	.cbr-nol-catalog__filters-toggle,
	a.cbr-btn,
	button.cbr-btn
):not(.cbr-btn--ghost):not(.cbr-link):not(.cbr-cart-widget__toggle):not(.cbr-cart-widget__quote):focus-visible {
	transform: none;
	box-shadow: none !important;
}

body.cbr-theme :is(
	.cbr-btn,
	.cbr-nol-btn,
	.cbr-per-btn,
	.cbr-con-btn,
	.cbr-evt-btn,
	.cbr-chi-btn,
	.cbr-catalog-pdf-btn,
	a.cbr-btn,
	button.cbr-btn
):not(.cbr-btn--ghost):not(.cbr-link):not(.cbr-cart-widget__toggle):not(.cbr-cart-widget__quote):active {
	transform: translateY(0);
	transition-duration: 140ms;
}

/* Modale / pannello carrello — nessun bagliore oro */
body.cbr-theme :is(
	.cbr-cart-widget,
	.cbr-cart-widget__panel,
	.cbr-cart-panel,
	.cbr-cart-receipt,
	.cbr-quote-modal
) :is(
	.cbr-btn,
	.cbr-nol-btn,
	.cbr-per-btn,
	.cbr-con-btn,
	.cbr-cart-widget__quote,
	.cbr-cart-widget__close,
	.cbr-cart-panel__qty-btn,
	.cbr-cart-receipt__qty-btn,
	button
),
body.cbr-theme :is(
	.cbr-cart-widget__toggle,
	.cbr-cart-widget__quote,
	.cbr-cart-widget__panel,
	.cbr-cart-widget__close
) {
	box-shadow: none !important;
	filter: none !important;
}

body.cbr-theme .cbr-cart-widget__toggle {
	box-shadow: var(--cbr-shadow) !important;
}

body.cbr-theme .cbr-cart-widget__toggle:hover,
body.cbr-theme .cbr-cart-widget__toggle:focus-visible {
	box-shadow: var(--cbr-shadow) !important;
	transform: translateY(-1px);
}

/* —— Card: elevazione, radius, hover premium —— */
body.cbr-theme :is(
	.cbr-card,
	.cbr-evt-card,
	.cbr-product-card,
	.cbr-staff-card,
	.cbr-value-card,
	.cbr-case-card,
	.cbr-nol-product,
	.cbr-nol-mise,
	.cbr-con-card,
	.cbr-per-service,
	[class*="__card"]:not(.cbr-cart-panel):not(.cbr-cart-receipt)
) {
	border-radius: var(--cbr-polish-radius);
	transition:
		transform var(--cbr-polish-duration) var(--cbr-polish-ease),
		box-shadow var(--cbr-polish-duration) var(--cbr-polish-ease),
		border-color var(--cbr-polish-duration) var(--cbr-polish-ease);
}

@media (hover: hover) and (pointer: fine) {
	body.cbr-theme :is(
		.cbr-card,
		.cbr-evt-card,
		.cbr-product-card,
		.cbr-staff-card,
		.cbr-value-card,
		.cbr-case-card,
		.cbr-nol-product,
		.cbr-nol-mise,
		.cbr-con-card,
		.cbr-per-service
	):hover {
		transform: translateY(-4px);
		box-shadow: var(--cbr-polish-shadow-hover);
	}

	/* Image hover — gentle scale, feels integrated in layout */
	body.cbr-theme :is(
		.cbr-card img,
		.cbr-evt-card img,
		.cbr-product-card img,
		.cbr-staff-card img,
		.cbr-nol-product img,
		.cbr-nol-mise img,
		.cbr-home-service__image,
		.cbr-home-andrea__image,
		.cbr-home-events-signed__media img
	) {
		transition: transform 380ms var(--cbr-polish-ease), filter 380ms var(--cbr-polish-ease);
	}

	body.cbr-theme :is(
		.cbr-card:hover img,
		.cbr-evt-card:hover img,
		.cbr-product-card:hover img,
		.cbr-staff-card:hover img,
		.cbr-nol-product:hover img,
		.cbr-nol-mise:hover img,
		.cbr-home-service--hero:hover .cbr-home-service__image,
		.cbr-home-andrea:hover .cbr-home-andrea__image
	) {
		transform: scale(1.03);
		filter: brightness(1.04);
	}
}

/* Partners logos — quieter hover, less noise */
@media (hover: hover) and (pointer: fine) {
	body.cbr-theme .cbr-home-partners__logo {
		transition: transform 300ms var(--cbr-polish-ease), opacity 300ms var(--cbr-polish-ease), filter 300ms var(--cbr-polish-ease);
		opacity: 0.88;
	}

	body.cbr-theme .cbr-home-partners__item:hover .cbr-home-partners__logo {
		transform: scale(1.06);
		opacity: 1;
		filter: brightness(1.08);
	}
}

/* —— Scroll reveal handled in design-enrichment.css —— */

@media (prefers-reduced-motion: reduce) {
	body.cbr-theme :is(.cbr-btn, .cbr-nol-btn, .cbr-per-btn, .cbr-con-btn, .cbr-evt-btn, .cbr-chi-btn),
	body.cbr-theme :is(.cbr-card, .cbr-evt-card, .cbr-product-card, .cbr-staff-card):hover {
		transform: none !important;
		transition: none !important;
	}
}

/* —— Mobile-first UX polish —— */
@media (max-width: 1023px) {
	/* Vertical rhythm — more air, faster scanning */
	body.cbr-theme {
		--cbr-section-gap: 72px;
		--cbr-section-pad-top: var(--cbr-section-gap);
		--cbr-body-line-polish: 1.6;
		--cbr-btn-height: 48px;
		--cbr-btn-padding-x: 16px;
		--cbr-section-title-size: var(--cbr-hero-title-size);
	}

	body.cbr-theme .cbr-page--home {
		--cbr-section-gap: 96px;
		--cbr-section-pad-top: var(--cbr-section-gap);
	}

	/* CTA nearly full-bleed — thumb-friendly conversion */
	body.cbr-theme :is(
		[class*="-hero__cta"] .cbr-btn,
		[class*="-hero__cta"] .cbr-nol-btn,
		[class*="-hero__cta"] .cbr-per-btn,
		[class*="-hero__cta"] .cbr-con-btn,
		[class*="-hero__cta"] .cbr-evt-btn,
		[class*="-hero__cta"] .cbr-chi-btn,
		.cbr-home-service__cta-btn,
		.cbr-home-events-signed__cta .cbr-btn,
		.cbr-contact-form--page .cbr-btn,
		.cbr-form .cbr-btn,
		.cbr-con-form .cbr-btn
	) {
		width: 100% !important;
		max-width: 100% !important;
		min-width: 0 !important;
		min-height: 48px;
		height: auto;
		max-height: none;
		padding-block: 0.85rem;
	}

	body.cbr-theme [class*="-hero__cta"]:not([class*="--dual"]) {
		width: 100% !important;
		max-width: 100% !important;
	}

	/* Touch targets ≥ 44×44 */
	body.cbr-theme :is(
		.cbr-btn,
		.cbr-nol-btn,
		.cbr-per-btn,
		.cbr-con-btn,
		.cbr-evt-btn,
		.cbr-chi-btn,
		.cbr-nav-toggle,
		.cbr-mobile-nav__link,
		.cbr-cart-widget__toggle,
		.cbr-con-cart-trigger,
		a.cbr-link
	) {
		min-height: 44px;
	}

	body.cbr-theme .cbr-mobile-nav__link {
		display: flex;
		align-items: center;
		padding-block: 0.95rem;
		font-size: 1.15rem;
		letter-spacing: 0.04em;
		border-bottom-color: rgba(201, 162, 39, 0.12);
	}

	/* Menu — cleaner panel, softer open feel via opacity on body class */
	body.cbr-theme .cbr-mobile-nav {
		background: #000000;
		backdrop-filter: blur(8px);
		-webkit-backdrop-filter: blur(8px);
	}

	body.cbr-theme .cbr-mobile-nav__panel {
		padding-top: calc(max(env(safe-area-inset-top, 0px), 0px) + var(--cbr-header-height) + 2rem);
		gap: 0.25rem;
	}

	body.cbr-nav-open .cbr-mobile-nav:not([hidden]) {
		animation: cbr-nav-fade-in 280ms var(--cbr-polish-ease);
	}

	/* Cinematic media proportions on stacked heroes/cards */
	body.cbr-theme {
		--cbr-hero-mobile-media-height: 300px;
	}

	body.cbr-theme :is(
		[class*="-hero__text"],
		.cbr-section-lead,
		.cbr-copy,
		.cbr-home-service__text,
		.cbr-home-partners__text,
		.cbr-home-andrea__text
	) {
		max-width: 34rem;
		line-height: 1.6;
	}

	/* Forms — larger fields, clearer hierarchy */
	body.cbr-theme :is(
		.cbr-form__input,
		.cbr-form__textarea,
		.cbr-form__select,
		.cbr-contact-form--page .cbr-form__input,
		.cbr-contact-form--page .cbr-form__textarea,
		.cbr-contact-form--page select
	) {
		min-height: 48px;
		padding: 0.85rem 1rem;
		font-size: 16px; /* avoid iOS zoom */
		border-radius: var(--cbr-polish-radius);
		border-color: rgba(201, 162, 39, 0.28);
		transition: border-color 240ms var(--cbr-polish-ease), box-shadow 240ms var(--cbr-polish-ease);
	}

	body.cbr-theme :is(.cbr-form__textarea, .cbr-contact-form--page .cbr-form__textarea) {
		min-height: 140px;
	}

	body.cbr-theme :is(.cbr-form__input, .cbr-form__textarea, .cbr-form__select):focus,
	body.cbr-theme :is(.cbr-contact-form--page .cbr-form__input, .cbr-contact-form--page .cbr-form__textarea):focus {
		outline: none;
		border-color: var(--cbr-gold);
		box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.18);
	}

	body.cbr-theme :is(.cbr-form__error, .cbr-form__field.is-invalid .cbr-form__hint, [aria-invalid="true"] + .cbr-form__hint) {
		color: #f0b4b4;
		font-size: 0.875rem;
		margin-top: 0.4rem;
	}

	body.cbr-theme .cbr-form__field {
		margin-bottom: 1.15rem;
	}

	/* Reduce visual noise — quieter secondary chrome */
	body.cbr-theme .cbr-home-partners__grid {
		gap: 1.35rem 0.65rem;
	}

	/* Disable heavy card lift on touch (sticky hover issues) */
	body.cbr-theme :is(.cbr-card, .cbr-evt-card, .cbr-product-card, .cbr-staff-card):active {
		transform: scale(0.99);
	}
}

@keyframes cbr-nav-fade-in {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

/* —— Desktop polish extras —— */
@media (min-width: 1024px) {
	body.cbr-theme {
		--cbr-section-pad-top: 124px;
		--cbr-coverage-section-pad-y: 124px;
	}

	/* Footer breathing room — closes the page with the same rhythm (not home: gap on .cbr-page--home) */
	body.cbr-theme:not(.cbr-front-page) .cbr-site-footer {
		padding-block-start: clamp(3rem, 6vw, 5rem);
		background: #000000 !important;
	}
}
