/* IHN Gift Box: customer builder */
.ihn-gb {
	--ihn-gb-accent: #e73886;
	--ihn-gb-accent-dark: #c81f6c;
	--ihn-gb-ink: #2b2b2b;
	--ihn-gb-muted: #777;
	--ihn-gb-line: #e8e2dc;
	--ihn-gb-paper: #fbf7f2;
	--ihn-gb-radius: 12px;
	color: var(--ihn-gb-ink);
	max-width: 1200px;
	margin: 0 auto 64px;
	scroll-margin-top: 120px;
}
.ihn-gb *, .ihn-gb *::before, .ihn-gb *::after { box-sizing: border-box; }
.ihn-gb img { max-width: 100%; height: auto; display: block; }

/* Buttons (selectors are doubled up to win over the theme's button styles) */
.ihn-gb .ihn-gb-button {
	display: inline-block;
	padding: 12px 22px;
	border: 2px solid var(--ihn-gb-accent);
	border-radius: 999px;
	background: var(--ihn-gb-accent);
	color: #fff;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	transition: background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}
.ihn-gb .ihn-gb-button:hover,
.ihn-gb .ihn-gb-button:focus-visible { background: var(--ihn-gb-accent-dark); border-color: var(--ihn-gb-accent-dark); color: #fff; }
.ihn-gb .ihn-gb-button:disabled { background: #fff; border-color: var(--ihn-gb-line); color: var(--ihn-gb-muted); cursor: not-allowed; }
.ihn-gb .ihn-gb-button--small { padding: 8px 14px; font-size: 13px; }
.ihn-gb .ihn-gb-button--wide { width: 100%; }
.ihn-gb .ihn-gb-link {
	display: block;
	width: 100%;
	margin-top: 12px;
	padding: 4px;
	border: 0;
	background: none;
	color: var(--ihn-gb-muted);
	font-size: 14px;
	text-align: center;
	cursor: pointer;
}
.ihn-gb .ihn-gb-link:hover,
.ihn-gb .ihn-gb-link:focus-visible { background: none; color: var(--ihn-gb-accent); text-decoration: underline; }

/* Step indicator */
.ihn-gb-steps {
	display: flex;
	justify-content: center;
	gap: 8px 28px;
	flex-wrap: wrap;
	margin: 0 0 28px;
	padding: 0;
	list-style: none;
}
.ihn-gb-steps__item { display: flex; align-items: center; gap: 8px; color: var(--ihn-gb-muted); font-size: 14px; }
.ihn-gb-steps__number {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border: 2px solid var(--ihn-gb-line);
	border-radius: 50%;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}
.ihn-gb-steps__item.is-current { color: var(--ihn-gb-ink); font-weight: 600; }
.ihn-gb-steps__item.is-current .ihn-gb-steps__number { border-color: var(--ihn-gb-accent); background: var(--ihn-gb-accent); color: #fff; }
.ihn-gb-steps__item.is-done .ihn-gb-steps__number { border-color: var(--ihn-gb-accent); color: var(--ihn-gb-accent); }

/* Step 1: box cards */
.ihn-gb-boxes { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 360px)); justify-content: center; gap: 24px; }
.ihn-gb-box-card {
	display: flex;
	flex-direction: column;
	border: 1px solid var(--ihn-gb-line);
	border-radius: var(--ihn-gb-radius);
	background: #fff;
	overflow: hidden;
}
.ihn-gb-box-card__image { width: 100%; aspect-ratio: 4 / 3; background: var(--ihn-gb-paper); }

/* Stacked images that cross-fade (box card hover and the carousel) */
.ihn-gb-stack { position: relative; overflow: hidden; }
.ihn-gb .ihn-gb-stack__image {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	opacity: 0;
	transition: opacity 0.6s ease;
}
.ihn-gb .ihn-gb-stack__image.is-active { opacity: 1; }
.ihn-gb-box-card { position: relative; }
.ihn-gb .ihn-gb-badge {
	position: absolute;
	top: 14px;
	left: 14px;
	z-index: 2;
	padding: 6px 12px;
	border-radius: 999px;
	background: var(--ihn-gb-accent);
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}
.ihn-gb .ihn-gb-badge--free_shipping { background: #2e7d4f; }
.ihn-gb .ihn-gb-badge--best_value { background: #b7791f; }
.ihn-gb-box-card__body { display: flex; flex-direction: column; flex: 1; gap: 6px; padding: 20px; }
.ihn-gb-box-card__name { margin: 0; font-size: 20px; }
.ihn-gb-box-card__price { margin: 0; color: var(--ihn-gb-accent); font-size: 24px; font-weight: 700; }
.ihn-gb-box-card__meta { margin: 0; color: var(--ihn-gb-muted); font-size: 14px; }
.ihn-gb-box-card__description { flex: 1; font-size: 15px; }
.ihn-gb-box-card__description p { margin: 0 0 8px; }
.ihn-gb-box-card .ihn-gb-button { margin-top: 10px; align-self: flex-start; }

/* Step 2: products and the box panel */
.ihn-gb-fill { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 32px; align-items: start; }
.ihn-gb-products { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }
.ihn-gb-product {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 12px;
	border: 1px solid var(--ihn-gb-line);
	border-radius: var(--ihn-gb-radius);
	background: #fff;
	text-align: center;
	transition: box-shadow 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}
.ihn-gb-product[draggable="true"] { cursor: grab; }
.ihn-gb-product[draggable="true"]:hover { box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08); transform: translateY(-2px); }
.ihn-gb-product[draggable="true"]:active { cursor: grabbing; }
.ihn-gb-product.is-disabled { opacity: 0.55; }
.ihn-gb-product.is-in-box { opacity: 0.75; border-color: var(--ihn-gb-accent); }
.ihn-gb-product.is-out-of-stock { opacity: 0.45; filter: grayscale(1); }
.ihn-gb-product__media { position: relative; }
.ihn-gb-product__image { width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 8px; }
.ihn-gb-product__badge {
	position: absolute;
	top: 6px;
	right: 6px;
	padding: 3px 8px;
	border-radius: 999px;
	background: var(--ihn-gb-accent);
	color: #fff;
	font-size: 12px;
	font-weight: 600;
}
.ihn-gb-product__name { flex: 1; margin: 0; font-size: 14px; font-weight: 600; line-height: 1.3; }
.ihn-gb-product__price { margin: 0; color: var(--ihn-gb-muted); font-size: 13px; }

/* max-height + scroll: on a short screen the Continue button must stay reachable */
.ihn-gb-side { position: sticky; top: 110px; display: flex; flex-direction: column; gap: 16px; max-height: calc(100vh - 126px); overflow-y: auto; }

/* Box image carousel */
.ihn-gb-carousel { position: relative; border-radius: var(--ihn-gb-radius); overflow: hidden; background: var(--ihn-gb-paper); }
.ihn-gb-carousel__images { width: 100%; aspect-ratio: 4 / 3; }
.ihn-gb .ihn-gb-carousel__arrow {
	position: absolute;
	top: 50%;
	width: 34px;
	height: 34px;
	margin-top: -17px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.85);
	color: var(--ihn-gb-ink);
	font-size: 22px;
	line-height: 30px;
	text-align: center;
	cursor: pointer;
	transition: background-color 0.2s ease;
}
.ihn-gb .ihn-gb-carousel__arrow:hover,
.ihn-gb .ihn-gb-carousel__arrow:focus-visible { background: #fff; color: var(--ihn-gb-accent); }
.ihn-gb-carousel__arrow--prev { left: 8px; }
.ihn-gb-carousel__arrow--next { right: 8px; }
.ihn-gb-carousel__dots { position: absolute; left: 0; right: 0; bottom: 8px; display: flex; justify-content: center; gap: 6px; }
.ihn-gb .ihn-gb-carousel__dot {
	width: 9px;
	height: 9px;
	min-width: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.6);
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
	cursor: pointer;
}
.ihn-gb .ihn-gb-carousel__dot.is-active { background: var(--ihn-gb-accent); }

.ihn-gb-panel {
	border-radius: var(--ihn-gb-radius);
	background: var(--ihn-gb-paper);
	border: 2px solid var(--ihn-gb-line);
	overflow: hidden;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
/* The "lid": a band with a ribbon running down the middle of the box */
.ihn-gb-panel__lid {
	position: relative;
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 12px;
	padding: 14px 18px;
	background: var(--ihn-gb-accent);
	color: #fff;
}
/* !important: the theme's heading colour otherwise wins and leaves the title black on pink */
.ihn-gb .ihn-gb-panel .ihn-gb-panel__title { margin: 0; color: #fff !important; font-size: 17px; }
.ihn-gb-panel__price { font-weight: 700; }
.ihn-gb-panel__body { padding: 16px 18px 18px; }
.ihn-gb-panel__hint { margin: 0 0 12px; color: var(--ihn-gb-muted); font-size: 13px; }
.ihn-gb-panel__counter { margin: 14px 0 4px; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
.ihn-gb-panel__value { min-height: 20px; margin: 0 0 12px; color: var(--ihn-gb-accent-dark); font-size: 14px; text-align: center; }
.ihn-gb-panel.is-drop-target { border-style: dashed; border-color: var(--ihn-gb-accent); }
.ihn-gb-panel.is-drag-over { box-shadow: 0 0 0 4px rgba(231, 56, 134, 0.2); }
.ihn-gb-panel.is-full { border-color: var(--ihn-gb-accent); }

.ihn-gb-slots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.ihn-gb .ihn-gb-slot {
	position: relative;
	aspect-ratio: 1;
	padding: 0;
	border: 2px dashed #d9cfc5;
	border-radius: 10px;
	background: #fff;
	cursor: default;
	overflow: hidden;
}
.ihn-gb .ihn-gb-slot.is-filled { border-style: solid; border-color: var(--ihn-gb-line); cursor: pointer; }
.ihn-gb .ihn-gb-slot img { width: 100%; height: 100%; object-fit: contain; }
.ihn-gb-slot__remove {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(43, 43, 43, 0.55);
	color: #fff;
	font-size: 24px;
	opacity: 0;
	transition: opacity 0.15s ease;
}
.ihn-gb .ihn-gb-slot.is-filled:hover .ihn-gb-slot__remove,
.ihn-gb .ihn-gb-slot.is-filled:focus-visible .ihn-gb-slot__remove { opacity: 1; }

/* The image that flies from a product card into the box */
.ihn-gb-ghost {
	position: fixed;
	z-index: 99999;
	margin: 0;
	object-fit: contain;
	border-radius: 8px;
	pointer-events: none;
	will-change: transform;
}

/* Step 3: message and summary */
.ihn-gb-finish { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 32px; align-items: start; }
.ihn-gb-message__label { display: block; font-size: 18px; font-weight: 700; }
.ihn-gb-message__help { margin: 4px 0 12px; color: var(--ihn-gb-muted); font-size: 14px; }
.ihn-gb .ihn-gb-message__input {
	width: 100%;
	padding: 14px;
	border: 1px solid var(--ihn-gb-line);
	border-radius: var(--ihn-gb-radius);
	background: #fff;
	font-size: 16px;
	line-height: 1.5;
	resize: vertical;
}
.ihn-gb .ihn-gb-message__input:focus { border-color: var(--ihn-gb-accent); outline: 2px solid rgba(231, 56, 134, 0.25); }
.ihn-gb-message__counter { display: block; margin-top: 6px; color: var(--ihn-gb-muted); font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; }
.ihn-gb-summary { padding: 20px; border: 1px solid var(--ihn-gb-line); border-radius: var(--ihn-gb-radius); background: var(--ihn-gb-paper); }
.ihn-gb-summary__title { margin: 0 0 12px; font-size: 18px; }
.ihn-gb-summary__list { margin: 0 0 16px; padding: 0; list-style: none; }
.ihn-gb-summary__list li { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 14px; border-top: 1px solid var(--ihn-gb-line); }
.ihn-gb-summary__list img { width: 40px; height: 40px; object-fit: contain; border-radius: 6px; background: #fff; }
.ihn-gb-error { margin: 0 0 12px; padding: 10px 12px; border-radius: 8px; background: #fdecea; color: #a12622; font-size: 14px; }

/* Mobile: the box becomes a bar fixed to the bottom of the screen */
@media (max-width: 860px) {
	.ihn-gb { margin-bottom: 40px; }
	.ihn-gb-fill, .ihn-gb-finish { grid-template-columns: 1fr; }
	.ihn-gb-fill { padding-bottom: 210px; }
	/* The images sit above the products; the box itself stays fixed to the bottom of the screen */
	.ihn-gb-side { position: static; order: -1; max-height: none; overflow: visible; }
	.ihn-gb-steps__label { display: none; }
	.ihn-gb-steps__item.is-current .ihn-gb-steps__label { display: inline; }
	.ihn-gb-products { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
	.ihn-gb-panel {
		position: fixed;
		top: auto;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 999;
		border-width: 2px 0 0;
		border-radius: 16px 16px 0 0;
		box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.12);
	}
	.ihn-gb-panel__lid { padding: 8px 16px; }
	.ihn-gb .ihn-gb-panel .ihn-gb-panel__title { font-size: 15px; }
	.ihn-gb-panel__body { padding: 10px 16px 12px; }
	.ihn-gb-panel__hint, .ihn-gb-panel__value:empty { display: none; }
	.ihn-gb-panel__value { min-height: 0; margin-bottom: 6px; }
	.ihn-gb-panel__counter { margin: 8px 0 6px; font-size: 14px; }
	.ihn-gb-slots { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
	.ihn-gb .ihn-gb-slot { flex: 0 0 46px; width: 46px; height: 46px; }
	.ihn-gb .ihn-gb-link { margin-top: 6px; font-size: 13px; }
}

/* Short desktop screens: a shallower carousel leaves room for the box */
@media (min-width: 861px) and (max-height: 820px) {
	.ihn-gb-carousel__images { aspect-ratio: 2 / 1; }
}

@media (prefers-reduced-motion: reduce) {
	.ihn-gb *, .ihn-gb *::before, .ihn-gb *::after { transition: none !important; }
}
