/* ============================================================
   JBH Platform Engine v1.0.0 — modal.css
   Slide-over modal panel UI with Blocksy CSS variable bridge support.
   
   Brand palette:  teal #2A9D8F | teal-dark #1F5F5B | coral #D64F42
                   bg-dark #121212 | card-dark #1A1A1A | creme #F0EAD6
                   slate #9CA3AF

   Blocksy Integration:
   When Blocksy theme is active, JBH_Blocksy_Compat injects CSS variable
   overrides that remap --jbh-* tokens to --theme-palette-color-* with
   safe fallbacks. No changes needed in this file.
   ============================================================ */

/* ── Reset / tokens ─────────────────────────────────────── */
:root {
	--jbh-teal:         #2A9D8F;
	--jbh-teal-dark:    #1F5F5B;
	--jbh-coral:        #D64F42;
	--jbh-coral-hover:  #E76F51;
	--jbh-bg:           #121212;
	--jbh-card:         #1A1A1A;
	--jbh-creme:        #F0EAD6;
	--jbh-slate:        #9CA3AF;
	--jbh-border:       rgba(31, 95, 91, 0.20);
	--jbh-radius:       var(--jbh-card-radius, 4px);
	--jbh-panel-w:      480px;
	--jbh-font-sans:    Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	--jbh-font-serif:   "Playfair Display", Georgia, serif;
	--jbh-font-mono:    "Fira Code", "Fira Mono", Consolas, monospace;
	--jbh-ease-out:     cubic-bezier(0.16, 1, 0.3, 1);
	--jbh-anim-dur:     0.38s;
}

/* ── NOTE: Service card / block-level styles (.jbh-service-section,
   .jbh-service-card, .jbh-card-title, etc.) are defined exclusively
   in frontend.css. Do NOT duplicate here. modal.css handles only the
   slide-over modal panel UI elements below.                     ──── */

/* ── OVERLAY ─────────────────────────────────────────────── */
.jbh-overlay {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: flex-start;
	justify-content: flex-end;
}

.jbh-overlay[hidden] {
	display: none;
}

.jbh-overlay-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.65);
	backdrop-filter: blur(8px) saturate(1.2);
	-webkit-backdrop-filter: blur(8px) saturate(1.2);
	animation: jbhFadeIn 0.3s ease forwards;
}

/* ── PANEL (slide-over) ────────────────────────────────────── */
.jbh-panel {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: var(--jbh-panel-w);
	height: 100dvh;
	height: 100vh;
	background: var(--jbh-card);
	border-left: 1px solid var(--jbh-teal-dark);
	overflow-y: auto;
	overflow-x: hidden;
	overscroll-behavior: contain;
	box-shadow: -8px 0 48px rgba(0, 0, 0, 0.5), -2px 0 8px rgba(0, 0, 0, 0.2);
	animation: jbhSlideIn var(--jbh-anim-dur) var(--jbh-ease-out) forwards;
	scrollbar-width: thin;
	scrollbar-color: var(--jbh-teal-dark) var(--jbh-bg);
}

.jbh-panel::-webkit-scrollbar        { width: 6px; }
.jbh-panel::-webkit-scrollbar-track  { background: var(--jbh-bg); }
.jbh-panel::-webkit-scrollbar-thumb  { background: var(--jbh-teal-dark); border-radius: 3px; }

/* closing state */
.jbh-overlay.is-closing .jbh-panel   { animation: jbhSlideOut var(--jbh-anim-dur) var(--jbh-ease-out) forwards; }
.jbh-overlay.is-closing .jbh-overlay-backdrop { animation: jbhFadeOut 0.25s ease forwards; }

@keyframes jbhSlideIn  { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes jbhSlideOut { from { transform: translateX(0);    } to { transform: translateX(100%); } }
@keyframes jbhFadeIn   { from { opacity: 0; } to { opacity: 1; } }
@keyframes jbhFadeOut  { from { opacity: 1; } to { opacity: 0; } }

/* ── Panel header ─────────────────────────────────────────── */
.jbh-panel-header {
	position: sticky;
	top: 0;
	z-index: 10;
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	padding: 24px 28px;
	background: var(--jbh-card);
	border-bottom: 1px solid var(--jbh-border);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
}

.jbh-panel-header-text {
	flex: 1;
	min-width: 0;
}

.jbh-panel-category {
	display: block;
	font-family: var(--jbh-font-mono);
	font-size: 0.625rem;
	font-weight: 700;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--jbh-teal);
	margin-bottom: 6px;
}

