/* Header shell: no internal scrollbars from mysticky / dual-header DOM. */
#mysticky-nav,
#mysticky-wrap,
#masthead,
#masthead .site-primary-header-wrap,
#masthead .ast-builder-grid-row {
	overflow: visible !important;
	height: auto !important;
	max-height: none !important;
}

#mysticky-nav.wrapfixed {
	overflow: visible !important;
}

/* Header "Agenda tu cita" — keep it a horizontal pill, not a tall squeezed capsule. */
.site-header .header-widget-area[data-section="sidebar-widgets-header-widget-1"] {
	min-width: 0;
}

.site-header .site-header-primary-section-right .header-widget-area {
	min-width: max-content;
}

.site-header .header-widget-area .wp-block-uagb-buttons,
.site-header .header-widget-area .uagb-buttons__wrap,
.site-header .header-widget-area .wp-block-uagb-buttons-child,
.site-header .header-widget-area .uagb-button__wrapper {
	width: auto;
	max-width: none;
}

.site-header .header-widget-area a.uagb-buttons-repeater.wp-block-button__link {
	display: inline-flex !important;
	flex-direction: row !important;
	flex-wrap: nowrap !important;
	align-items: center;
	justify-content: center;
	gap: 8px;
	height: auto !important;
	width: auto !important;
	max-width: none !important;
	padding: 10px 18px !important;
	border-radius: 999px !important;
	background-color: #cb997e !important;
	color: #fff !important;
	font-family: Poppins, system-ui, sans-serif;
	font-size: 13px !important;
	font-weight: 600;
	line-height: 1.2 !important;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	text-decoration: none !important;
	white-space: nowrap !important;
	overflow-wrap: normal !important;
	word-break: normal !important;
	box-sizing: border-box;
}

.site-header .header-widget-area a.uagb-buttons-repeater.wp-block-button__link:hover,
.site-header .header-widget-area a.uagb-buttons-repeater.wp-block-button__link:focus {
	background-color: #b8876d !important;
	color: #fff !important;
}

.site-header .header-widget-area .uagb-button__icon {
	display: inline-flex;
	align-items: center;
	flex-shrink: 0;
	margin: 0 !important;
}

.site-header .header-widget-area .uagb-button__icon svg {
	width: 15px;
	height: 15px;
	fill: currentColor;
}

.site-header .header-widget-area .uagb-button__link {
	display: inline !important;
	white-space: nowrap !important;
	overflow-wrap: normal !important;
	word-break: normal !important;
}

/* Desktop/tablet: single-row header (logo | nav | CTA). */
@media (min-width: 783px) {
	#ast-desktop-header .ast-builder-grid-row.ast-grid-center-col-layout {
		display: flex;
		flex-wrap: nowrap;
		align-items: center;
		justify-content: space-between;
		gap: 12px;
	}

	#ast-desktop-header .site-header-primary-section-left {
		flex: 0 0 auto;
	}

	#ast-desktop-header .site-header-primary-section-center {
		flex: 1 1 auto;
		min-width: 0;
	}

	#ast-desktop-header .site-header-primary-section-right {
		flex: 0 0 auto;
	}

	#ast-desktop-header #ast-hf-menu-1,
	.ast-desktop .main-header-menu {
		display: flex;
		flex-wrap: nowrap !important;
		gap: 1.25rem;
	}

	.ast-desktop .main-header-menu > .menu-item > .menu-link {
		white-space: nowrap !important;
	}

	.ast-desktop .main-header-menu .sub-menu {
		min-width: max-content;
		width: auto;
	}

	.ast-desktop .main-header-menu .sub-menu .menu-link {
		white-space: nowrap !important;
	}

	.ast-desktop .main-header-menu .ast-menu-toggle {
		display: none !important;
	}

	.ast-desktop .main-header-menu > .menu-item-has-children:hover > .sub-menu,
	.ast-desktop .main-header-menu > .menu-item-has-children.focus > .sub-menu {
		opacity: 1;
		visibility: visible;
	}

	#ast-desktop-header .custom-mobile-logo-link {
		display: none !important;
	}

	#ast-mobile-header,
	#ast-mobile-header .ast-mobile-header-content,
	.ast-mobile-header-content {
		display: none !important;
	}
}

/* Fallback aligned with Astra breakpoint (782px) when dynamic CSS is cached. */
@media (max-width: 782px) {
	#ast-desktop-header {
		display: none !important;
	}
}

/* Mobile: clean dropdown panel, no absolute bleed. */
@media (max-width: 782px) {
	.ast-main-header-nav-open #ast-mobile-header .ast-mobile-header-content {
		position: static;
		width: 100%;
		display: block;
	}

	.ast-header-break-point .site-logo-img .custom-logo-link {
		display: none !important;
	}

	.ast-header-break-point .site-logo-img .custom-mobile-logo-link {
		display: inline-flex !important;
		align-items: center;
	}

	.ast-header-break-point .site-logo-img .custom-mobile-logo-link img {
		display: block !important;
		max-height: 48px;
		width: auto;
		height: auto;
	}
}
