/**
 * gbb-app.css
 * Gift Box Builder — front-end styles.
 *
 * Layout: a two-panel hero on top (LEFT = marketing image / image placeholder,
 * RIGHT = live "box fills up" preview + progress/price/add-to-cart), then the
 * selectable product grid in a full-width row below.
 *
 * All rules are scoped under .gbb-wrap (plus a couple of cart-page helpers) with
 * prefixed class names so nothing clashes with the active theme. Colours, fonts
 * and sizes come from CSS variables the plugin sets from the admin settings
 * (fallbacks below); --gbb-ink is the dark panel colour used by the hero.
 */

.gbb-wrap {
	--gbb-primary: #e63946;
	--gbb-primary-dark: #cf2e3a;
	--gbb-primary-soft: #f7d9dc;
	--gbb-cream: #eae3d5;
	--gbb-card: #ffffff;
	--gbb-ink: #181716;
	--gbb-ink-2: #242220;
	--gbb-text: #1f1d1b;
	--gbb-muted: #726c66;
	--gbb-radius: 16px;
	--gbb-radius-lg: 26px;
	--gbb-heading-font: "Fraunces", Georgia, serif;
	--gbb-body-font: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
	--gbb-heading-size: clamp(24px, 3.1vw, 33px);
	--gbb-name-size: 12.5px;

	/* Full-bleed: break out of the theme/Elementor container so the builder
	   spans the full browser width (edge to edge). The small inline padding
	   just keeps cards off the very edge on phones — set it to 0 for true
	   edge contact. If an ancestor clips it, make the Elementor section Full Width. */
	width: 100vw;
	max-width: 100vw;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
	padding-inline: clamp(12px, 2vw, 20px);
	padding-block: 0;
	font-family: var(--gbb-body-font);
	color: var(--gbb-text);
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
}

.gbb-wrap *,
.gbb-wrap *::before,
.gbb-wrap *::after {
	box-sizing: border-box;
}

.gbb-wrap button {
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	line-height: normal;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}

.gbb-wrap img {
	max-width: 100%;
	display: block;
}

/* Section heading now sits on the page background, above the two panels. */
.gbb-wrap .gbb-hero__title {
	margin: 0 auto clamp(18px, 2.6vw, 30px);
	max-width: 24ch;
	text-align: center;
	color: var(--gbb-text);
	font-family: var(--gbb-heading-font);
	font-weight: 600;
	font-size: var(--gbb-heading-size);
	line-height: 1.12;
	letter-spacing: -0.01em;
}

/* ----------------------------------------------------------- HERO (2 panels) */

.gbb-hero {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: clamp(16px, 2vw, 24px);
	align-items: stretch;
}

/* Shared dark panel look for both hero cells. */
.gbb-media,
.gbb-stage {
	position: relative;
	overflow: hidden;
	min-height: clamp(300px, 34vw, 440px);
	border-radius: var(--gbb-radius-lg);
	background: var(--gbb-ink);
	background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0) 34%);
	color: #fff;
}

/* LEFT : marketing image / image placeholder */
.gbb-media {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 14px;
	padding: 24px;
}

.gbb-media__img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
}

.gbb-media__ph {
	display: flex;
	align-items: center;
	justify-content: center;
	width: min(72%, 320px);
	aspect-ratio: 4 / 3;
	border: 2px dashed rgba(255, 255, 255, 0.26);
	border-radius: var(--gbb-radius);
	color: rgba(255, 255, 255, 0.6);
}

.gbb-media__ph-icon {
	width: 68px;
	height: 68px;
}

.gbb-media__hint {
	margin: 0;
	max-width: 34ch;
	text-align: center;
	font-size: 12.5px;
	line-height: 1.4;
	color: rgba(255, 255, 255, 0.64);
}

/* RIGHT : live box preview + controls */
.gbb-stage {
	display: flex;
	flex-direction: column;
	gap: 16px;
	padding: clamp(20px, 2.4vw, 30px);
}