.jbh-panel-title {
	font-family: var(--jbh-font-serif);
	font-size: 1.5rem;
	font-weight: 700;
	color: #fff;
	margin: 0;
	line-height: 1.2;
}

.jbh-close-btn {
	flex-shrink: 0;
	background: transparent;
	border: none;
	cursor: pointer;
	color: var(--jbh-slate);
	padding: 6px;
	border-radius: var(--jbh-radius);
	transition: color 0.2s, background 0.2s, transform 0.15s ease;
	line-height: 0;
}

.jbh-close-btn:hover { color: #fff; background: rgba(255,255,255,0.08); transform: scale(1.05); }
.jbh-close-btn:active { transform: scale(0.95); }
.jbh-close-btn:focus-visible { outline: 2px solid var(--jbh-teal); outline-offset: 2px; box-shadow: 0 0 0 4px rgba(42, 157, 143, 0.15); }

/* ── Success state ────────────────────────────────────────── */
.jbh-success {
	padding: 60px 32px;
	text-align: center;
	display: flex;
	flex-direction: column;
	align-items: center;
	animation: jbhFadeIn 0.4s ease forwards;
}

.jbh-success-icon {
	width: 72px;
	height: 72px;
	background: rgba(42, 157, 143, 0.15);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--jbh-teal);
	margin-bottom: 28px;
}

.jbh-success-icon svg { width: 36px; height: 36px; }

.jbh-success-heading {
	font-family: var(--jbh-font-serif);
	font-size: 1.6rem;
	font-weight: 700;
	color: #fff;
	margin: 0 0 12px 0;
}

.jbh-success-sub {
	font-family: var(--jbh-font-sans);
	font-size: 0.925rem;
	color: var(--jbh-slate);
	margin: 0 0 8px 0;
}

.jbh-success-sub strong { color: var(--jbh-creme); }

.jbh-success-meta {
	font-family: var(--jbh-font-mono);
	font-size: 0.75rem;
	color: var(--jbh-teal);
	margin: 0 0 24px 0;
}

.jbh-success-note {
	font-family: var(--jbh-font-sans);
	font-size: 0.8rem;
	font-weight: 300;
	color: var(--jbh-slate);
	margin: 0 0 40px 0;
}

/* ── Enforce hidden attribute on flex-display elements ───── */
.jbh-form-wrap[hidden],
.jbh-success[hidden] {
	display: none !important;
}

/* ── Form wrap ───────────────────────────────────────────── */
.jbh-form-wrap {
	padding: 32px 28px;
	display: flex;
	flex-direction: column;
	gap: 40px;
}

/* ── Steps ───────────────────────────────────────────────── */
.jbh-step-label {
	font-family: var(--jbh-font-mono);
	font-size: 0.7rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.16em;
	color: var(--jbh-slate);
	margin: 0 0 18px 0;
	display: flex;
	align-items: center;
	gap: 10px;
}

.jbh-step-num {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	border: 1px solid var(--jbh-teal-dark);
	border-radius: 50%;
	font-size: 0.65rem;
	color: var(--jbh-teal);
}

/* ── Tier buttons ─────────────────────────────────────────── */
.jbh-tier-grid {
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 16px;
}

