/* ==========================================================================
   IndiaBiz Popup Manager — Frontend Styles
   Namespace: .ibpm- / --ibpm-  (do not use unprefixed selectors here)
   ========================================================================== */

.ibpm-popup {
	position: fixed;
	inset: 0;
	z-index: var(--ibpm-zindex, 999999);
	display: none;
	pointer-events: none;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	box-sizing: border-box;
}
.ibpm-popup *,
.ibpm-popup *::before,
.ibpm-popup *::after {
	box-sizing: border-box;
}
.ibpm-popup.ibpm-is-open {
	display: block;
	pointer-events: auto;
}

/* Overlay ----------------------------------------------------------- */
.ibpm-popup__overlay {
	position: absolute;
	inset: 0;
	background-color: var(--ibpm-overlay-color, #000);
	opacity: 0;
	backdrop-filter: blur(var(--ibpm-overlay-blur, 0));
	-webkit-backdrop-filter: blur(var(--ibpm-overlay-blur, 0));
	transition: opacity var(--ibpm-speed, 350ms) ease;
}
.ibpm-popup.ibpm-is-open .ibpm-popup__overlay {
	opacity: var(--ibpm-overlay-opacity, .6);
}

/* Wrapper (the visible card/bar/panel) ------------------------------- */
.ibpm-popup__wrapper {
	position: relative;
	background-color: var(--ibpm-bg, #fff);
	background-image: var(--ibpm-bg-image, none);
	background-size: cover;
	background-position: center;
	border-width: var(--ibpm-border-width, 0);
	border-style: var(--ibpm-border-style, solid);
	border-color: var(--ibpm-border-color, transparent);
	border-radius: var(--ibpm-radius, 0);
	padding: var(--ibpm-padding, 32px);
	box-shadow: var(--ibpm-shadow, none);
	max-width: 96vw;
	overflow: auto;
	-webkit-overflow-scrolling: touch;
}
.ibpm-popup__content {
	line-height: 1.6;
	font-size: 15px;
	color: #222;
}
.ibpm-popup__content img { max-width: 100%; height: auto; }
.ibpm-popup__content table { width: 100%; border-collapse: collapse; }

/* Close button -------------------------------------------------------- */
.ibpm-popup__close {
	position: absolute;
	width: var(--ibpm-close-size, 32px);
	height: var(--ibpm-close-size, 32px);
	line-height: var(--ibpm-close-size, 32px);
	text-align: center;
	font-size: calc(var(--ibpm-close-size, 32px) * 0.55);
	color: var(--ibpm-close-color, #666);
	background: var(--ibpm-close-bg, #f2f2f2);
	border: 0;
	border-radius: var(--ibpm-close-radius, 50%);
	cursor: pointer;
	padding: 0;
	z-index: 2;
	transition: transform .15s ease, opacity .15s ease;
}
.ibpm-popup__close:hover { transform: scale(1.08); opacity: .85; }
.ibpm-popup__close--top-right { top: 12px; right: 12px; }
.ibpm-popup__close--top-left  { top: 12px; left: 12px; }
.ibpm-popup__close--outside-top-right { top: -14px; right: -14px; }

/* -------------------------------------------------------------------
 * POSITION: Center Modal
 * ------------------------------------------------------------------- */
.ibpm-popup--center {
	display: none;
}
.ibpm-popup--center.ibpm-is-open {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
}
.ibpm-popup--center .ibpm-popup__wrapper {
	width: var(--ibpm-width, 560px);
	max-width: var(--ibpm-max-width, 92vw);
	height: var(--ibpm-height, auto);
	max-height: var(--ibpm-max-height, 90vh);
}

/* -------------------------------------------------------------------
 * POSITION: Bottom / Top Bars
 * ------------------------------------------------------------------- */
.ibpm-popup--bottom-bar,
.ibpm-popup--top-bar {
	inset: auto;
}
.ibpm-popup--bottom-bar.ibpm-is-open,
.ibpm-popup--top-bar.ibpm-is-open {
	display: block;
	left: 0;
	right: 0;
	width: 100%;
}
.ibpm-popup--bottom-bar.ibpm-is-open { bottom: 0; }
.ibpm-popup--top-bar.ibpm-is-open { top: 0; }
.ibpm-popup--bottom-bar .ibpm-popup__wrapper,
.ibpm-popup--top-bar .ibpm-popup__wrapper {
	max-width: 100%;
	width: 100%;
	min-height: var(--ibpm-bar-height, 56px);
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	flex-wrap: wrap;
	gap: 8px 16px;
}
.ibpm-popup--bottom-bar .ibpm-popup__overlay,
.ibpm-popup--top-bar .ibpm-popup__overlay {
	position: fixed;
}

/* -------------------------------------------------------------------
 * POSITION: Floating boxes (4 corners)
 * ------------------------------------------------------------------- */
.ibpm-popup--top-right,
.ibpm-popup--top-left,
.ibpm-popup--bottom-right,
.ibpm-popup--bottom-left {
	inset: auto;
}
.ibpm-popup--top-right.ibpm-is-open,
.ibpm-popup--top-left.ibpm-is-open,
.ibpm-popup--bottom-right.ibpm-is-open,
.ibpm-popup--bottom-left.ibpm-is-open {
	display: block;
	position: fixed;
}
.ibpm-popup--top-right.ibpm-is-open    { top: var(--ibpm-edge-distance, 24px); right: var(--ibpm-edge-distance, 24px); }
.ibpm-popup--top-left.ibpm-is-open     { top: var(--ibpm-edge-distance, 24px); left: var(--ibpm-edge-distance, 24px); }
.ibpm-popup--bottom-right.ibpm-is-open { bottom: var(--ibpm-edge-distance, 24px); right: var(--ibpm-edge-distance, 24px); }
.ibpm-popup--bottom-left.ibpm-is-open  { bottom: var(--ibpm-edge-distance, 24px); left: var(--ibpm-edge-distance, 24px); }
.ibpm-popup--top-right .ibpm-popup__wrapper,
.ibpm-popup--top-left .ibpm-popup__wrapper,
.ibpm-popup--bottom-right .ibpm-popup__wrapper,
.ibpm-popup--bottom-left .ibpm-popup__wrapper {
	width: var(--ibpm-panel-width, 340px);
	max-width: calc(100vw - (2 * var(--ibpm-edge-distance, 24px)));
}
/* Floating boxes typically shouldn't dim the whole page */
.ibpm-popup--top-right .ibpm-popup__overlay,
.ibpm-popup--top-left .ibpm-popup__overlay,
.ibpm-popup--bottom-right .ibpm-popup__overlay,
.ibpm-popup--bottom-left .ibpm-popup__overlay {
	background: transparent;
	pointer-events: none;
}

/* -------------------------------------------------------------------
 * POSITION: Side panels
 * ------------------------------------------------------------------- */
.ibpm-popup--right-panel.ibpm-is-open,
.ibpm-popup--left-panel.ibpm-is-open {
	display: block;
}
.ibpm-popup--right-panel .ibpm-popup__wrapper,
.ibpm-popup--left-panel .ibpm-popup__wrapper {
	position: fixed;
	top: 0;
	bottom: 0;
	width: var(--ibpm-panel-width, 380px);
	max-width: 92vw;
	height: 100%;
	max-height: 100vh;
	border-radius: 0;
	overflow-y: auto;
}
.ibpm-popup--right-panel .ibpm-popup__wrapper { right: 0; }
.ibpm-popup--left-panel .ibpm-popup__wrapper { left: 0; }

/* -------------------------------------------------------------------
 * POSITION: Full-width banner / full-screen overlay
 * ------------------------------------------------------------------- */
.ibpm-popup--full-banner.ibpm-is-open {
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding-top: 5vh;
}
.ibpm-popup--full-banner .ibpm-popup__wrapper {
	width: var(--ibpm-width, 100%);
	max-width: var(--ibpm-max-width, 1100px);
}
.ibpm-popup--full-screen.ibpm-is-open {
	display: flex;
	align-items: center;
	justify-content: center;
}
.ibpm-popup--full-screen .ibpm-popup__wrapper {
	width: 100vw;
	height: 100vh;
	max-width: 100vw;
	max-height: 100vh;
	border-radius: 0;
	overflow-y: auto;
}

/* -------------------------------------------------------------------
 * Animations (CSS-only, no library)
 * ------------------------------------------------------------------- */
.ibpm-popup .ibpm-popup__wrapper,
.ibpm-popup .ibpm-popup__overlay {
	transition-duration: var(--ibpm-speed, 350ms);
	transition-timing-function: cubic-bezier(.2,.8,.2,1);
}

.ibpm-anim--fade .ibpm-popup__wrapper { opacity: 0; transition-property: opacity; }
.ibpm-anim--fade.ibpm-is-open .ibpm-popup__wrapper { opacity: 1; }

.ibpm-anim--zoom .ibpm-popup__wrapper { opacity: 0; transform: scale(.92); transition-property: opacity, transform; }
.ibpm-anim--zoom.ibpm-is-open .ibpm-popup__wrapper { opacity: 1; transform: scale(1); }

.ibpm-anim--slide-up .ibpm-popup__wrapper { opacity: 0; transform: translateY(24px); transition-property: opacity, transform; }
.ibpm-anim--slide-up.ibpm-is-open .ibpm-popup__wrapper { opacity: 1; transform: translateY(0); }

.ibpm-anim--slide-down .ibpm-popup__wrapper { opacity: 0; transform: translateY(-24px); transition-property: opacity, transform; }
.ibpm-anim--slide-down.ibpm-is-open .ibpm-popup__wrapper { opacity: 1; transform: translateY(0); }

.ibpm-anim--slide-left .ibpm-popup__wrapper { opacity: 0; transform: translateX(24px); transition-property: opacity, transform; }
.ibpm-anim--slide-left.ibpm-is-open .ibpm-popup__wrapper { opacity: 1; transform: translateX(0); }

.ibpm-anim--slide-right .ibpm-popup__wrapper { opacity: 0; transform: translateX(-24px); transition-property: opacity, transform; }
.ibpm-anim--slide-right.ibpm-is-open .ibpm-popup__wrapper { opacity: 1; transform: translateX(0); }

.ibpm-anim--none .ibpm-popup__wrapper { transition: none; }

/* Side panels slide in from their own edge regardless of chosen animation */
.ibpm-popup--right-panel .ibpm-popup__wrapper { transform: translateX(100%); opacity: 1; transition-property: transform; }
.ibpm-popup--right-panel.ibpm-is-open .ibpm-popup__wrapper { transform: translateX(0); }
.ibpm-popup--left-panel .ibpm-popup__wrapper { transform: translateX(-100%); opacity: 1; transition-property: transform; }
.ibpm-popup--left-panel.ibpm-is-open .ibpm-popup__wrapper { transform: translateX(0); }

/* -------------------------------------------------------------------
 * Responsive
 * ------------------------------------------------------------------- */
@media (max-width: 1024px) {
	.ibpm-hide-tablet { display: none !important; }
	.ibpm-popup__wrapper {
		width: var(--ibpm-tablet-width, var(--ibpm-width, 100%));
		padding: var(--ibpm-tablet-padding, var(--ibpm-padding, 24px));
	}
}

@media (min-width: 1025px) {
	.ibpm-hide-desktop { display: none !important; }
}

@media (max-width: 600px) {
	.ibpm-hide-mobile { display: none !important; }
	.ibpm-popup__wrapper {
		width: var(--ibpm-mobile-width, calc(100vw - 32px));
		max-width: calc(100vw - 24px);
		max-height: var(--ibpm-mobile-max-h, 85vh);
		padding: var(--ibpm-mobile-padding, var(--ibpm-padding, 18px));
	}
	.ibpm-popup--top-right .ibpm-popup__wrapper,
	.ibpm-popup--top-left .ibpm-popup__wrapper,
	.ibpm-popup--bottom-right .ibpm-popup__wrapper,
	.ibpm-popup--bottom-left .ibpm-popup__wrapper {
		width: calc(100vw - 32px);
	}
	.ibpm-popup--bottom-bar .ibpm-popup__wrapper,
	.ibpm-popup--top-bar .ibpm-popup__wrapper {
		flex-direction: column;
		text-align: center;
		padding: 12px 16px;
	}
	.ibpm-popup--right-panel .ibpm-popup__wrapper,
	.ibpm-popup--left-panel .ibpm-popup__wrapper {
		width: 92vw;
	}
}

/* Never allow any popup to cause horizontal scroll */
.ibpm-popup,
.ibpm-popup__wrapper {
	max-width: 100vw;
}
