/**
 * Blue Frame Films: packages.css
 *
 * Purpose:  The condensed Packages page: segmented group tabs, compact accordion cards
 *           (hover preview on desktop only), the à la carte checklist with quantity
 *           steppers, group notes and the collapsed Project terms.
 *           The "Your selection" bar is in selection.css.
 * Used by:  template-parts/packages/packages.php, a-la-carte.php,
 *           template-parts/components/package-card.php.
 * To edit:  Card width: .pk-list (minmax). Tab look: .pk-tab. Open/selected states:
 *           .pk-card.open / .pk-card.selected (classes set by assets/js/packages.js).
 */

.pk-how {
	color: var(--muted);
	font-size: .92rem;
	margin: -30px 0 34px;
}

/* ==========================================================================
   Group tabs (segmented control)
   ========================================================================== */
.pk-tabs {
	display: inline-flex;
	gap: 4px;
	padding: 5px;
	border-radius: 14px;
	background: var(--panel);
	border: 1px solid var(--line);
	max-width: 100%;
	overflow-x: auto;
	scrollbar-width: none;
	margin-bottom: 40px;
}

.pk-tab {
	font: inherit;
	font-size: .88rem;
	font-weight: 600;
	color: var(--muted);
	background: transparent;
	border: 0;
	border-radius: 10px;
	padding: .65rem 1.05rem;
	white-space: nowrap;
	cursor: pointer;
	/* Only the hover colour fades. The selected background switches instantly, so two tabs
	   never look selected at once (a fade showed old + new tab half-lit, v2.4.0). */
	transition: color .2s ease;
}

.pk-tab:hover {
	color: #fff;
}

.pk-tab[aria-selected="true"] {
	background: var(--elec);
	color: #fff;
	box-shadow: 0 8px 22px -10px var(--glow);
}

/* ==========================================================================
   Panels
   ========================================================================== */
.pk-panel:focus-visible {
	outline: 2px solid var(--elec2);
	outline-offset: 8px;
	border-radius: 6px;
}

.pk-panel-h {
	font-size: 1.15rem;
	margin: 0 0 18px;
	letter-spacing: -.01em;
}

.pk-panel-h .sub {
	margin-left: 8px;
}

/* Sub-headings inside a tab (Design & Branding: Logo & branding, Packaging & labels, ...). */
.pk-sub {
	font-size: .74rem;
	font-weight: 800;
	letter-spacing: .16em;
	text-transform: uppercase;
	color: var(--muted);
	margin: 0 0 12px;
}

.pk-list + .pk-sub {
	margin-top: 30px;
}

.pnote {
	color: var(--muted);
	font-size: .84rem;
	margin-top: 18px;
	max-width: 820px;
}

/* ==========================================================================
   Compact accordion cards
   ========================================================================== */
.pk-list {
	list-style: none;
	display: grid;
	grid-template-columns: repeat(auto-fill,minmax(250px,1fr));
	gap: 14px;
	align-items: start;
}

.pk-list-one {
	grid-template-columns: minmax(0,420px);
}

.pk-card {
	position: relative;
	background: var(--panel);
	border: 1px solid var(--line);
	border-radius: var(--r);
	transition: border-color .2s ease,box-shadow .2s ease,transform .2s ease;
	scroll-margin-top: 110px;
}

.pk-card.featured {
	border-color: rgba(30,123,255,.55);
}

.pk-card.open {
	border-color: rgba(0,194,255,.55);
	box-shadow: 0 18px 44px -24px var(--glow);
}

.pk-card.selected {
	border-color: var(--elec2);
	background: linear-gradient(180deg,rgba(0,194,255,.08),transparent 60%),var(--panel);
}

.pk-h {
	margin: 0;
	font-size: inherit;
	letter-spacing: normal;
	line-height: inherit;
}

.pk-toggle {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 4px;
	width: 100%;
	padding: 20px 20px 16px;
	border: 0;
	border-radius: var(--r);
	background: transparent;
	color: var(--text);
	font: inherit;
	text-align: left;
	cursor: pointer;
}

.pk-badge {
	display: inline-block;
	margin-bottom: 2px;
	padding: 2px 9px;
	border: 1px solid rgba(0,194,255,.5);
	border-radius: 20px;
	background: rgba(0,194,255,.08);
	color: var(--elec2);
	font-size: .68rem;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
}

.pk-name {
	font-size: 1.02rem;
	font-weight: 700;
}

/* Room for the "Added" badge */
.pk-card.selected .pk-name {
	padding-right: 72px;
}