.jbh-tier-btn {
	position: relative;
	flex: 1 1 0;
	min-width: 120px;
	padding: 16px 18px;
	border-radius: var(--jbh-radius);
	border: 1px solid var(--jbh-border);
	background: var(--jbh-bg);
	cursor: pointer;
	text-align: left;
	transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.jbh-tier-btn:hover,
.jbh-tier-btn:focus-visible {
	border-color: rgba(42, 157, 143, 0.5);
}

.jbh-tier-btn[aria-checked="true"],
.jbh-tier-btn.is-active {
	border-color: var(--jbh-teal);
	background: rgba(42, 157, 143, 0.08);
	box-shadow: 0 0 0 2px var(--jbh-teal);
}

.jbh-tier-btn[aria-checked="true"]::after,
.jbh-tier-btn.is-active::after {
	content: '\2713';
	position: absolute;
	top: 12px;
	right: 14px;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: var(--jbh-teal);
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
}

.jbh-tier-btn:focus-visible { outline: 2px solid var(--jbh-teal); outline-offset: 2px; }

.jbh-best-value-badge {
	position: absolute;
	top: -10px;
	left: 16px;
	background: var(--jbh-coral);
	color: #fff;
	font-family: var(--jbh-font-mono);
	font-size: 0.55rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	padding: 3px 10px;
	border-radius: 99px;
}

.jbh-tier-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.jbh-tier-label-text {
	display: block;
	font-family: var(--jbh-font-mono);
	font-size: 0.6rem;
	text-transform: uppercase;
	letter-spacing: 0.16em;
	color: var(--jbh-slate);
	margin-bottom: 4px;
}

.jbh-tier-price {
	display: block;
	font-family: var(--jbh-font-serif);
	font-size: 1.6rem;
	font-weight: 700;
	color: #fff;
	line-height: 1;
}

.jbh-tier-delivery {
	font-family: var(--jbh-font-mono);
	font-size: 0.65rem;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: var(--jbh-teal);
}

/* ── Includes box ─────────────────────────────────────────── */
.jbh-includes-box {
	background: var(--jbh-bg);
	border: 1px solid var(--jbh-border);
	border-radius: var(--jbh-radius);
	padding: 16px 18px;
}

.jbh-includes-heading {
	font-family: var(--jbh-font-mono);
	font-size: 0.6rem;
	text-transform: uppercase;
	letter-spacing: 0.14em;
	color: var(--jbh-slate);
	display: block;
	margin-bottom: 12px;
}

.jbh-includes-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.jbh-includes-list li {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	font-family: var(--jbh-font-sans);
	font-size: 0.85rem;
	color: var(--jbh-creme);
	line-height: 1.4;
}

.jbh-includes-list li::before {
	content: "";
	flex-shrink: 0;
	width: 16px;
	height: 16px;
	margin-top: 1px;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%232A9D8F' viewBox='0 0 24 24'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2.5' d='M5 13l4 4L19 7'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* ── Upgrades ─────────────────────────────────────────────── */
.jbh-upgrades-list {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.jbh-upgrade-item {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 14px 16px;
	border-radius: var(--jbh-radius);
	border: 1px solid var(--jbh-border);
	background: var(--jbh-bg);
	cursor: pointer;
	transition: border-color 0.2s, background 0.2s;
}

.jbh-upgrade-item:has(.jbh-upgrade-check:checked) {
	border-color: var(--jbh-teal);
	background: rgba(42, 157, 143, 0.06);
}

.jbh-upgrade-check {
	flex-shrink: 0;
	margin-top: 2px;
	accent-color: var(--jbh-teal);
	width: 15px;
	height: 15px;
	cursor: pointer;
}

.jbh-upgrade-info {
	flex: 1;
	min-width: 0;
}

.jbh-upgrade-name {
	display: block;
	font-family: var(--jbh-font-sans);
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--jbh-creme);
	margin-bottom: 2px;
}

.jbh-upgrade-sub {
	display: block;
	font-family: var(--jbh-font-sans);
	font-size: 0.75rem;
	color: var(--jbh-slate);
}

.jbh-upgrade-cost {
	flex-shrink: 0;
	font-family: var(--jbh-font-mono);
	font-size: 0.7rem;
	color: var(--jbh-teal);
	white-space: nowrap;
	margin-top: 2px;
}

/* ── Fields ───────────────────────────────────────────────── */
.jbh-fields {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.jbh-field {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.jbh-label {
	font-family: var(--jbh-font-mono);
	font-size: 0.65rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.14em;
	color: var(--jbh-creme);
}

.jbh-required { color: var(--jbh-coral); }

.jbh-textarea,
.jbh-input {
	width: 100%;
	box-sizing: border-box;
	background: var(--jbh-bg);
	border: 1px solid var(--jbh-border);
	border-radius: var(--jbh-radius);
	padding: 12px 14px;
	font-family: var(--jbh-font-sans);
	font-size: 0.875rem;
	color: var(--jbh-creme);
	transition: border-color 0.2s;
	outline: none;
}

.jbh-textarea::placeholder,
.jbh-input::placeholder {
	color: rgba(156, 163, 175, 0.45);
}

.jbh-textarea:focus,
.jbh-input:focus {
	border-color: var(--jbh-teal);
}

.jbh-textarea {
	resize: vertical;
	min-height: 100px;
}

/* ── Tone buttons ─────────────────────────────────────────── */
.jbh-tone-grid {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.jbh-tone-btn {
	padding: 7px 14px;
	border-radius: var(--jbh-radius);
	border: 1px solid var(--jbh-border);
	background: var(--jbh-bg);
	font-family: var(--jbh-font-mono);
	font-size: 0.7rem;
	color: var(--jbh-slate);
	cursor: pointer;
	transition: all 0.18s ease;
}

.jbh-tone-btn:hover { border-color: rgba(42,157,143,0.4); color: var(--jbh-creme); }

.jbh-tone-btn[aria-pressed="true"],
.jbh-tone-btn.is-selected {
	background: var(--jbh-teal);
	border-color: var(--jbh-teal);
	color: #fff;
	font-weight: 700;
	box-shadow: 0 0 0 2px rgba(42, 157, 143, 0.25);
	transform: scale(1.04);
}

.jbh-tone-btn:focus-visible { outline: 2px solid var(--jbh-teal); outline-offset: 2px; }

/* ── Dropzone ─────────────────────────────────────────────── */
.jbh-dropzone {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 32px 20px;
	border: 2px dashed var(--jbh-border);
	border-radius: var(--jbh-radius);
	background: var(--jbh-bg);
	cursor: pointer;
	transition: border-color 0.2s, background 0.2s;
}

.jbh-dropzone:hover,
.jbh-dropzone.is-dragover {
	border-color: rgba(42, 157, 143, 0.5);
	background: rgba(42, 157, 143, 0.04);
}

.jbh-upload-icon {
	width: 36px;
	height: 36px;
	color: rgba(42, 157, 143, 0.45);
}

.jbh-drop-text {
	font-family: var(--jbh-font-sans);
	font-size: 0.85rem;
	color: var(--jbh-slate);
	text-align: center;
}

.jbh-drop-types {
	font-family: var(--jbh-font-mono);
	font-size: 0.6rem;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: rgba(42, 157, 143, 0.5);
}

.jbh-file-hidden {
	display: none;
}

.jbh-file-list {
	list-style: none;
	margin: 10px 0 0 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.jbh-file-list li {
	display: flex;
	align-items: center;
	gap: 8px;
	font-family: var(--jbh-font-mono);
	font-size: 0.7rem;
	color: var(--jbh-teal);
}

.jbh-file-list li::before {
	content: "";
	flex-shrink: 0;
	width: 12px;
	height: 12px;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%232A9D8F' viewBox='0 0 24 24'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2.5' d='M5 13l4 4L19 7'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* ── Disclaimer ───────────────────────────────────────────── */
.jbh-disclaimer-row {
	padding-top: 8px;
	border-top: 1px solid var(--jbh-border);
}

.jbh-disclaimer-label {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	cursor: pointer;
}

.jbh-disclaimer-check {
	flex-shrink: 0;
	margin-top: 2px;
	accent-color: var(--jbh-teal);
	width: 15px;
	height: 15px;
	cursor: pointer;
}

.jbh-disclaimer-text {
	font-family: var(--jbh-font-sans);
	font-size: 0.78rem;
	color: var(--jbh-slate);
	line-height: 1.6;
}

/* ── Order summary & submit ──────────────────────────────── */
.jbh-order-summary {
	background: var(--jbh-bg);
	border: 1px solid var(--jbh-border);
	border-radius: var(--jbh-radius);
	padding: 24px 22px;
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.jbh-order-total-row {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 16px;
}

.jbh-total-label {
	display: block;
	font-family: var(--jbh-font-mono);
	font-size: 0.6rem;
	text-transform: uppercase;
	letter-spacing: 0.14em;
	color: var(--jbh-slate);
	margin-bottom: 4px;
}

.jbh-total-amount {
	font-family: var(--jbh-font-serif);
	font-size: 2.4rem;
	font-weight: 700;
	color: #fff;
	line-height: 1;
}

.jbh-total-delivery {
	font-family: var(--jbh-font-mono);
	font-size: 0.7rem;
	color: var(--jbh-slate);
	text-align: right;
}

.jbh-total-delivery span:last-child {
	color: var(--jbh-teal);
	font-weight: 700;
}

/* Primary buttons (success close, submit) */
.jbh-btn-primary,
.jbh-submit-btn {
	width: 100%;
	padding: 14px 24px;
	border-radius: var(--jbh-radius);
	font-family: var(--jbh-font-serif);
	font-size: 1rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	cursor: pointer;
	transition: background 0.2s, box-shadow 0.2s, opacity 0.2s, transform 0.15s ease;
	border: none;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	position: relative;
	overflow: hidden;
}

.jbh-btn-primary {
	background: var(--jbh-teal-dark);
	color: #fff;
	margin-top: 8px;
}

.jbh-btn-primary:hover { background: var(--jbh-teal); transform: translateY(-1px); }
.jbh-btn-primary:active { transform: scale(0.98); }

.jbh-submit-btn {
	background: var(--jbh-coral);
	color: #fff;
	box-shadow: 0 4px 14px rgba(214, 79, 66, 0.38);
}

.jbh-submit-btn:not([disabled]):hover {
	background: var(--jbh-coral-hover);
	box-shadow: 0 6px 20px rgba(214, 79, 66, 0.48);
	transform: translateY(-1px);
}
.jbh-submit-btn:not([disabled]):active {
	transform: scale(0.98);
	transition-duration: 0.08s;
}

.jbh-submit-btn[disabled] {
	background: var(--jbh-card);
	color: var(--jbh-slate);
	border: 1px solid var(--jbh-border);
	box-shadow: none;
	cursor: not-allowed;
}

.jbh-btn-primary:focus-visible,
.jbh-submit-btn:focus-visible {
	outline: 2px solid var(--jbh-teal);
	outline-offset: 3px;
	box-shadow: 0 0 0 4px rgba(42, 157, 143, 0.20);
}

/* Ripple effect for modal primary/submit buttons */
.jbh-btn-primary::after,
.jbh-submit-btn::after {
	content: '';
	position: absolute;
	top: 50%; left: 50%;
	width: 0; height: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.25);
	transform: translate(-50%, -50%);
	transition: width 0.5s ease, height 0.5s ease, opacity 0.5s ease;
	opacity: 0;
	pointer-events: none;
}
.jbh-btn-primary:active::after,
.jbh-submit-btn:active::after {
	width: 300px; height: 300px;
	opacity: 1;
	transition: width 0s, height 0s, opacity 0s;
}

/* Spinner */
.jbh-submit-spinner {
	width: 16px;
	height: 16px;
	border: 2px solid rgba(255,255,255,0.3);
	border-top-color: #fff;
	border-radius: 50%;
	animation: jbhSpin 0.6s linear infinite;
}

@keyframes jbhSpin { to { transform: rotate(360deg); } }

.jbh-submit-hint {
	font-family: var(--jbh-font-mono);
	font-size: 0.65rem;
	text-align: center;
	color: var(--jbh-slate);
	opacity: 0.6;
	margin: 0;
	transition: opacity 0.2s;
}

.jbh-submit-hint.is-hidden { opacity: 0; }

/* ── NOTE: Block-level styles (store-grid, pricing-plans, portfolio-grid)
   are defined exclusively in frontend.css. Do NOT duplicate here.
   modal.css handles only the slide-over modal panel UI.             ──── */

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 520px) {
	.jbh-panel {
		max-width: 100%;
		border-left: none;
		border-top: 1px solid var(--jbh-teal-dark);
	}
	.jbh-tier-grid {
		flex-direction: column;
	}
	.jbh-tier-btn {
		flex: none;
		width: 100%;
	}
}

/* ================================================================
   MODAL STYLE VARIANTS
   ================================================================
   Activated via data-modal-style attribute on .jbh-overlay.
   Default (no attribute) = side-panel (existing slide-over).
   ================================================================ */

/* ── POPUP (centered dialog) ─────────────────────────────── */
.jbh-overlay[data-modal-style="popup"] {
	align-items: center;
	justify-content: center;
	padding: 24px;
}

.jbh-overlay[data-modal-style="popup"] .jbh-panel {
	height: auto;
	max-height: 90dvh;
	max-height: 90vh;
	max-width: 560px;
	border-left: none;
	border: 1px solid var(--jbh-teal-dark);
	border-radius: 12px;
	box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
	animation: jbhPopupIn var(--jbh-anim-dur) var(--jbh-ease-out) forwards;
}

.jbh-overlay[data-modal-style="popup"].is-closing .jbh-panel {
	animation: jbhPopupOut var(--jbh-anim-dur) var(--jbh-ease-out) forwards;
}

@keyframes jbhPopupIn  {
	from { opacity: 0; transform: scale(0.92) translateY(16px); }
	to   { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes jbhPopupOut {
	from { opacity: 1; transform: scale(1) translateY(0); }
	to   { opacity: 0; transform: scale(0.92) translateY(16px); }
}

/* ── FULLSCREEN ──────────────────────────────────────────── */
.jbh-overlay[data-modal-style="fullscreen"] {
	align-items: stretch;
	justify-content: stretch;
}

.jbh-overlay[data-modal-style="fullscreen"] .jbh-panel {
	max-width: 100%;
	width: 100%;
	height: 100dvh;
	height: 100vh;
	border-left: none;
	border-radius: 0;
	box-shadow: none;
	animation: jbhFadeIn var(--jbh-anim-dur) ease forwards;
}

.jbh-overlay[data-modal-style="fullscreen"].is-closing .jbh-panel {
	animation: jbhFadeOut var(--jbh-anim-dur) ease forwards;
}

.jbh-overlay[data-modal-style="fullscreen"] .jbh-panel-header {
	max-width: 680px;
	margin-left: auto;
	margin-right: auto;
	width: 100%;
}

.jbh-overlay[data-modal-style="fullscreen"] .jbh-form-wrap {
	max-width: 680px;
	margin-left: auto;
	margin-right: auto;
}

.jbh-overlay[data-modal-style="fullscreen"] .jbh-success {
	max-width: 680px;
	margin-left: auto;
	margin-right: auto;
}

/* ── BOTTOM SHEET ────────────────────────────────────────── */
.jbh-overlay[data-modal-style="bottom-sheet"] {
	align-items: flex-end;
	justify-content: center;
}

.jbh-overlay[data-modal-style="bottom-sheet"] .jbh-panel {
	width: 100%;
	max-width: 640px;
	height: auto;
	max-height: 85dvh;
	max-height: 85vh;
	border-left: none;
	border-top: 1px solid var(--jbh-teal-dark);
	border-radius: 16px 16px 0 0;
	box-shadow: 0 -12px 60px rgba(0, 0, 0, 0.4);
	animation: jbhSheetIn var(--jbh-anim-dur) var(--jbh-ease-out) forwards;
}

.jbh-overlay[data-modal-style="bottom-sheet"].is-closing .jbh-panel {
	animation: jbhSheetOut var(--jbh-anim-dur) var(--jbh-ease-out) forwards;
}

.jbh-overlay[data-modal-style="bottom-sheet"] .jbh-panel-header::before {
	content: '';
	display: block;
	width: 36px;
	height: 4px;
	background: var(--jbh-slate);
	border-radius: 2px;
	margin: 0 auto 12px;
	opacity: 0.5;
}

@keyframes jbhSheetIn  {
	from { transform: translateY(100%); }
	to   { transform: translateY(0); }
}
@keyframes jbhSheetOut {
	from { transform: translateY(0); }
	to   { transform: translateY(100%); }
}

/* ── Responsive overrides for modal variants ─────────────── */
@media (max-width: 520px) {
	.jbh-overlay[data-modal-style="popup"] {
		padding: 0;
	}
	.jbh-overlay[data-modal-style="popup"] .jbh-panel {
		max-width: 100%;
		max-height: 100dvh;
		max-height: 100vh;
		border-radius: 0;
		height: 100dvh;
		height: 100vh;
	}
	.jbh-overlay[data-modal-style="bottom-sheet"] .jbh-panel {
		max-width: 100%;
		max-height: 95dvh;
		max-height: 95vh;
	}
}

/* ── Reduced motion ───────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
	.jbh-panel,
	.jbh-overlay-backdrop,
	.jbh-overlay.is-closing .jbh-panel,
	.jbh-overlay.is-closing .jbh-overlay-backdrop {
		animation: none;
	}

	.jbh-submit-spinner {
		animation: none;
		border-top-color: rgba(255,255,255,0.6);
	}

	.jbh-btn-primary::after,
	.jbh-submit-btn::after {
		display: none;
	}

	.jbh-close-btn:hover,
	.jbh-close-btn:active,
	.jbh-btn-primary:hover,
	.jbh-btn-primary:active,
	.jbh-submit-btn:hover,
	.jbh-submit-btn:active {
		transform: none;
	}
}
