/* =========================================================
 * FREQUENTLY BOUGHT TOGETHER
 * Each card carries its own Subscribe / One-time selector.
 * Self-contained tokens so it works with or without the PDP CSS.
 * =======================================================*/
.hpf-fbt {
	--fbt-ink: #1d2327;
	--fbt-body: #414141;
	--fbt-muted: #6c6c6c;
	--fbt-line: #e7e7e3;
	--fbt-teal: #60babf;
	--fbt-teal-d: #3f989d;
	--fbt-teal-soft: #e7f4f5;
	--fbt-pink: #d46681;
	--fbt-pink-d: #b94e69;
	--fbt-pink-soft: #fbeef1;
	font-family: 'Nunito', sans-serif;
	color: var(--fbt-body);
	padding: 28px 0;
}
.hpf-fbt *, .hpf-fbt *::before, .hpf-fbt *::after { box-sizing: border-box; }
.hpf-fbt__title {
	font-family: 'Quicksand', sans-serif; font-weight: 700;
	font-size: clamp(22px, 2.4vw, 30px); color: var(--fbt-ink); margin: 0 0 20px;
}

/* ---- Card shell ---- */
.hpf-fbt__card {
	background: #fff; border: 1px solid var(--fbt-line); border-radius: 16px; padding: 24px;
	box-shadow: 0 8px 24px rgba(29, 35, 39, .05);
	display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 28px; align-items: start;
}

/* ---- Items row (grid of product cards) ---- */
.hpf-fbt__items { display: grid; grid-template-columns: repeat(auto-fit, minmax(185px, 1fr)); gap: 18px; align-items: start; }
.hpf-fbt__plus { display: none; }

.hpf-fbt__item { position: relative; display: flex; flex-direction: column; gap: 9px; margin: 0; text-align: left; min-width: 0; transition: opacity .15s; }
.hpf-fbt__item.is-oos { opacity: .65; }
.hpf-fbt__item.is-excluded { opacity: .5; }
.hpf-fbt__item.is-excluded .hpf-fbt__opts { opacity: .5; pointer-events: none; }