.pk-price {
	font-size: 1.55rem;
	font-weight: 800;
	letter-spacing: -.02em;
	line-height: 1.2;
}

.pk-price small {
	font-size: .78rem;
	font-weight: 600;
	color: var(--muted);
	margin: 0 2px;
}

.pk-why {
	display: block;
	color: #b9c6e4;
	font-size: .88rem;
	font-weight: 400;
	line-height: 1.5;
}

/* The 'why' line is shown once, on the collapsed card; open cards show the Includes list */
.pk-card.open .pk-why {
	display: none;
}

/* 6:1 header strip at the top of each package card (assets/images/packages/<slug>.webp) */
.pk-strip {
	position: relative;
	aspect-ratio: 6 / 1;
	border-radius: var(--r) var(--r) 0 0;
	overflow: hidden;
	border-bottom: 1px solid var(--line);
	cursor: pointer;
}

.pk-strip img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.pk-strip::after {
	content: "";
	position: absolute;
	z-index: 1;
	inset: 0;
	background: linear-gradient(180deg,rgba(5,8,20,.05) 0%,rgba(5,8,20,.25) 60%,rgba(5,8,20,.7) 100%);
	pointer-events: none;
}

.pk-strip + .pk-h .pk-toggle {
	border-radius: 0 0 var(--r) var(--r);
	padding-top: 16px;
}

.pk-more {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	margin-top: 8px;
	color: var(--elec2);
	font-size: .76rem;
	font-weight: 700;
	letter-spacing: .1em;
	text-transform: uppercase;
}

.pk-more .bf-icon {
	transition: transform .2s ease;
}

.pk-card.open .pk-more .bf-icon {
	transform: rotate(180deg);
}

/* Hover: lift only (the 'why' line is already on the card; no feature preview) */
@media (hover:hover) and (pointer:fine) {
	.pk-card:not(.open):hover {
		border-color: rgba(0,194,255,.45);
		transform: translateY(-2px);
	}
}

.pk-incl li::before {
	content: "";
	position: absolute;
	left: 1px;
	width: 5px;
	height: 5px;
	border-radius: 50%;
	background: var(--elec2);
}

/* "Added" badge */
.pk-added {
	position: absolute;
	top: 18px;
	right: 16px;
	display: none;
	align-items: center;
	gap: 4px;
	font-size: .66rem;
	font-weight: 800;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: #001a26;
	background: var(--elec2);
	padding: 3px 8px;
	border-radius: 20px;
	pointer-events: none;
}

.pk-card.selected .pk-added {
	display: inline-flex;
}

/* Expanded details */
.pk-details {
	padding: 4px 20px 20px;
}

.pk-incl-h {
	font-size: .7rem;
	font-weight: 700;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--muted);
	padding-top: 14px;
	border-top: 1px solid var(--line);
	margin-bottom: 8px;
}

.pk-incl {
	list-style: none;
	margin-bottom: 18px;
}

.pk-incl li {
	position: relative;
	font-size: .9rem;
	line-height: 1.45;
	padding: 3px 0 3px 16px;
	color: #d8e2f8;
}

.pk-incl li::before {
	top: .78em;
}

.pk-add {
	width: 100%;
	padding: .75rem 1rem;
}

/* Quantity stepper on a package card (Compliance Label, per product). Reuses .alc-qty. */
.pk-card .pk-qty {
	display: flex;
	gap: 6px;
	margin: 0 0 12px;
}

.pk-card .pk-qty button {
	width: 36px;
	height: 36px;
}

.pk-card .pk-qty input {
	height: 36px;
}

.pk-card .pk-qty .qty-unit {
	margin-left: 4px;
	color: var(--muted);
	font-size: .84rem;
}

.pk-add .pk-add-on,
.pk-add[aria-pressed="true"] .pk-add-off {
	display: none;
}

