/*
 * Blessing Boxes sign-up. Everything is scoped under .bbx so it won't clash with Divi.
 * To match your site, override these variables in Divi → Theme Options → Custom CSS, e.g.
 *   .bbx { --bbx-accent: #1f4e79; }
 * Fonts inherit from your Divi theme.
 */
.bbx {
	--bbx-bg: #ffffff;
	--bbx-sunk: #eef2ec;
	--bbx-ink: #1c2921;
	--bbx-muted: #5a6a60;
	--bbx-line: #d6ddd3;
	--bbx-accent: #2d6a48;
	--bbx-accent-ink: #ffffff;
	--bbx-gold: #c8890f;
	--bbx-gold-soft: #f7ead0;
	--bbx-gold-ink: #7d5400;
	--bbx-danger: #a33b2b;
	--bbx-radius: 12px;
	color: var(--bbx-ink);
	max-width: 760px;
	margin: 0 auto;
	display: flex;
	flex-direction: column;
	gap: 24px;
	line-height: 1.5;
	font-size: 16px;
}
.bbx *, .bbx *::before, .bbx *::after { box-sizing: border-box; }
.bbx [hidden] { display: none !important; }
.bbx-num { font-variant-numeric: tabular-nums; }

.bbx-head { display: flex; flex-direction: column; gap: 12px; }
.bbx .bbx-eyebrow { font-size: .75rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--bbx-accent); }
.bbx .bbx-title { margin: 0; padding: 0; font-size: clamp(1.8rem, 5vw, 2.6rem); line-height: 1.15; color: var(--bbx-ink); text-wrap: balance; }
.bbx .bbx-lede { margin: 0; padding: 0; color: var(--bbx-muted); max-width: 60ch; display: flex; flex-direction: column; gap: .8em; }
.bbx .bbx-lede p { margin: 0; padding: 0; }

.bbx-tally { display: grid; grid-template-columns: auto 1fr; gap: 4px 20px; align-items: center; background: var(--bbx-bg); border: 1px solid var(--bbx-line); border-radius: 14px; padding: 20px 22px; }
.bbx-tally-big { font-size: 3.2rem; line-height: 1; font-weight: 700; grid-row: span 2; font-variant-numeric: tabular-nums; }
.bbx-tally-label { font-weight: 600; }
.bbx-tally-sub { color: var(--bbx-muted); font-size: .9rem; font-variant-numeric: tabular-nums; }
.bbx-tally .bbx-bar { grid-column: 1 / -1; margin-top: 10px; height: 10px; }
.bbx-bar { height: 6px; background: var(--bbx-sunk); border-radius: 99px; overflow: hidden; }
.bbx-bar i { display: block; height: 100%; width: 0; background: var(--bbx-gold); border-radius: 99px; transition: width .5s ease; }

.bbx-done { display: flex; gap: 16px; align-items: center; background: var(--bbx-gold-soft); color: var(--bbx-gold-ink); border-radius: 14px; padding: 18px 20px; }
.bbx-done svg { flex: none; }
.bbx-done strong { display: block; font-size: 1.3rem; color: var(--bbx-ink); }

.bbx-cancel { background: var(--bbx-gold-soft); border-radius: 14px; padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.bbx .bbx-cancel-q { margin: 0; padding: 0; }
.bbx-cancel-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.bbx-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.bbx .bbx-h { margin: 0; padding: 0; font-size: 1.4rem; color: var(--bbx-ink); }
.bbx-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.bbx .bbx-chip { font: inherit; font-size: .88rem; font-weight: 600; border: 1px solid var(--bbx-line); background: var(--bbx-bg); color: var(--bbx-muted); border-radius: 99px; padding: 6px 14px; cursor: pointer; line-height: 1.3; }
.bbx .bbx-chip[aria-pressed="true"] { background: var(--bbx-ink); border-color: var(--bbx-ink); color: var(--bbx-bg); }

#bbx-list { display: flex; flex-direction: column; gap: 24px; }
.bbx-shelf { display: flex; flex-direction: column; }
.bbx .bbx-shelf h4 { margin: 0; padding: 0 0 6px; font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--bbx-muted); border-bottom: 1px solid var(--bbx-line); }
.bbx .bbx-items { list-style: none; margin: 0; padding: 0; }
.bbx .bbx-item { list-style: none; margin: 0; display: grid; grid-template-columns: minmax(0, 1fr) 160px 140px; gap: 16px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--bbx-line); }
.bbx-item-name { font-weight: 600; }
.bbx-item-unit { color: var(--bbx-muted); font-size: .86rem; }
.bbx-meter { display: flex; flex-direction: column; gap: 5px; }
.bbx-meter span { font-size: .82rem; color: var(--bbx-muted); }
.bbx-item.is-covered .bbx-item-name { color: var(--bbx-muted); }
.bbx-item.is-covered .bbx-bar i { background: var(--bbx-accent); }
.bbx-covered-tag { justify-self: end; font-size: .82rem; font-weight: 700; color: var(--bbx-accent); display: flex; gap: 6px; align-items: center; }