.gbb-hero__box {
	flex: 1 1 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 6px 0;
	min-height: 200px;
	position: relative;
}

.gbb-hero__frame {
	position: relative;
	width: min(94%, 460px);
	margin: 0 auto;
}

.gbb-hero__img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 12px;
	filter: drop-shadow(0 18px 26px rgba(0, 0, 0, 0.32));
	transition: opacity 0.3s ease, transform 0.3s ease;
}

.gbb-hero__img.is-swapping {
	opacity: 0;
	transform: scale(0.985);
}

.gbb-hero__placeholder {
	padding: 44px 0;
	width: 100%;
	text-align: center;
	font-size: 96px;
	line-height: 1;
	background: rgba(255, 255, 255, 0.1);
	border: 2px dashed rgba(255, 255, 255, 0.32);
	border-radius: var(--gbb-radius);
}

/* Product photos placed inside the box interior as it fills. */
.gbb-hero__items {
	position: absolute;
	left: 2%;
	right: 13%;
	top: 51%;
	display: flex;
	flex-wrap: nowrap;
	align-items: flex-end;
	justify-content: center;
	pointer-events: none;
	width: 91% !important;
}

.gbb-hero__item {
	position: relative;
	width: 22%;
	max-width: 140px;
	aspect-ratio: 1 / 1;
	border-radius: 0;
	overflow: visible;
	background: none;
	box-shadow: none;
	flex: 0 0 22%;
	display: flex;
	align-items: flex-end;
	justify-content: center;
	animation: gbb-item-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
	animation-delay: calc(var(--i, 0) * 0.05s);
}

.gbb-hero__item img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	object-position: center;
	display: block;
	filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.35));
}

@keyframes gbb-item-in {
	0% {
		transform: translateY(10px) scale(0.6);
		opacity: 0;
	}

	100% {
		transform: translateY(0) scale(1);
		opacity: 1;
	}
}

