/* ==========================================================
   KHM Glow Box — build-your-own gift box routine page
   Layout follows btime.om routine pages; colours follow the KHM logo.
   Scoped to .khm-gb so the Cerla theme is not affected.
   ========================================================== */

.khm-gb {
	--gb-ink: #1c1c1c;
	--gb-muted: #5f5850;
	--gb-gold: #86642a;
	--gb-gold-dark: #6b4f1f;
	--gb-gold-soft: #f3e9d6;
	--gb-line: #ece4d6;
	--gb-morning: linear-gradient(160deg, #fdf8ef 0%, #f8ecd8 100%);
	--gb-evening: linear-gradient(160deg, #f6f3ef 0%, #ebe5dd 100%);
	--gb-radius: 22px;
	--gb-shadow: 0 10px 30px rgba(28, 28, 28, .06);
	--gb-head: "Mulish", "Muli", sans-serif;
	--gb-text: "Questrial", sans-serif;

	position: relative;
	color: var(--gb-ink);
	font-family: var(--gb-text);
	font-size: 15px;
	line-height: 1.6;
	letter-spacing: .01em;
	padding-bottom: 40px;
}
.khm-gb *,
.khm-gb *::before,
.khm-gb *::after { box-sizing: border-box; }
.khm-gb img { max-width: 100%; height: auto; display: block; }
.khm-gb a { color: inherit; text-decoration: none; }
.khm-gb ul, .khm-gb ol { list-style: none; margin: 0; padding: 0; }
.khm-gb p, .khm-gb h2, .khm-gb h3, .khm-gb dl, .khm-gb dd { margin: 0; }
.khm-gb button {
	font: inherit; color: inherit; cursor: pointer;
	margin: 0; padding: 0; border: 0; border-radius: 0;
	background: none; box-shadow: none; text-transform: none; letter-spacing: inherit;
	line-height: inherit; min-height: 0; height: auto; width: auto;
}
.khm-gb [hidden] { display: none !important; }
.khm-gb .khm-gb__icon { display: block; flex: none; }
.khm-gb :focus-visible { outline: 2px solid var(--gb-gold); outline-offset: 2px; }

/* ---------- Banner ---------- */

.khm-gb__banner {
	position: relative;
	display: grid;
	place-items: center;
	min-height: 170px;
	margin: 0 0 48px;
	padding: 32px 24px;
	overflow: hidden;
	border-radius: var(--gb-radius);
	background: #2a2622;
	text-align: center;
}
.khm-gb__banner-art {
	position: absolute; inset: 0;
	display: grid; grid-template-columns: repeat(4, 1fr);
	opacity: .35;
	filter: blur(1px) grayscale(.2);
}
.khm-gb__banner-art .khm-gb__banner-img { width: 100%; height: 100%; object-fit: cover; background: #fff; }
.khm-gb__banner::after {
	content: ""; position: absolute; inset: 0;
	background: linear-gradient(90deg, rgba(28, 25, 22, .55), rgba(28, 25, 22, .35), rgba(28, 25, 22, .55));
}
.khm-gb__banner-title {
	position: relative; z-index: 1;
	color: #fff;
	font-family: var(--gb-head);
	font-size: clamp(18px, 2.2vw, 26px);
	font-weight: 700;
	letter-spacing: .02em;
	text-transform: uppercase;
	text-shadow: 0 2px 12px rgba(0, 0, 0, .35);
}

/* ---------- Heading ---------- */

.khm-gb .khm-gb__heading {
	margin: 0 0 18px;
	color: var(--gb-gold-dark);
	font-family: var(--gb-head);
	font-size: clamp(28px, 3.6vw, 48px);
	font-weight: 700;
	line-height: 1.25;
	letter-spacing: -.01em;
	text-transform: none;
}
.khm-gb .khm-gb__intro { max-width: 860px; margin-bottom: 32px; color: var(--gb-muted); font-size: 16px; }

/* ---------- Box builder ---------- */

.khm-gb__box {
	display: grid;
	grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
	grid-template-areas: "head head" "tiles summary";
	gap: 20px 32px;
	max-width: 900px;
	margin-bottom: 48px;
	padding: 24px;
	border: 1px solid var(--gb-line);
	border-radius: var(--gb-radius);
	background: #fff;
	box-shadow: var(--gb-shadow);
}
.khm-gb__box-head { grid-area: head; display: flex; align-items: center; gap: 14px; }
.khm-gb__box-icon {
	display: inline-flex; align-items: center; justify-content: center;
	width: 44px; height: 44px; border-radius: 50%;
	background: var(--gb-gold-soft); color: var(--gb-gold-dark);
}
.khm-gb__box-icon .khm-gb__icon { width: 22px; height: 22px; }
.khm-gb__box-title { font-family: var(--gb-head); font-size: 18px; font-weight: 800; }
.khm-gb__box-sub { color: var(--gb-muted); font-size: 13.5px; }

.khm-gb__tiles { grid-area: tiles; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; align-content: start; }
.khm-gb .khm-gb__tile {
	position: relative;
	display: block; width: 100%;
	aspect-ratio: 1 / 1;
	padding: 8px;
	border: 1.5px solid var(--gb-line);
	border-radius: 14px;
	background: #fff;
	transition: border-color .2s ease, box-shadow .2s ease, opacity .2s ease, transform .2s ease;
}
.khm-gb .khm-gb__tile:hover { transform: translateY(-2px); }
.khm-gb .khm-gb__tile.is-selected { border-color: var(--gb-gold); box-shadow: 0 0 0 3px var(--gb-gold-soft); }
.khm-gb .khm-gb__tile:not(.is-selected) .khm-gb__tile-img { opacity: .45; filter: grayscale(.6); }
.khm-gb .khm-gb__tile.is-disabled { cursor: not-allowed; }
.khm-gb__tile-img { width: 100%; height: 100% !important; object-fit: contain; transition: opacity .2s ease, filter .2s ease; }
.khm-gb__tile-check {
	position: absolute; top: 6px; right: 6px;
	display: inline-flex; align-items: center; justify-content: center;
	width: 22px; height: 22px; border-radius: 50%;
	border: 1.5px solid var(--gb-line);
	background: #fff; color: transparent;
	transition: background .2s ease, border-color .2s ease, color .2s ease;
}
.khm-gb__tile-check .khm-gb__icon { width: 14px; height: 14px; stroke-width: 2.4; }
.khm-gb .khm-gb__tile.is-selected .khm-gb__tile-check { background: var(--gb-gold); border-color: var(--gb-gold); color: #fff; }
.khm-gb__tile-out {
	position: absolute; left: 6px; bottom: 6px;
	padding: 2px 6px; border-radius: 6px;
	background: #8c857c; color: #fff; font-size: 10px; font-weight: 700; text-transform: uppercase;
}

.khm-gb__summary { grid-area: summary; display: grid; align-content: start; gap: 8px; }
.khm-gb__count { color: var(--gb-muted); font-size: 14px; }
.khm-gb__count strong { color: var(--gb-ink); }
.khm-gb__total { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; }
.khm-gb__total-now { font-family: var(--gb-head); font-size: 28px; font-weight: 800; color: var(--gb-ink); }
.khm-gb__total-was { color: var(--gb-muted); font-size: 15px; }
.khm-gb__save { color: #2f7a4a; font-weight: 700; font-size: 14px; min-height: 1.2em; }
.khm-gb__offer {
	padding: 8px 12px; border-radius: 10px;
	background: var(--gb-gold-soft); color: var(--gb-gold-dark);
	font-size: 13px; font-weight: 700;
}
.khm-gb__offer.is-active { background: #e6f2ea; color: #2f7a4a; }

.khm-gb .khm-gb__btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 10px;
	width: 100%; min-height: 52px;
	margin-top: 6px; padding: 0 22px;
	border-radius: 999px;
	background: var(--gb-ink); color: #fff;
	font-family: var(--gb-head);
	font-size: 13px; font-weight: 800;
	letter-spacing: .08em; text-transform: uppercase;
	transition: background .2s ease, opacity .2s ease;
}
.khm-gb .khm-gb__btn:hover { background: var(--gb-gold); color: #fff; }
.khm-gb .khm-gb__btn[disabled] { opacity: .45; cursor: not-allowed; }
.khm-gb .khm-gb__btn.is-loading { opacity: .7; pointer-events: none; }
.khm-gb .khm-gb__btn.is-loading::after {
	content: ""; width: 14px; height: 14px;
	border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
	animation: khm-gb-spin .7s linear infinite;
}
@keyframes khm-gb-spin { to { transform: rotate(360deg); } }
.khm-gb .khm-gb__link {
	justify-self: center;
	color: var(--gb-gold-dark);
	font-size: 13.5px; font-weight: 700;
	text-decoration: underline; text-underline-offset: 3px;
}
.khm-gb__msg { font-size: 14px; text-align: center; }
.khm-gb__msg.is-error { color: #b4463c; }
.khm-gb__msg a { font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Routines ---------- */

.khm-gb__routines { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: start; }
.khm-gb__routine {
	padding: 28px;
	border: 1px solid var(--gb-line);
	border-radius: 28px;
	box-shadow: var(--gb-shadow);
}
.khm-gb__routine--morning { background: var(--gb-morning); }
.khm-gb__routine--evening { background: var(--gb-evening); }

.khm-gb .khm-gb__pill {
	display: inline-flex; align-items: center; gap: 8px;
	margin-bottom: 18px; padding: 9px 18px;
	border: 1px solid var(--gb-line); border-radius: 999px;
	background: #fff;
	color: var(--gb-gold-dark);
	font-family: var(--gb-head); font-size: 16px; font-weight: 800;
}
.khm-gb__pill .khm-gb__icon { width: 18px; height: 18px; }
.khm-gb__routine--evening .khm-gb__pill { color: var(--gb-ink); }

.khm-gb__steps { display: grid; gap: 16px; counter-reset: none; }
.khm-gb__step {
	padding: 22px 22px 26px;
	border-radius: 20px;
	background: rgba(255, 255, 255, .9);
	border: 1px solid rgba(236, 228, 214, .8);
}
.khm-gb .khm-gb__step-title {
	display: flex; align-items: flex-start; gap: 12px;
	margin: 0 0 12px;
	font-family: var(--gb-head);
	font-size: 16px; font-weight: 800; line-height: 1.4;
	color: var(--gb-ink); text-transform: none; letter-spacing: 0;
}
.khm-gb__num {
	display: inline-flex; align-items: center; justify-content: center; flex: none;
	width: 28px; height: 28px; margin-top: -2px;
	border: 1px solid var(--gb-line); border-radius: 50%;
	background: #fff; color: var(--gb-gold-dark);
	font-size: 13px; font-weight: 800;
}
.khm-gb .khm-gb__details { display: grid; gap: 6px; padding-left: 40px; margin-bottom: 20px; font-size: 14px; color: var(--gb-muted); }
.khm-gb__details dt { display: inline; font-weight: 700; color: var(--gb-ink); }
.khm-gb__details dd { display: inline; }
.khm-gb__details .is-warning dt { color: #b4463c; }

/* Product card */
.khm-gb__card {
	position: relative;
	display: grid;
	max-width: 290px;
	margin: 0 auto;
	padding: 16px 16px 0;
	border: 1px solid #e6d7bb;
	border-radius: 22px;
	background: #fff;
	box-shadow: 0 12px 26px rgba(168, 131, 74, .14);
	text-align: center;
	overflow: hidden;
}
.khm-gb__badge {
	position: absolute; top: 14px; right: 14px; z-index: 2;
	padding: 3px 9px; border-radius: 999px;
	background: var(--gb-gold-soft); color: var(--gb-gold-dark);
	font-size: 11.5px; font-weight: 800;
}
.khm-gb__card-actions { position: absolute; top: 14px; left: 14px; z-index: 2; display: grid; gap: 8px; }
.khm-gb .khm-gb__round {
	display: inline-flex; align-items: center; justify-content: center;
	width: 36px; height: 36px; border-radius: 12px;
	border: 1px solid var(--gb-line);
	background: #fff; color: var(--gb-gold-dark);
	box-shadow: 0 2px 8px rgba(0, 0, 0, .05);
	transition: background .2s ease, color .2s ease;
}
.khm-gb .khm-gb__round:hover { background: var(--gb-gold); color: #fff; }
.khm-gb__round .khm-gb__icon { width: 17px; height: 17px; }
.khm-gb__card-media { display: block; aspect-ratio: 1 / 1; margin: 8px 18px 6px; }
.khm-gb__card-img { width: 100%; height: 100% !important; object-fit: contain; }
.khm-gb__brand { font-family: var(--gb-head); font-size: 18px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.khm-gb .khm-gb__name {
	display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
	margin: 6px 8px 14px;
	color: var(--gb-gold-dark); font-size: 13px; line-height: 1.45;
}
.khm-gb__card-foot {
	display: flex; align-items: center; justify-content: space-between; gap: 10px;
	margin: 0 -16px; padding: 14px 16px;
	border-top: 1px solid var(--gb-line);
	background: #fdf9f2;
	text-align: left;
}
.khm-gb__price { display: grid; line-height: 1.3; }
.khm-gb__price-now { font-family: var(--gb-head); font-size: 16px; font-weight: 800; }
.khm-gb__price del { color: #b4463c; font-size: 12.5px; }
.khm-gb .khm-gb__plus {
	position: relative;
	display: inline-flex; align-items: center; justify-content: center; flex: none;
	width: 44px; height: 44px; border-radius: 12px;
	background: var(--gb-ink); color: #fff;
	transition: background .2s ease, transform .15s ease;
}
.khm-gb .khm-gb__plus:hover { background: var(--gb-gold); }
.khm-gb .khm-gb__plus:active { transform: scale(.94); }
.khm-gb .khm-gb__plus.is-selected { background: var(--gb-gold); }
.khm-gb .khm-gb__plus[disabled] { opacity: .35; cursor: not-allowed; }
.khm-gb__plus .khm-gb__icon { width: 20px; height: 20px; stroke-width: 2.2; }
.khm-gb__plus-on { display: none; }
.khm-gb .khm-gb__plus.is-selected .khm-gb__plus-add { display: none; }
.khm-gb .khm-gb__plus.is-selected .khm-gb__plus-on { display: inline-flex; }

/* ---------- Tips ---------- */

.khm-gb__tips {
	margin-top: 32px; padding: 26px 28px;
	border: 1px solid var(--gb-line); border-radius: var(--gb-radius);
	background: #fff;
}
.khm-gb .khm-gb__tips-title { margin: 0 0 12px; font-family: var(--gb-head); font-size: 18px; font-weight: 800; text-transform: none; }
.khm-gb__tips ul { display: grid; gap: 8px; }
.khm-gb__tips li { position: relative; padding-left: 18px; color: var(--gb-muted); }
.khm-gb__tips li::before { content: ""; position: absolute; left: 0; top: .65em; width: 7px; height: 7px; border-radius: 50%; background: var(--gb-gold); }

/* ---------- Sticky summary bar ---------- */

.khm-gb__bar {
	position: fixed; left: 50%; bottom: 16px; z-index: 9990;
	display: flex; align-items: center; justify-content: space-between; gap: 16px;
	width: min(720px, calc(100% - 24px));
	padding: 10px 10px 10px 20px;
	border-radius: 999px;
	background: #fff;
	box-shadow: 0 12px 40px rgba(0, 0, 0, .18);
	transform: translate(-50%, 140%);
	transition: transform .35s cubic-bezier(.22, .61, .36, 1);
}
.khm-gb__bar.is-visible { transform: translate(-50%, 0); }
.khm-gb__bar-info { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.khm-gb__bar-icon { color: var(--gb-gold-dark); }
.khm-gb__bar-text { display: grid; line-height: 1.25; }
.khm-gb__bar-text small { color: var(--gb-muted); font-size: 12px; }
.khm-gb__bar-text strong { font-family: var(--gb-head); font-size: 16px; font-weight: 800; }

/* Lift floating chat buttons (Click to Chat / WhatsApp) above the bar while it is shown */
body.khm-gb-bar-open .ht-ctc,
body.khm-gb-bar-open .ht_ctc_style,
body.khm-gb-bar-open [class*="ht-ctc-chat"] { transform: translateY(-74px); transition: transform .35s ease; }
.khm-gb .khm-gb__btn--bar { width: auto; min-height: 46px; margin: 0; padding: 0 24px; font-size: 12px; }

/* ---------- Responsive ---------- */

@media (max-width: 991px) {
	.khm-gb__routines { grid-template-columns: 1fr; }
}
@media (max-width: 767px) {
	.khm-gb { font-size: 14px; }
	.khm-gb__banner { min-height: 120px; margin-bottom: 28px; border-radius: 16px; }
	.khm-gb__banner-art { grid-template-columns: repeat(2, 1fr); }
	.khm-gb .khm-gb__intro { font-size: 14.5px; margin-bottom: 24px; }
	.khm-gb__box { grid-template-columns: 1fr; grid-template-areas: "head" "tiles" "summary"; padding: 18px; margin-bottom: 32px; }
	.khm-gb__routine { padding: 18px 14px; border-radius: 22px; }
	.khm-gb__step { padding: 18px 14px 22px; }
	.khm-gb .khm-gb__details { padding-left: 0; }
	/* sits above the theme's fixed mobile bottom menu */
	.khm-gb__bar { bottom: calc(68px + env(safe-area-inset-bottom, 0px)); padding: 8px 8px 8px 16px; }
	.khm-gb__bar-info { font-size: 13px; gap: 8px; }
	.khm-gb .khm-gb__btn--bar { padding: 0 16px; font-size: 11px; letter-spacing: .04em; }
	.khm-gb__btn--bar [data-gb-label] { white-space: nowrap; }
}

@media (prefers-reduced-motion: reduce) {
	.khm-gb *, .khm-gb__bar { transition: none !important; animation: none !important; }
}
