/**
 * Floating CTA: edge-docked tab (phone, email, label, form, WhatsApp)
 * plus the Gravity Forms slide-over panel.
 *
 * The brand colour arrives as the --sos-cta-brand custom property, set inline
 * from the plugin settings.
 */

.sos-cta {
	position: fixed;
	top: 50%;
	transform: translateY( -50% );
	z-index: 9999;
	font-family: Helvetica, Arial, sans-serif;
}

.sos-cta--right {
	right: 0;
}

.sos-cta--left {
	left: 0;
}

/* The single shape every icon sits inside. Square corners on all four edges. */
.sos-cta__tab {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	overflow: hidden;
	border-radius: 0;
	background: var( --sos-cta-brand, #9ac336 );
	color: #fff;
	box-shadow: 0 4px 16px rgba( 0, 0, 0, 0.22 );
}

/* Icons and the label share one rhythm; the ends get the extra breathing room
   from the design, wherever they land once optional actions drop out.
   Scoped and forced — see the reset note on .sos-cta__item below. */
.sos-cta .sos-cta__item,
.sos-cta .sos-cta__label {
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	padding: 6px 10px !important;
	box-sizing: border-box !important;
}

.sos-cta .sos-cta__tab > :first-child {
	padding-top: 14px !important;
}

.sos-cta .sos-cta__tab > :last-child {
	padding-bottom: 14px !important;
}

/* The form action is a <button> while the other three are <a>. Themes style
   bare buttons globally — background, padding, radius, text-transform — so
   without this the form row alone picks up the theme's button skin and breaks
   the tab. Everything a theme is likely to set is reset here, scoped to .sos-cta
   and forced, because theme and page-builder rules routinely out-specify a
   plain class and often carry !important themselves. Deliberately NOT applied
   inside the panel body, where the Gravity Form should inherit site styles. */
.sos-cta .sos-cta__item {
	width: auto !important;
	min-width: 0 !important;
	max-width: none !important;
	height: auto !important;
	min-height: 0 !important;
	margin: 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	background: transparent !important;
	background-image: none !important;
	color: #fff !important;
	font: inherit !important;
	line-height: 1 !important;
	letter-spacing: normal !important;
	text-transform: none !important;
	text-decoration: none !important;
	text-shadow: none !important;
	box-shadow: none !important;
	filter: none !important;
	transform: none !important;
	cursor: pointer;
	transition: background-color 0.15s ease;
	-webkit-appearance: none !important;
	appearance: none !important;
}

.sos-cta .sos-cta__item:hover,
.sos-cta .sos-cta__item:focus,
.sos-cta .sos-cta__item:focus-visible,
.sos-cta .sos-cta__item:active,
.sos-cta .sos-cta__item:link,
.sos-cta .sos-cta__item:visited {
	color: #fff !important;
	text-decoration: none !important;
	box-shadow: none !important;
	background-image: none !important;
}

.sos-cta .sos-cta__item:hover,
.sos-cta .sos-cta__item:focus-visible {
	background: rgba( 255, 255, 255, 0.15 ) !important;
}

.sos-cta .sos-cta__item:focus-visible {
	outline: 2px solid #fff !important;
	outline-offset: -3px !important;
}

.sos-cta__icon {
	display: block;
	flex: none;
}

.sos-cta__label {
	writing-mode: vertical-rl;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.02em;
	line-height: 1;
	white-space: nowrap;
	-webkit-user-select: none;
	user-select: none;
}

/* --------------------------------------------------------------------------
   Slide-over form panel
   -------------------------------------------------------------------------- */

.sos-cta-overlay {
	position: fixed;
	inset: 0;
	z-index: 10000;
	background: rgba( 0, 0, 0, 0.45 );
	opacity: 0;
	transition: opacity 0.3s ease;
}

.sos-cta-overlay.is-open {
	opacity: 1;
}

.sos-cta-panel {
	position: fixed;
	top: 0;
	bottom: 0;
	z-index: 10001;
	display: flex;
	flex-direction: column;
	width: min( 420px, 100vw );
	background: #fff;
	transition: transform 0.3s ease;
	overscroll-behavior: contain;
}

.sos-cta-panel--right {
	right: 0;
	transform: translateX( 100% );
	box-shadow: -4px 0 24px rgba( 0, 0, 0, 0.18 );
}

.sos-cta-panel--left {
	left: 0;
	transform: translateX( -100% );
	box-shadow: 4px 0 24px rgba( 0, 0, 0, 0.18 );
}

.sos-cta-panel.is-open {
	transform: translateX( 0 );
}

.sos-cta-panel__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex: none;
	padding: 16px 20px;
	background: var( --sos-cta-brand, #9ac336 );
	color: #fff;
}

.sos-cta-panel__title {
	margin: 0;
	padding: 0;
	font-family: Helvetica, Arial, sans-serif;
	font-size: 18px;
	font-weight: 700;
	line-height: 1.3;
	color: #fff;
}

/* Also a bare <button> sitting on the brand header — same theme-override
   problem as the tab's form action, so the same forced reset. */
.sos-cta-panel .sos-cta-panel__close {
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	flex: none;
	width: 36px !important;
	min-width: 0 !important;
	height: 36px !important;
	min-height: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	background: transparent !important;
	background-image: none !important;
	color: #fff !important;
	font: inherit !important;
	text-transform: none !important;
	text-shadow: none !important;
	box-shadow: none !important;
	cursor: pointer;
	transition: background-color 0.15s ease;
	-webkit-appearance: none !important;
	appearance: none !important;
}

.sos-cta-panel .sos-cta-panel__close:hover,
.sos-cta-panel .sos-cta-panel__close:focus-visible {
	background: rgba( 255, 255, 255, 0.2 ) !important;
	color: #fff !important;
}

.sos-cta-panel .sos-cta-panel__close:focus-visible {
	outline: 2px solid #fff !important;
	outline-offset: -3px !important;
}

.sos-cta-panel__body {
	flex: 1 1 auto;
	padding: 20px;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}

/* Stop the page behind the panel from scrolling while it is open. */
.sos-cta-scroll-lock {
	overflow: hidden;
}

/* --------------------------------------------------------------------------
   Small screens: same vertical tab, scaled down
   -------------------------------------------------------------------------- */

@media ( max-width: 600px ) {
	.sos-cta .sos-cta__item,
	.sos-cta .sos-cta__label {
		padding: 5px 8px !important;
	}

	.sos-cta .sos-cta__tab > :first-child {
		padding-top: 12px !important;
	}

	.sos-cta .sos-cta__tab > :last-child {
		padding-bottom: 12px !important;
	}

	.sos-cta__icon {
		width: 18px;
		height: 18px;
	}

	.sos-cta__label {
		font-size: 12px;
	}

	.sos-cta-panel__header {
		padding: 14px 16px;
	}

	.sos-cta-panel__body {
		padding: 16px;
	}
}

@media ( max-width: 480px ) {
	.sos-cta--hide-mobile {
		display: none;
	}
}

@media ( prefers-reduced-motion: reduce ) {
	.sos-cta__item,
	.sos-cta-overlay,
	.sos-cta-panel,
	.sos-cta-panel__close {
		transition: none;
	}
}
