/**
 * Blue Frame Films: selection.css
 *
 * Purpose:  "Your selection" UI:
 *           - the fixed bar + drawer on the Packages page (template-parts/packages/selection-bar.php):
 *             a floating panel at the bottom on desktop, a bottom sheet on phones;
 *           - the "Selected packages" block on the Contact form
 *             (template-parts/contact/selection-summary.php).
 * Used by:  Packages and Contact pages (inc/setup.php, blueframe_page_assets()).
 * To edit:  Bar width: .sel-bar. Space kept free under the page while the bar shows:
 *           body.bf-has-selection (the height is measured by assets/js/packages.js).
 */

/* ==========================================================================
   Bar (Packages page)
   ========================================================================== */
body.bf-has-selection {
	padding-bottom: var(--bf-bar-h,120px);
}

.sel-bar {
	position: fixed;
	z-index: 40;
	left: 50%;
	bottom: 14px;
	transform: translateX(-50%);
	width: min(1132px,calc(100% - 28px));
	background: rgba(12,18,33,.97);
	backdrop-filter: blur(12px);
	border: 1px solid rgba(0,194,255,.45);
	border-radius: 16px;
	box-shadow: 0 24px 60px -18px rgba(0,0,0,.8),0 0 0 1px rgba(30,123,255,.15) inset;
}

.sel-bar[hidden] {
	display: none;
}

.sel-main {
	display: flex;
	align-items: center;
	gap: 18px;
	padding: 12px 14px 12px 12px;
}

.sel-toggle {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 12px;
	border: 1px solid rgba(30,123,255,.35);
	border-radius: 10px;
	background: rgba(30,123,255,.12);
	color: var(--text);
	font: inherit;
	font-size: .9rem;
	font-weight: 700;
	cursor: pointer;
	white-space: nowrap;
}

.sel-toggle .bf-icon-bag {
	color: var(--elec2);
}

.sel-toggle .bf-icon-chevron {
	transform: rotate(180deg);
	transition: transform .2s ease;
}

.sel-bar.is-open .sel-toggle .bf-icon-chevron {
	transform: none;
}

.sel-toggle-txt {
	color: var(--muted);
	font-weight: 600;
	font-size: .8rem;
}

.sel-hide,
.sel-bar.is-open .sel-show {
	display: none;
}

.sel-bar.is-open .sel-hide {
	display: inline;
}

.sel-total {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	line-height: 1.3;
}

.sel-total-label {
	font-size: .72rem;
	color: var(--muted);
}

.sel-total-val {
	font-size: 1.1rem;
	font-weight: 800;
	color: #fff;
}

.sel-cta {
	display: flex;
	gap: 8px;
	flex: none;
}

.sel-cta .btn {
	padding: .7rem 1.1rem;
	font-size: .88rem;
}

/* Drawer (opens above the bar) */
.sel-drawer {
	padding: 16px 16px 6px;
	border-bottom: 1px solid var(--line);
	max-height: min(52vh,420px);
	overflow-y: auto;
}

.sel-drawer-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 6px;
}

.sel-drawer-head h2 {
	font-size: 1rem;
	margin: 0;
	letter-spacing: 0;
}

.sel-clear {
	font: inherit;
	font-size: .8rem;
	color: var(--muted);
	background: none;
	border: 0;
	text-decoration: underline;
	cursor: pointer;
	padding: 6px;
}

.sel-clear:hover {
	color: #fff;
}

/* ==========================================================================
   Item list (bar drawer and contact summary)
   ========================================================================== */
.sel-list {
	list-style: none;
}

.sel-list li {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 8px 0;
	border-bottom: 1px solid var(--line);
	font-size: .9rem;
}

.sel-note {
	display: block;
	margin-top: 2px;
	color: var(--elec2);
	font-size: .78rem;
	font-weight: 600;
}

.sel-list li:last-child {
	border-bottom: 0;
}

.sel-remove {
	display: grid;
	place-items: center;
	flex: none;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	border: 1px solid var(--line);
	background: transparent;
	color: var(--muted);
	cursor: pointer;
}

.sel-remove:hover,
.sel-remove:focus-visible {
	color: #fff;
	border-color: rgba(255,122,138,.6);
	background: rgba(255,122,138,.1);
}

/* ==========================================================================
   "Selected packages" block (Contact form)
   ========================================================================== */
.sel-summary {
	border: 1px solid rgba(0,194,255,.4);
	background: linear-gradient(180deg,rgba(0,194,255,.07),transparent 80%),#070b15;
	border-radius: 12px;
	padding: 16px 18px 14px;
	margin-bottom: 18px;
}

.sel-summary[hidden] {
	display: none;
}

.sel-summary-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 4px;
}

.sel-summary-head h2 {
	font-size: .95rem;
	margin: 0;
	letter-spacing: 0;
}

.sel-change {
	font-size: .82rem;
	font-weight: 700;
	color: var(--elec2);
}

.sel-summary .sel-total {
	display: block;
	margin-top: 8px;
	padding-top: 10px;
	border-top: 1px solid var(--line);
	font-size: .8rem;
	color: var(--muted);
}

.sel-summary .sel-total-val {
	display: block;
	font-size: 1.05rem;
	margin-top: 2px;
}

/* ==========================================================================
   Responsive: bottom sheet on phones
   ========================================================================== */
@media (max-width:760px) {
	.sel-bar {
		left: 0;
		bottom: 0;
		transform: none;
		width: 100%;
		border-radius: 16px 16px 0 0;
		border-left: 0;
		border-right: 0;
		border-bottom: 0;
	}

	.sel-main {
		flex-wrap: wrap;
		gap: 10px 12px;
		padding: 10px 14px calc(12px + env(safe-area-inset-bottom,0px));
	}

	.sel-total {
		flex: 1 1 0;
	}

	.sel-total-label {
		font-size: .66rem;
	}

	.sel-cta {
		flex: 1 1 100%;
	}

	.sel-cta .btn {
		flex: 1;
		padding: .75rem .6rem;
		min-height: 44px;
	}
}
