/*!
 * Free Estimate Popup — public styles
 * All selectors are namespaced with .fep- to avoid collisions with the
 * active theme (including Divi's own utility classes).
 */

.fep-root {
	/* Wrapper only exists to group elements in the DOM; no visual styling. */
	all: initial;
}

/* -------------------------------------------------------------------- */
/* Sliding tab                                                          */
/* -------------------------------------------------------------------- */

.fep-tab {
	position: fixed;
	right: 0;
	transform: translateX(100%);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 22px 14px;
	min-height: 140px;
	border: none;
	border-radius: 8px 0 0 8px;
	box-shadow: -2px 3px 10px rgba(0, 0, 0, 0.25);
	cursor: pointer;
	font-family: Arial, Helvetica, sans-serif;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	font-size: 16px;
	line-height: 1.3;
	transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease, filter 0.25s ease;
	animation: fep-slide-in-tab 0.7s 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/*
 * The label is rotated (not the button itself) so the button's own
 * padding box stays normal, while the text reads bottom-to-top like
 * a classic vertical side tab.
 */
.fep-tab-label {
	display: inline-block;
	writing-mode: vertical-rl;
	text-orientation: mixed;
	transform: rotate(180deg);
	padding: 0 4px;
}

.fep-tab:hover,
.fep-tab:focus-visible {
	filter: brightness(1.05);
	box-shadow: -4px 4px 14px rgba(0, 0, 0, 0.32);
	transform: translateX(-4px);
}

.fep-tab:focus-visible {
	outline: 3px solid #1a73e8;
	outline-offset: 2px;
}

@keyframes fep-slide-in-tab {
	from {
		transform: translateX(100%);
	}
	to {
		transform: translateX(0);
	}
}

@media (prefers-reduced-motion: reduce) {
	.fep-tab {
		animation: none;
		transform: translateX(0);
		transition: none;
	}
}

/* -------------------------------------------------------------------- */
/* Popup                                                                */
/* -------------------------------------------------------------------- */

.fep-popup {
	position: fixed;
	top: 0;
	right: 0;
	height: 100%;
	width: 100%;
	max-width: calc(var(--fep-popup-width, 900px) + 40px);
	display: flex;
	align-items: center;
	justify-content: flex-end;
	pointer-events: none;
}

.fep-popup[hidden] {
	display: none;
}

.fep-popup-inner {
	position: relative;
	width: min(100%, var(--fep-popup-width, 900px));
	height: min(92vh, calc(var(--fep-popup-height, 700px) + 60px));
	max-height: 92vh;
	background: #ffffff;
	border-radius: 16px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	transform: translateX(110%);
	opacity: 0;
	transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.35s ease;
	margin: 20px;
	pointer-events: auto;
}

.fep-popup.is-open .fep-popup-inner {
	transform: translateX(0);
	opacity: 1;
}

.fep-popup-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 18px;
	background: #fafafa;
	border-bottom: 1px solid #ececec;
	font-family: Arial, Helvetica, sans-serif;
}

.fep-popup-title {
	font-weight: 700;
	font-size: 16px;
	color: #1c1c1c;
}

.fep-popup-close {
	appearance: none;
	background: transparent;
	border: none;
	font-size: 26px;
	line-height: 1;
	color: #555;
	cursor: pointer;
	padding: 4px 8px;
	border-radius: 50%;
	transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.fep-popup-close:hover,
.fep-popup-close:focus-visible {
	background-color: #f0f0f0;
	color: #000;
	transform: rotate(90deg);
}

.fep-popup-close:focus-visible {
	outline: 2px solid #1a73e8;
	outline-offset: 2px;
}

.fep-popup-body {
	position: relative;
	flex: 1 1 auto;
	overflow: auto;
	background: #fff;
}

.fep-iframe {
	display: block;
	width: 100%;
	height: 100%;
	min-height: 400px;
	border: 0;
}

.fep-iframe-loader {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #fff;
	pointer-events: none;
	opacity: 1;
	transition: opacity 0.3s ease;
}

.fep-iframe-loader::after {
	content: "";
	width: 38px;
	height: 38px;
	border-radius: 50%;
	border: 4px solid #eee;
	border-top-color: #ffd400;
	animation: fep-spin 0.8s linear infinite;
}

.fep-popup.is-loaded .fep-iframe-loader {
	opacity: 0;
}

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

/* -------------------------------------------------------------------- */
/* Backdrop / scroll lock                                               */
/* -------------------------------------------------------------------- */

body.fep-scroll-lock {
	overflow: hidden !important;
}

.fep-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.45);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.35s ease;
	z-index: 999998;
}

.fep-backdrop.is-visible {
	opacity: 1;
	visibility: visible;
}

/* -------------------------------------------------------------------- */
/* Responsive                                                           */
/* -------------------------------------------------------------------- */

@media (max-width: 782px) {
	.fep-tab {
		min-height: 110px;
		font-size: 13px;
		padding: 10px 8px;
	}

	.fep-popup-inner {
		width: 100%;
		max-height: 100%;
		height: 100%;
		margin: 0;
		border-radius: 0;
	}

	.fep-popup {
		max-width: 100%;
	}
}

body.fep-hide-tab-mobile .fep-tab {
	display: none;
}
