/**
 * ============================================================================
 * GIFT BOX BUILDER — styles
 * ============================================================================
 * Everything is scoped under .gmbb so it cannot affect the rest of the site.
 * To change the accent colour (buttons, highlights), edit --gmbb-accent below.
 * ============================================================================
 */
.gmbb {
	--gmbb-accent: #c8102e;        /* GiftMe red — change this to re-colour the whole builder */
	--gmbb-accent-dark: #a30d26;   /* darker red used on hover */
	--gmbb-border: #e5e5e5;
	max-width: 1100px;
	margin: 0 auto;
	padding-bottom: 90px;          /* leaves room for the sticky total bar */
	font-size: 15px;
}

/* ------------------------------------------------------------ step titles */
.gmbb-step { margin: 28px 0; }
.gmbb-step-title {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 20px;
	margin: 0 0 14px;
}
.gmbb-step-num {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: var(--gmbb-accent);
	color: #fff;
	font-size: 15px;
	flex: none;
}
.gmbb-counter {
	margin-left: auto;
	font-size: 14px;
	font-weight: 600;
	color: var(--gmbb-accent);
	background: #fdf0f2;
	padding: 4px 12px;
	border-radius: 999px;
}

/* ------------------------------------------------------- box package tabs */
.gmbb-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}
.gmbb-tab {
	flex: 1 1 150px;
	border: 2px solid var(--gmbb-border);
	background: #fff;
	border-radius: 10px;
	padding: 12px 10px;
	text-align: center;
	cursor: pointer;
	transition: border-color .15s, box-shadow .15s;
}
.gmbb-tab:hover { border-color: #bbb; }
.gmbb-tab.is-active {
	border-color: var(--gmbb-accent);
	box-shadow: 0 0 0 1px var(--gmbb-accent);
}
/* the explicit colours here protect against theme styles that force
   white text inside buttons (the giftmehandmades theme does this) */
.gmbb-tab-size { display: block; font-weight: 700; font-size: 15px; color: #222; }
.gmbb-tab-price { display: block; color: var(--gmbb-accent); font-weight: 600; margin-top: 2px; }
.gmbb-tab-items { display: block; color: #777; font-size: 13px; margin-top: 2px; }

/* --------------------------------------- sub-category filter pills (step 2) */
.gmbb-cats {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0 0 14px;
}
.gmbb-cat {
	border: 1px solid var(--gmbb-border);
	background: #fff;
	color: #333;
	border-radius: 999px;
	padding: 6px 16px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: all .15s;
}
.gmbb-cat:hover { border-color: #bbb; }
.gmbb-cat.is-active {
	background: var(--gmbb-accent);
	border-color: var(--gmbb-accent);
	color: #fff;
}

/* ------------------------------------------------------------- items grid */
.gmbb-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 14px;
}
.gmbb-item {
	border: 2px solid var(--gmbb-border);
	border-radius: 10px;
	overflow: hidden;
	background: #fff;
	cursor: pointer;
	transition: border-color .15s, box-shadow .15s, opacity .15s;
	display: flex;
	flex-direction: column;
}
.gmbb-item:hover { border-color: #bbb; }
.gmbb-item.is-selected {
	border-color: var(--gmbb-accent);
	box-shadow: 0 0 0 1px var(--gmbb-accent);
}
/* Large items are dimmed while the chosen box can't hold them
   (clicking one still offers the box upgrade). */
.gmbb-item.is-restricted { opacity: .55; }

.gmbb-item-img img {
	width: 100%;
	height: auto;
	display: block;
	aspect-ratio: 1 / 1;
	object-fit: cover;
}
.gmbb-item-name {
	padding: 8px 10px 4px;
	font-weight: 600;
	font-size: 14px;
	line-height: 1.3;
	flex: 1;
}
.gmbb-badge {
	display: inline-block;
	background: #f4b400;
	color: #4a3200;
	font-size: 11px;
	font-weight: 700;
	padding: 1px 7px;
	border-radius: 999px;
	margin-left: 4px;
	vertical-align: middle;
}

/* quantity controls at the bottom of each card */
.gmbb-item-controls {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	padding: 8px 10px 10px;
}
.gmbb-item-controls button {
	width: 30px;
	height: 30px;
	border-radius: 50%;
	border: 1px solid var(--gmbb-border);
	background: #fafafa;
	color: #333;        /* explicit colour — the theme paints button text white,
	                       which made the + and − invisible on the light circles */
	font-size: 16px;
	font-weight: 700;
	line-height: 1;
	cursor: pointer;
	padding: 0;
}
.gmbb-item-controls button:hover { background: #eee; }
.gmbb-item.is-selected .gmbb-btn-plus,
.gmbb-item.is-selected .gmbb-btn-minus {
	border-color: var(--gmbb-accent);
	color: var(--gmbb-accent);
}
.gmbb-item-qty { font-weight: 700; min-width: 18px; text-align: center; }

/* -------------------------------------------------------- customise fields */
.gmbb-field { margin: 0 0 16px; max-width: 480px; }
.gmbb-field label { display: block; font-weight: 600; margin-bottom: 6px; color: #222; }
.gmbb-field select,
.gmbb-field textarea,
.gmbb-field input[type="text"] {
	width: 100%;
	border: 1px solid #ccc;
	border-radius: 8px;
	padding: 9px 12px;
	font: inherit;
	color: #222;
	background: #fff;
}
/* Occasion + "Whom it is for" side by side on wide screens */
.gmbb-fields-row { display: flex; flex-wrap: wrap; gap: 0 24px; }
.gmbb-fields-row .gmbb-field { flex: 1 1 280px; }
/* the type-in box that appears when "Other" is chosen */
.gmbb-other-input { margin-top: 8px; }
/* red star on required fields */
.gmbb-req { color: var(--gmbb-accent); }

/* gift message live counter, e.g. "12 / 20" */
.gmbb-msg-count {
	float: right;
	font-weight: 700;
	font-size: 13px;
	color: #777;
}
.gmbb-msg-count.is-full { color: var(--gmbb-accent); }

/* ------------------------------------------------- gift card picker */
.gmbb-cards {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}
.gmbb-card {
	position: relative;
	width: 120px;
	border: 2px solid var(--gmbb-border);
	border-radius: 10px;
	overflow: visible;          /* lets the hover zoom pop outside the card */
	background: #fff;
	cursor: pointer;
	text-align: center;
	transition: border-color .15s, box-shadow .15s;
}
.gmbb-card > img {
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	display: block;
	border-radius: 8px 8px 0 0;
}
.gmbb-card-name {
	display: block;
	font-size: 12px;
	font-weight: 600;
	color: #333;
	padding: 5px 6px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.gmbb-card:hover { border-color: #bbb; }
.gmbb-card.is-selected {
	border-color: var(--gmbb-accent);
	box-shadow: 0 0 0 1px var(--gmbb-accent);
}
/* the tick badge on the selected card */
.gmbb-card-tick {
	position: absolute;
	top: -8px;
	right: -8px;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: var(--gmbb-accent);
	color: #fff;
	font-size: 14px;
	line-height: 24px;
	display: none;
	z-index: 3;
}
.gmbb-card.is-selected .gmbb-card-tick { display: block; }
/* enlarged preview shown while hovering a card */
.gmbb-card-zoom {
	display: none;
	position: absolute;
	bottom: calc(100% + 10px);
	left: 50%;
	transform: translateX(-50%);
	width: 340px;
	max-width: 80vw;
	z-index: 50;
	border-radius: 10px;
	overflow: hidden;
	box-shadow: 0 10px 40px rgba(0, 0, 0, .35);
	background: #fff;
	pointer-events: none;       /* the zoom never blocks clicking the card */
}
.gmbb-card-zoom img { width: 100%; display: block; }
.gmbb-card:hover .gmbb-card-zoom,
.gmbb-card:focus .gmbb-card-zoom { display: block; }

/* ---------------------------------------------------------- sticky total bar */
.gmbb-totalbar {
	position: sticky;
	bottom: 0;
	z-index: 40;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	background: #fff;
	border-top: 2px solid var(--gmbb-accent);
	box-shadow: 0 -4px 16px rgba(0, 0, 0, .08);
	padding: 12px 18px;
	border-radius: 10px 10px 0 0;
}
.gmbb-total-label { display: block; font-size: 13px; color: #777; }
.gmbb-total-amount { font-size: 24px; font-weight: 800; color: var(--gmbb-accent); }
/* the "add 2 more items…" / "pick a ribbon…" helper text in the bar */
.gmbb-total-hint { flex: 1; text-align: center; font-size: 13px; color: #a06; font-weight: 600; }
.gmbb-addtocart {
	background: var(--gmbb-accent);
	color: #fff;
	border: 0;
	border-radius: 8px;
	padding: 13px 26px;
	font-size: 16px;
	font-weight: 700;
	cursor: pointer;
	transition: background .15s;
}
.gmbb-addtocart:hover:not(:disabled) { background: var(--gmbb-accent-dark); }
.gmbb-addtocart:disabled { background: #ccc; cursor: not-allowed; }

/* ------------------------------------------------------------------ pop-up */
.gmbb-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	background: rgba(0, 0, 0, .55);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}
.gmbb-modal[hidden] { display: none; }
.gmbb-modal-box {
	background: #fff;
	border-radius: 12px;
	padding: 22px 24px;
	max-width: 420px;
	width: 100%;
	box-shadow: 0 10px 40px rgba(0, 0, 0, .25);
}
.gmbb-modal-box p { margin: 0 0 18px; font-size: 15px; line-height: 1.5; }
.gmbb-modal-actions { display: flex; gap: 10px; justify-content: flex-end; }
.gmbb-modal-ok {
	background: var(--gmbb-accent);
	color: #fff;
	border: 0;
	border-radius: 8px;
	padding: 9px 18px;
	font-weight: 700;
	cursor: pointer;
}
.gmbb-modal-cancel {
	background: #f1f1f1;
	color: #333;
	border: 0;
	border-radius: 8px;
	padding: 9px 18px;
	cursor: pointer;
}

/* ------------------------------------------------------------- small phones */
@media (max-width: 600px) {
	.gmbb-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
	.gmbb-tab { flex-basis: calc(50% - 10px); }
	.gmbb-total-amount { font-size: 20px; }
	.gmbb-addtocart { padding: 12px 16px; font-size: 15px; }
}