.pk-add[aria-pressed="true"] .pk-add-on {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.pk-add-off {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.pk-add[aria-pressed="true"] {
	background: rgba(0,194,255,.14);
	border-color: var(--elec2);
	color: #fff;
}

/* ==========================================================================
   À la carte checklist
   ========================================================================== */
.alc-list {
	list-style: none;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0 36px;
}

.alc-row {
	display: grid;
	grid-template-columns: 22px 1fr auto auto;
	align-items: center;
	gap: 6px 12px;
	padding: 11px 10px;
	margin: 0 -10px;
	border-bottom: 1px solid var(--line);
	border-radius: 8px;
	transition: background .15s ease;
}

.alc-row:hover,
.alc-row:focus-within,
.alc-row.why-open {
	background: rgba(30,123,255,.06);
}

/* One-sentence 'why' line: opens on hover (desktop), tap (.why-open, set by packages.js) or
   keyboard focus inside the row. Full row width, under the name/price line. */
.alc-why {
	grid-column: 2 / -1;
	grid-row: 2;
	max-height: 0;
	opacity: 0;
	overflow: hidden;
	color: #b9c6e4;
	font-size: .82rem;
	line-height: 1.45;
	transition: max-height .25s ease,opacity .2s ease;
}

.alc-row:focus-within .alc-why,
.alc-row.why-open .alc-why {
	max-height: 4.5em;
	opacity: 1;
}

@media (hover:hover) and (pointer:fine) {
	.alc-row:hover .alc-why {
		max-height: 4.5em;
		opacity: 1;
	}
}

.alc-row.selected {
	background: rgba(0,194,255,.07);
}

.alc-check {
	width: 18px;
	height: 18px;
	accent-color: var(--elec2);
	cursor: pointer;
}

.alc-name {
	font-size: .92rem;
	cursor: pointer;
}

.alc-price {
	font-weight: 700;
	font-size: .92rem;
	white-space: nowrap;
	grid-column: 4;
	grid-row: 1;
}

.alc-qty {
	grid-column: 3;
	grid-row: 1;
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

.alc-qty button {
	display: grid;
	place-items: center;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	border: 1px solid rgba(0,194,255,.45);
	background: transparent;
	color: var(--text);
	cursor: pointer;
}

.alc-qty input {
	width: 44px;
	height: 30px;
	text-align: center;
	font: inherit;
	font-size: .9rem;
	font-weight: 700;
	color: var(--text);
	background: var(--bg2);
	border: 1px solid var(--line);
	border-radius: 8px;
	-moz-appearance: textfield;
	appearance: textfield;
}

.alc-qty input::-webkit-inner-spin-button,
.alc-qty input::-webkit-outer-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.alc-qty :disabled {
	opacity: .35;
	cursor: default;
}

.qty-unit {
	font-size: .75rem;
	color: var(--muted);
	margin-left: 2px;
}

/* ==========================================================================
   Project terms (collapsed disclosure)
   ========================================================================== */
.pk-terms {
	margin-top: 56px;
	border: 1px solid var(--line);
	border-radius: var(--r);
	background: var(--bg2);
	max-width: 820px;
}

.pk-terms summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 16px 20px;
	font-weight: 700;
	cursor: pointer;
	list-style: none;
	border-radius: var(--r);
}

.pk-terms summary::-webkit-details-marker {
	display: none;
}

.pk-terms summary .bf-icon {
	color: var(--elec2);
	transition: transform .2s ease;
}

.pk-terms[open] summary .bf-icon {
	transform: rotate(180deg);
}

.pk-terms summary:focus-visible {
	outline: 2px solid var(--elec2);
	outline-offset: 2px;
}

.pk-terms ul {
	padding: 0 20px 18px 40px;
	color: var(--muted);
	font-size: .9rem;
}

.pk-terms li {
	padding: 3px 0;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width:900px) {
	.alc-list {
		grid-template-columns: 1fr;
	}
}
@media (max-width:760px) {
	.pk-how {
		margin-top: -18px;
	}

	.pk-tabs {
		display: flex;
		margin-left: -24px;
		margin-right: -24px;
		border-radius: 0;
		border-left: 0;
		border-right: 0;
		padding: 5px 24px;
	}

	.pk-list,
	.pk-list-one {
		grid-template-columns: 1fr;
	}

	.alc-row {
		grid-template-columns: 22px 1fr auto;
	}

	.alc-price {
		grid-column: 3;
	}

	.alc-qty {
		grid-column: 2 / 4;
		grid-row: 2;
	}

	.alc-why {
		grid-row: 3;
	}
}

/* v2.6.0: Websites tab card pointing larger businesses to Webonomics. */
.pk-referral { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin: 28px 0 8px; padding: 18px 22px; border: 1px solid rgba(255, 255, 255, .14); border-left: 3px solid #1f9d55; border-radius: 10px; background: rgba(255, 255, 255, .03); }
.pk-referral p { margin: 0; flex: 1 1 420px; color: var(--muted, #aab3c5); }
.pk-referral strong { color: var(--text, #fff); }
.pk-referral-link { white-space: nowrap; }
