/* =========================================================
   Pricing-table popup modals (vgc-modal)
   Overrides Bootstrap 2.3.2 .modal defaults for a modern,
   mobile-friendly experience with stacked content on phones.
   ========================================================= */

/* ---- Backdrop ---- */
.modal-backdrop,
.modal-backdrop.fade.in {
	background-color: #000;
	opacity: 0.75;
	filter: alpha(opacity=75);
}

/* ---- Desktop / tablet (default >= 768px) ---- */
.vgc-modal {
	position: fixed;
	top: 5vh;
	left: 50%;
	transform: translateX(-50%);
	margin-left: 0;
	width: 92vw;
	max-width: 960px;
	height: 90vh;
	max-height: 90vh;
	flex-direction: column;
	background-color: #fff;
	border: 1px solid rgba(0, 0, 0, 0.1);
	border-radius: 8px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
	outline: 0;
	overflow: hidden;
	-webkit-overflow-scrolling: touch;
}

/* BS2 keeps the .hide class; when open it adds .in and inline display:block.
   Force flex layout only for visible/open modals. */
.vgc-modal.in {
	display: flex !important;
}

.vgc-modal.fade {
	top: -5vh;
	opacity: 0;
	-webkit-transition: opacity 0.25s linear, top 0.25s ease-out, transform 0.25s ease-out;
	transition: opacity 0.25s linear, top 0.25s ease-out, transform 0.25s ease-out;
}

.vgc-modal.fade.in {
	top: 5vh;
	opacity: 1;
}

/* ---- Header (sticky so the close button is always reachable) ---- */
.vgc-modal .modal-header {
	position: sticky;
	top: 0;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 20px;
	margin: 0;
	background-color: #fff;
	border-bottom: 1px solid #eaeaea;
	border-top-left-radius: 8px;
	border-top-right-radius: 8px;
	flex: 0 0 auto;
}

.vgc-modal .modal-header h3 {
	margin: 0;
	font-size: 20px;
	line-height: 1.2;
	font-weight: 700;
	color: #222;
	order: 0;
	flex: 1 1 auto;
	min-width: 0;
}

.vgc-modal .vgc-modal-actions {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 4px;
	order: 1;
	flex: 0 0 auto;
	position: relative;
}

.vgc-modal .vgc-modal-share,
.vgc-modal .vgc-modal-close {
	position: relative;
	top: 0;
	right: 0;
	float: none;
	margin: 0;
	padding: 0;
	width: 44px;
	height: 44px;
	border: 0;
	background: transparent;
	font-size: 28px;
	line-height: 1;
	color: #444;
	opacity: 0.7;
	cursor: pointer;
	border-radius: 50%;
	-webkit-appearance: none;
	appearance: none;
	text-shadow: none;
}

.vgc-modal .vgc-modal-share {
	font-size: 18px;
}

.vgc-modal .vgc-modal-share i {
	display: inline-block;
	pointer-events: none;
}

.vgc-modal .vgc-modal-share:hover,
.vgc-modal .vgc-modal-share:focus,
.vgc-modal .vgc-modal-close:hover,
.vgc-modal .vgc-modal-close:focus {
	background: rgba(0, 0, 0, 0.06);
	opacity: 1;
	outline: 2px solid transparent;
	outline-offset: 2px;
}

.vgc-modal .vgc-modal-share-status {
	position: absolute;
	top: 100%;
	right: 0;
	margin-top: 3px;
	white-space: nowrap;
	font-size: 12px;
	line-height: 1.2;
	color: #555;
	background: #fff;
	border-radius: 4px;
	padding: 2px 6px;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

/* ---- Body (scrollable, fluid) ---- */
.vgc-modal .modal-body {
	position: relative;
	flex: 1 1 auto;
	min-height: 0;
	max-height: none;
	padding: 20px;
	overflow-y: auto !important;
	-webkit-overflow-scrolling: touch;
}

.vgc-modal-intro {
	font-size: 16px;
	line-height: 1.5;
	color: #333;
	margin: 0 0 20px 0;
	text-align: center;
}

.vgc-modal-scroll-hint {
	font-size: 14px;
	line-height: 1.4;
	color: #555;
	text-align: center;
	margin: -8px 0 16px;
}

/* ---- Image / media grid ---- */
.vgc-modal-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 16px;
	align-items: start;
}

.vgc-modal-grid > img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 6px;
	background-color: #f2f2f2;
}

/* ---- YouTube video list (16:9 responsive) ---- */
.vgc-modal-video-list {
	display: grid;
	grid-template-columns: 1fr;
	gap: 20px;
}

.vgc-modal-video {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	background: #000;
	border-radius: 6px;
	overflow: hidden;
}

.vgc-modal-video iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

/* Fallback for browsers without aspect-ratio support */
@supports not (aspect-ratio: 16 / 9) {
	.vgc-modal-video {
		aspect-ratio: auto;
		padding-top: 56.25%;
		height: 0;
	}
}

/* ---- Instagram embed wrapper ---- */
.vgc-modal-grid--ig {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.vgc-modal-ig {
	display: flex;
	justify-content: center;
	min-width: 0;
}

.vgc-modal-ig .instagram-media {
	margin: 0 auto !important;
	max-width: 100% !important;
	min-width: 0 !important;
	width: 100% !important;
}

/* ---- Mobile (<= 767px): full-screen sheet ---- */
@media (max-width: 767px) {
	.vgc-modal {
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
		transform: none;
		width: 100vw;
		max-width: none;
		height: 100vh;
		/* dynamic viewport height avoids iOS URL-bar jumps */
		height: 100dvh;
		max-height: none;
		margin: 0;
		border: 0;
		border-radius: 0;
		box-shadow: none;
	}

	.vgc-modal.fade {
		top: 0;
		transform: translateY(16px);
	}

	.vgc-modal.fade.in {
		top: 0;
		transform: translateY(0);
	}

	.vgc-modal .modal-header {
		padding: 12px 14px;
		border-radius: 0;
	}

	.vgc-modal .modal-header h3 {
		font-size: 18px;
	}

	.vgc-modal .vgc-modal-actions {
		gap: 2px;
	}

	.vgc-modal .vgc-modal-share,
	.vgc-modal .vgc-modal-close {
		width: 44px;
		height: 44px;
	}

	.vgc-modal .modal-body {
		padding: 16px 14px 32px;
	}

	.vgc-modal-grid,
	.vgc-modal-grid--ig,
	.vgc-modal-video-list {
		grid-template-columns: 1fr;
		gap: 14px;
	}

	.vgc-modal-intro {
		font-size: 15px;
		text-align: left;
	}

	.vgc-modal-scroll-hint {
		text-align: left;
		font-size: 13px;
		margin: -4px 0 12px;
	}
}

/* ---- Background scroll lock while modal is open ---- */
html.vgc-modal-open,
body.vgc-modal-open {
	overflow: hidden;
}

/* ---- Reduced motion preference ---- */
@media (prefers-reduced-motion: reduce) {
	.vgc-modal.fade,
	.vgc-modal.fade.in,
	.modal-backdrop.fade,
	.modal-backdrop.fade.in {
		-webkit-transition: none !important;
		transition: none !important;
		transform: none !important;
	}
}