/* Controls block inside the right panel. */
.gbb-hero__panel {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

/* Progress bar */

.gbb-progress {
	height: 6px;
	border-radius: 99px;
	background: rgba(255, 255, 255, 0.22);
	overflow: hidden;
}

.gbb-progress > span {
	display: block;
	height: 100%;
	width: 0;
	border-radius: 99px;
	background: #fff;
	transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Status + price + CTA */

.gbb-hero__foot {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.gbb-status {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
}

.gbb-status__count {
	font-weight: 600;
	font-size: 15px;
	letter-spacing: 0.3px;
	color: #fff;
}

.gbb-price {
	font-size: 23px;
	font-weight: 700;
	color: #fff;
}

.gbb-price .amount,
.gbb-price bdi {
	font-weight: 700;
}

.gbb-price del {
	opacity: 0.65;
	font-weight: 500;
	font-size: 15px;
	margin-right: 6px;
}

.gbb-price ins {
	text-decoration: none;
}

.gbb-status__hint {
	min-height: 1em;
	font-size: 13px;
	opacity: 0.92;
	color: #fff;
}

.gbb-status__hint.is-ready {
	font-weight: 600;
	opacity: 1;
}

/* Add-to-cart */

.gbb-wrap .gbb-add {
	position: relative;
	display: block;
	width: 100%;
	padding: 15px 24px;
	text-align: center;
	border-radius: 99px;
	background: #fff;
	color: var(--gbb-primary-dark, #cf2e3a);
	font-weight: 700;
	font-size: 15px;
	letter-spacing: 0.02em;
	overflow: hidden;
	box-shadow: none;
	transition:
		transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1),
		background 0.25s ease,
		color 0.25s ease,
		letter-spacing 0.25s ease;
	will-change: transform;
}

.gbb-wrap .gbb-add::before {
	content: "";
	position: absolute;
	top: 0;
	left: -150%;
	width: 65%;
	height: 100%;
	background: linear-gradient(
		120deg,
		transparent,
		rgba(230, 57, 70, 0.16),
		transparent
	);
	transform: skewX(-18deg);
	transition: left 0.6s ease;
	pointer-events: none;
}

.gbb-wrap .gbb-add:hover:not(:disabled)::before {
	left: 150%;
}

.gbb-wrap .gbb-add:hover:not(:disabled) {
	transform: translateY(-2px) scale(1.015);
	letter-spacing: 0.045em;
	color: var(--gbb-primary, #e63946);
}

.gbb-wrap .gbb-add:active:not(:disabled) {
	transform: translateY(0) scale(0.975);
	transition-duration: 0.08s;
}

.gbb-wrap .gbb-add:focus-visible {
	outline: 3px solid rgba(255, 255, 255, 0.75);
	outline-offset: 2px;
}

.gbb-wrap .gbb-add[hidden] {
	display: none;
}

.gbb-wrap .gbb-add.is-revealed {
	animation: gbb-reveal 0.35s ease;
}

.gbb-wrap .gbb-add:disabled {
	background: rgba(255, 255, 255, 0.32);
	color: rgba(255, 255, 255, 0.85);
	cursor: not-allowed;
}

.gbb-wrap .gbb-add.is-loading {
	opacity: 0.9;
	cursor: progress;
}

.gbb-notice {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 14px;
	border-radius: 14px;
	background: #fff;
	color: var(--gbb-primary-dark);
	font-size: 14px;
	font-weight: 600;
	box-shadow: 0 10px 22px rgba(0, 0, 0, 0.28);
	animation: gbb-pop 0.3s ease;
}

.gbb-notice[hidden] {
	display: none;
}

.gbb-notice.is-error {
	color: #8a1c25;
}

.gbb-notice a {
	color: var(--gbb-primary-dark);
	text-decoration: underline;
	white-space: nowrap;
}

/* ---------------------------------------------- PRODUCTS (full-width, below) */

.gbb-panel {
	margin-top: clamp(26px, 3vw, 40px);
	display: flex;
	flex-direction: column;
	gap: 18px;
}

.gbb-panel__head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
}

.gbb-panel__title {
	margin: 0;
	max-width: 60ch;
	font-size: 15px;
	line-height: 1.55;
	color: var(--gbb-muted);
}

.gbb-nav {
	display: flex;
	gap: 10px;
	flex: 0 0 auto;
}

.gbb-wrap .gbb-nav__btn {
	width: 40px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: var(--gbb-primary-soft, #f7d9dc);
	color: var(--gbb-primary-dark, #cf2e3a);
	font-size: 20px;
	line-height: 1;
	transition:
		background 0.2s ease,
		color 0.2s ease,
		transform 0.2s ease,
		opacity 0.2s ease;
}

.gbb-nav__btn:hover:not(:disabled) {
	background: var(--gbb-primary);
	color: #fff;
	transform: translateY(-1px);
}

.gbb-nav__btn:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

/* Product grid — fills the row and wraps down responsively. */
.gbb-products {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: clamp(12px, 1.4vw, 18px);
}

.gbb-product {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 12px;
	border-radius: var(--gbb-radius-lg);
	background: var(--gbb-card);
	border: 1.5px solid transparent;
	box-shadow: 0 4px 14px rgba(20, 20, 20, 0.05);
	transition:
		transform 0.2s ease,
		box-shadow 0.2s ease,
		border-color 0.2s ease,
		opacity 0.2s ease;
}

.gbb-product.is-hidden {
	display: none;
}

.gbb-product:hover {
	transform: translateY(-3px);
	box-shadow: 0 12px 26px rgba(20, 20, 20, 0.1);
}

.gbb-product.is-selected {
	border-color: var(--gbb-primary);
	box-shadow: 0 8px 22px rgba(0, 0, 0, 0.12);
}

.gbb-product.is-disabled {
	opacity: 0.5;
}

.gbb-product.is-disabled:hover {
	transform: none;
	box-shadow: 0 4px 14px rgba(20, 20, 20, 0.05);
}

.gbb-product.is-next:not(.is-selected) {
	border-color: var(--gbb-primary);
	box-shadow:
		0 0 0 3px var(--gbb-primary-soft),
		0 8px 20px rgba(20, 20, 20, 0.08);
	animation: gbb-nextpulse 1.8s ease-in-out infinite;
}

.gbb-product.is-next:not(.is-selected) .gbb-product__btn {
	animation: gbb-btnpulse 1.8s ease-in-out infinite;
}

/* Sequence guidance */

.gbb-seqmsg {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	align-self: flex-start;
	max-width: 100%;
	margin: -4px 0 2px;
	padding: 9px 15px;
	border-radius: 99px;
	background: var(--gbb-primary-soft, #f7d9dc);
	color: var(--gbb-primary-dark, #cf2e3a);
	font-size: 13.5px;
	font-weight: 600;
	line-height: 1.3;
}

.gbb-seqmsg::before {
	content: "\2192";
	font-weight: 700;
}

.gbb-seqmsg[hidden] {
	display: none;
}

.gbb-seqmsg.is-in {
	animation: gbb-pop 0.28s ease;
}

.gbb-product__media {
	position: relative;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	border-radius: 16px;
	background: var(--gbb-cream);
	background-image: linear-gradient(
		180deg,
		color-mix(in srgb, var(--gbb-cream) 92%, #fff),
		color-mix(in srgb, var(--gbb-cream) 82%, #000)
	);
}

.gbb-wrap .gbb-product__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	max-width: none;
	mix-blend-mode: normal;
}

.gbb-product__check {
	position: absolute;
	top: 10px;
	left: 10px;
	width: 26px;
	height: 26px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: var(--gbb-primary);
	color: #fff;
	font-size: 14px;
	line-height: 1;
	transform: scale(0);
	transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.gbb-product.is-selected .gbb-product__check {
	transform: scale(1);
}

.gbb-product__foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 0 4px 4px;
}

/* Selected cards reveal a −/count/+ stepper. On narrow cards that was
   cramping the name onto two lines, so when a card is selected we stack the
   name over a full-width stepper row — clean and responsive at any width. */
.gbb-product.is-selected .gbb-product__foot {
	flex-direction: column;
	align-items: stretch;
	gap: 10px;
}

.gbb-product.is-selected .gbb-product__name {
	text-align: left;
}

.gbb-product.is-selected .gbb-product__actions {
	width: 100%;
	justify-content: center;
	gap: 16px;
	padding: 5px;
	border-radius: 99px;
	background: var(--gbb-primary-soft, #f7d9dc);
}

.gbb-product__name {
	font-size: var(--gbb-name-size);
	font-weight: 600;
	letter-spacing: 0;
	text-transform: none;
	line-height: 1.25;
	color: var(--gbb-text);
}

/* ================================================================
   PLUS BUTTON
   ================================================================ */

.gbb-wrap .gbb-product__btn {
	position: relative;
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: var(--gbb-primary, #e63946);
	color: #fff;
	transition:
		transform 0.2s ease,
		background 0.2s ease;
}

.gbb-product__btn:hover:not(:disabled) {
	transform: scale(1.08);
	background: var(--gbb-primary-dark, #cf2e3a);
}

.gbb-product__btn:active:not(:disabled) {
	transform: scale(0.92);
}

.gbb-product__btn:disabled {
	cursor: not-allowed;
	opacity: 0.4;
}

/* ================================================================
   PRODUCT ACTIONS  ->  [ - ]  2  [ + ]
   Both buttons are the same round primary control.
   ================================================================ */

.gbb-product__actions {
	display: flex;
	align-items: center;
	gap: 8px;
	flex: 0 0 auto;
}

.gbb-product__qty {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.gbb-product__qty[hidden] {
	display: none;
}

.gbb-wrap .gbb-product__minus {
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: var(--gbb-primary, #e63946);
	color: #fff;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 20px;
	font-weight: 700;
	line-height: 1;
	transition:
		transform 0.2s ease,
		background 0.2s ease;
}

.gbb-wrap .gbb-product__minus:hover {
	background: var(--gbb-primary-dark, #cf2e3a);
	color: #fff;
	transform: scale(1.08);
}

.gbb-wrap .gbb-product__minus:active {
	transform: scale(0.92);
}

.gbb-product__count {
	min-width: 14px;
	text-align: center;
	font-size: 13px;
	font-weight: 700;
	color: var(--gbb-text);
}

.gbb-product__icon {
	display: block;
	width: 16px;
	height: 16px;
	pointer-events: none;
}

.gbb-product__bar {
	fill: #fff;
}

/* Fallbacks */

.gbb-empty,
.gbb-admin-hint {
	padding: 24px;
	border-radius: var(--gbb-radius);
	background: #fff;
	color: var(--gbb-muted);
	text-align: center;
	border: 1px dashed #e0d9cd;
}

/* ---------------------------------------------------------------- animations */

@keyframes gbb-pop {
	0% {
		transform: scale(0.9);
		opacity: 0.4;
	}

	100% {
		transform: scale(1);
		opacity: 1;
	}
}

@keyframes gbb-reveal {
	0% {
		transform: translateY(8px);
		opacity: 0;
	}

	100% {
		transform: translateY(0);
		opacity: 1;
	}
}

@keyframes gbb-shake {
	0%,
	100% {
		transform: none;
	}

	20% {
		transform: translateX(-5px);
	}

	40% {
		transform: translateX(5px);
	}

	60% {
		transform: translateX(-4px);
	}

	80% {
		transform: translateX(4px);
	}
}

.gbb-product.is-shake {
	animation: gbb-shake 0.35s ease;
}

@keyframes gbb-nextpulse {
	0%,
	100% {
		box-shadow:
			0 0 0 3px var(--gbb-primary-soft),
			0 8px 20px rgba(20, 20, 20, 0.08);
	}

	50% {
		box-shadow:
			0 0 0 5px var(--gbb-primary-soft),
			0 10px 24px rgba(20, 20, 20, 0.12);
	}
}

@keyframes gbb-btnpulse {
	0%,
	100% {
		transform: scale(1);
	}

	50% {
		transform: scale(1.1);
	}
}

/* ------------------------------------------------------ cart / checkout */

.gbb-cart-list {
	margin: 6px 0 0;
	padding: 0;
	list-style: none;
	font-size: 0.92em;
}

.gbb-cart-list li {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 2px 0;
}

.gbb-cart-check {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: #e63946;
	color: #fff;
	font-size: 10px;
	line-height: 1;
}

/* ---------------------------------------------------------------- responsive */

@media (max-width: 900px) {
	.gbb-hero {
		grid-template-columns: 1fr;
	}

	.gbb-media,
	.gbb-stage {
		min-height: clamp(240px, 52vw, 360px);
	}

	.gbb-hero__frame {
		width: min(72%, 420px);
	}
}

@media (max-width: 560px) {
	.gbb-stage {
		padding: 22px 20px 24px;
	}
}

@media (max-width: 520px) {
	.gbb-wrap .gbb-products {
		grid-template-columns: repeat(2, 1fr);
		gap: 12px;
	}

	.gbb-wrap .gbb-product {
		padding: 10px;
		border-radius: 20px;
	}

	.gbb-wrap .gbb-product__foot {
		gap: 8px;
	}
}

@media (max-width: 360px) {
	.gbb-wrap .gbb-product__name {
		font-size: 11px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.gbb-wrap *,
	.gbb-wrap *::before,
	.gbb-wrap *::after {
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
	}
}