.bbx .bbx-btn { font: inherit; font-weight: 600; font-size: .9rem; line-height: 1.3; border-radius: 10px; padding: 9px 14px; cursor: pointer; border: 1px solid transparent; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.bbx .bbx-btn::after { display: none; } /* Divi button icons */
.bbx .bbx-btn-primary { background: var(--bbx-accent); color: var(--bbx-accent-ink); }
.bbx .bbx-btn-ghost { background: transparent; border-color: var(--bbx-line); color: var(--bbx-ink); }
.bbx .bbx-btn-danger { background: var(--bbx-danger); color: #fff; }
.bbx .bbx-btn:disabled { opacity: .5; cursor: default; }
.bbx .bbx-item > .bbx-btn { justify-self: end; width: 100%; }
.bbx .bbx-btn:focus-visible, .bbx .bbx-chip:focus-visible, .bbx input:focus-visible { outline: 2px solid var(--bbx-gold); outline-offset: 2px; }

.bbx-form { grid-column: 1 / -1; background: var(--bbx-sunk); border-radius: var(--bbx-radius); padding: 16px; display: grid; grid-template-columns: 110px minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: end; }
.bbx .bbx-field { display: flex; flex-direction: column; gap: 4px; font-size: .8rem; font-weight: 600; color: var(--bbx-muted); min-width: 0; margin: 0; }
.bbx .bbx-phone { grid-column: 1 / 3; }
.bbx-opt { font-weight: 400; }
.bbx .bbx-form input { font: inherit; font-size: 1rem; color: var(--bbx-ink); background: var(--bbx-bg); border: 1px solid var(--bbx-line); border-radius: 8px; padding: 9px 10px; width: 100%; margin: 0; box-shadow: none; }
.bbx-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.bbx .bbx-err { grid-column: 1 / -1; color: var(--bbx-danger); font-size: .88rem; font-weight: 600; margin: 0; padding: 0; }
.bbx-form-actions { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.bbx-form-note { font-size: .82rem; color: var(--bbx-muted); margin-left: auto; }

.bbx-empty { background: var(--bbx-bg); border: 1px dashed var(--bbx-line); border-radius: 14px; padding: 24px 20px; color: var(--bbx-muted); }
.bbx-empty strong { display: block; color: var(--bbx-ink); margin-bottom: 4px; }

.bbx-toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); max-width: calc(100% - 32px); background: var(--bbx-ink); color: var(--bbx-bg); padding: 10px 18px; border-radius: 14px; font-weight: 600; font-size: .9rem; z-index: 99999; text-align: center; }

@media (max-width: 620px) {
	.bbx .bbx-item { grid-template-columns: minmax(0, 1fr) auto; gap: 10px 14px; }
	.bbx-meter { grid-column: 1 / -1; grid-row: 2; }
	.bbx .bbx-item > .bbx-btn { width: auto; }
	.bbx-form { grid-template-columns: 1fr 1fr; }
	.bbx .bbx-qty, .bbx .bbx-phone { grid-column: 1 / -1; }
	.bbx-form-note { margin-left: 0; }
}
@media (max-width: 420px) {
	.bbx-form { grid-template-columns: 1fr; }
	.bbx-tally-big { font-size: 2.6rem; }
}
@media (prefers-reduced-motion: reduce) {
	.bbx-bar i { transition: none; }
}