/* Include/exclude checkbox (top-right of image) */
.hpf-fbt__check-wrap { position: absolute; top: 8px; right: 8px; z-index: 3; width: 26px; height: 26px; }
.hpf-fbt__check { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.hpf-fbt__check-box {
	position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none;
	border-radius: 8px; border: 2px solid var(--fbt-teal); background: #fff; color: transparent;
	box-shadow: 0 2px 6px rgba(29, 35, 39, .15); transition: all .15s;
}
.hpf-fbt__check:checked + .hpf-fbt__check-box { background: var(--fbt-teal); color: #fff; }
.hpf-fbt__check:focus-visible + .hpf-fbt__check-box { outline: 3px solid var(--fbt-teal); outline-offset: 2px; }

/* Main product — mirrors the hero buy-box */
.hpf-fbt__mirror { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.hpf-fbt__mirror-price { font-family: 'Quicksand', sans-serif; font-weight: 800; font-size: 16px; color: var(--fbt-pink-d); }
.hpf-fbt__mirror-mode { font-size: 12px; font-weight: 700; color: var(--fbt-teal-d); }
.hpf-fbt__mirror-note { margin: 0; font-size: 11px; color: var(--fbt-muted); font-style: italic; }

.hpf-fbt__media { position: relative; border-radius: 14px; overflow: hidden; aspect-ratio: 1/1; background: var(--fbt-teal-soft); border: 2px solid var(--fbt-line); }
.hpf-fbt__item--main .hpf-fbt__media { border-color: var(--fbt-teal); }
.hpf-fbt__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hpf-fbt__tag { position: absolute; top: 8px; left: 8px; z-index: 2; color: #fff; font-size: 10.5px; font-weight: 800; letter-spacing: .3px; padding: 3px 9px; border-radius: 999px; }
.hpf-fbt__tag--main { background: var(--fbt-teal-d); }
.hpf-fbt__oos-badge { position: absolute; inset: auto 8px 8px; background: rgba(29, 35, 39, .8); color: #fff; font-size: 10.5px; font-weight: 700; padding: 3px 8px; border-radius: 999px; text-align: center; }

.hpf-fbt__name { display: block; font-family: 'Quicksand', sans-serif; font-size: 13px; font-weight: 700; letter-spacing: .3px; text-transform: uppercase; color: var(--fbt-teal-d); text-decoration: none; line-height: 1.3; }
.hpf-fbt__name:hover { color: var(--fbt-teal); }
.hpf-fbt__price { font-size: 14px; font-weight: 800; color: var(--fbt-ink); }
.hpf-fbt__price del { color: var(--fbt-muted); font-weight: 500; font-size: 12px; }
.hpf-fbt__price ins { text-decoration: none; }
.hpf-fbt__stock--out { font-size: 12px; font-weight: 700; color: var(--fbt-pink-d); }
.hpf-fbt__choose { display: inline-block; align-self: flex-start; font-size: 12px; font-weight: 700; color: var(--fbt-teal-d); border: 1.5px solid var(--fbt-teal); border-radius: 999px; padding: 5px 14px; text-decoration: none; }
.hpf-fbt__choose:hover { background: var(--fbt-teal); color: #fff; }

/* ---- Per-product Subscribe / One-time ---- */
.hpf-fbt__opts { display: flex; flex-direction: column; gap: 8px; }
.hpf-fbt__opt {
	position: relative; display: flex; align-items: flex-start; gap: 9px; margin: 0;
	border: 1.5px solid var(--fbt-line); border-radius: 12px; padding: 10px 12px; cursor: pointer;
	transition: border-color .15s, background .15s;
}
.hpf-fbt__opt:hover { border-color: var(--fbt-teal); }
.hpf-fbt__opt input { position: absolute; opacity: 0; pointer-events: none; }
.hpf-fbt__opt-dot { flex: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--fbt-muted); margin-top: 1px; transition: box-shadow .15s, border-color .15s; box-sizing: border-box; }
.hpf-fbt__opt--sub.is-selected { border-color: var(--fbt-pink); background: var(--fbt-pink-soft); }
.hpf-fbt__opt--sub.is-selected .hpf-fbt__opt-dot { border-color: var(--fbt-pink); box-shadow: inset 0 0 0 4px var(--fbt-pink), inset 0 0 0 6px #fff; }
.hpf-fbt__opt--once.is-selected { border-color: var(--fbt-teal); }
.hpf-fbt__opt--once.is-selected .hpf-fbt__opt-dot { border-color: var(--fbt-teal); box-shadow: inset 0 0 0 4px var(--fbt-teal), inset 0 0 0 6px #fff; }
.hpf-fbt__opt input:focus-visible + .hpf-fbt__opt-dot { outline: 3px solid var(--fbt-teal); outline-offset: 2px; }
.hpf-fbt__opt-body { flex: 1; min-width: 0; }
.hpf-fbt__opt-top { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--fbt-ink); }
.hpf-fbt__opt-top > b { font-weight: 800; }
.hpf-fbt__save-badge { background: var(--fbt-pink); color: #fff; font-size: 10.5px; font-weight: 800; padding: 2px 7px; border-radius: 999px; }
.hpf-fbt__opt-price { margin-left: auto; white-space: nowrap; }
.hpf-fbt__opt-price s { color: var(--fbt-muted); font-weight: 500; font-size: 11.5px; margin-right: 4px; }
.hpf-fbt__opt-price b { color: var(--fbt-pink-d); font-weight: 800; font-size: 13.5px; }
.hpf-fbt__opt--once .hpf-fbt__opt-price b { color: var(--fbt-ink); }
.hpf-fbt__opt-body small { display: block; font-size: 11px; color: var(--fbt-muted); margin-top: 2px; }
.hpf-fbt__freq {
	width: 100%; min-height: 40px; border: 1.5px solid var(--fbt-line); border-radius: 10px; padding: 8px 12px;
	font-family: 'Nunito', sans-serif; font-size: 12.5px; font-weight: 700; color: var(--fbt-ink); background: #fff; cursor: pointer;
}

/* ---- Summary ---- */
.hpf-fbt__summary { border-left: 1px dashed var(--fbt-line); padding-left: 28px; min-width: 0; }
.hpf-fbt__count { font-size: 14px; color: var(--fbt-muted); }
.hpf-fbt__total { font-family: 'Quicksand', sans-serif; font-weight: 800; font-size: 30px; color: var(--fbt-ink); margin: 4px 0 2px; }
.hpf-fbt__save { font-size: 13px; font-weight: 700; color: var(--fbt-pink-d); margin-bottom: 14px; }
.hpf-fbt__add {
	position: relative; width: 100%; min-height: 50px; border: 0; border-radius: 12px;
	background: var(--fbt-pink); color: #fff; font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 15px;
	cursor: pointer; transition: background .2s, transform .15s, box-shadow .2s; box-shadow: 0 8px 20px rgba(212, 102, 129, .3);
}
.hpf-fbt__add:hover:not(:disabled) { background: var(--fbt-pink-d); transform: translateY(-1px); }
.hpf-fbt__add:disabled { opacity: .6; cursor: not-allowed; box-shadow: none; }
.hpf-fbt__add.is-loading .hpf-fbt__add-label { visibility: hidden; }
.hpf-fbt__spinner { display: none; }
.hpf-fbt__add.is-loading .hpf-fbt__spinner {
	display: block; position: absolute; top: 50%; left: 50%; width: 20px; height: 20px; margin: -10px 0 0 -10px;
	border: 2.5px solid rgba(255, 255, 255, .45); border-top-color: #fff; border-radius: 50%; animation: hpfFbtSpin .7s linear infinite;
}
@keyframes hpfFbtSpin { to { transform: rotate(360deg); } }
.hpf-fbt__note { margin: 10px 0 0; font-size: 13px; font-weight: 600; }
.hpf-fbt__note.is-success { color: var(--fbt-teal-d); }
.hpf-fbt__note.is-error { color: var(--fbt-pink-d); }

/* ---- Responsive ---- */
@media (max-width: 900px) {
	.hpf-fbt__card { grid-template-columns: 1fr; gap: 20px; }
	.hpf-fbt__summary { border-left: 0; border-top: 1px dashed var(--fbt-line); padding-left: 0; padding-top: 20px; }
}
@media (max-width: 600px) {
	.hpf-fbt__items { grid-template-columns: 1fr; gap: 22px; }
	/* Sticky "Add" button while the section is on screen. */
	.hpf-fbt__summary {
		position: sticky; bottom: 0; z-index: 5; background: #fff; margin: 0 -16px -28px; padding: 16px;
		border-top: 1px solid var(--fbt-line); box-shadow: 0 -8px 20px rgba(29, 35, 39, .08);
	}
	.hpf-fbt__count, .hpf-fbt__save { display: inline-block; margin-right: 10px; }
	.hpf-fbt__total { display: inline-block; font-size: 22px; margin: 0 10px 8px 0; }
}
