/* Build your own subscription (1.2.15): picking layout. Only applies once bundle-builder.js has run.
   Colours and shapes follow the taster bundle page (.heb-mnm). */

.heb-byo-wrap { box-sizing: border-box; width: 100%; max-width: var(--wp--style--global--wide-size, 1280px) !important; margin: clamp(2rem, 5vw, 3.5rem) auto 0 !important; }
.heb-byo__head { margin: 0 0 1.25rem; }
.heb-byo__h { font-family: var(--display); text-transform: uppercase; font-size: clamp(1.8rem, 4vw, 2.6rem); line-height: 1; margin: 0 0 0.4rem; }
.heb-byo__help { margin: 0; font-size: 1rem; }

form.heb-byo { background: transparent; color: var(--ink); padding: 0; border: 0; display: grid !important; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.5rem 2rem; align-items: start; margin: 0 !important; }
form.heb-byo::before, form.heb-byo::after { content: none !important; display: none !important; }

/* ---------- The teas ---------- */
.heb-byo__teas { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0.9rem; min-width: 0; }
.heb-byo .bundled_product { display: grid !important; grid-template-columns: 64px minmax(0, 1fr); grid-template-rows: auto 1fr; gap: 0 0.7rem; align-items: start; background: var(--card); border: 2px solid #CFC5AE; border-radius: var(--radius); padding: 0.75rem; margin: 0 !important; float: none !important; width: auto !important; transition: border-color 0.15s, box-shadow 0.15s; }
.heb-byo .bundled_product::before, .heb-byo .bundled_product::after { content: none !important; display: none !important; }
.heb-byo .bundled_product.is-picked { border-color: var(--ink); box-shadow: 4px 4px 0 var(--gorse); }
.heb-byo .bundled_product_images, .heb-byo .bundled_product_images figure { margin: 0 !important; width: 64px !important; float: none !important; padding: 0 !important; }
.heb-byo .bundled_product_images img { width: 64px; height: 64px; object-fit: contain; background: #fff; border-radius: 4px; display: block; }
.heb-byo .bundled_product_images a { pointer-events: none; }
.heb-byo .bundled_product .details { display: contents; }
.heb-byo .bundled_product_title { grid-column: 2; align-self: center; font-family: var(--body) !important; text-transform: none !important; letter-spacing: 0 !important; font-size: 0.98rem !important; font-weight: 800 !important; line-height: 1.25 !important; margin: 0 !important; }
.heb-byo .bundled_product_title_link a { font-size: 0.75rem; }
.heb-byo .bundled_item_cart_content { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 0.55rem; margin: 0.65rem 0 0 !important; padding: 0 !important; height: 100%; }
.heb-byo .bundled_product_excerpt { grid-column: 1 / -1; font-size: 0.88rem; margin: 0.4rem 0 0; }
.heb-byo .bundled_product_excerpt p { margin: 0; }

.heb-bb-hidden { display: none !important; }
.heb-bb-packs__label { margin: 0 0 0.3rem; font-size: 0.8rem; font-weight: 700; color: var(--muted); }
.heb-bb-packs__group { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.35rem; }
.heb-bb-packs__btn { min-height: 40px; padding: 0.3rem 0.4rem; border: 2px solid #8A8178; border-radius: var(--radius-btn); background: #fff; color: var(--ink); font: 700 0.86rem/1.2 var(--body); cursor: pointer; text-align: center; }
.heb-bb-packs__btn:hover:not(:disabled) { border-color: var(--ink); }
.heb-bb-packs__btn[aria-checked="true"] { background: var(--gorse); border-color: var(--ink); }
.heb-bb-packs__btn:disabled { opacity: 0.4; cursor: not-allowed; text-decoration: line-through; }
.heb-bb-packs__btn[hidden] { display: none; }
.heb-bb-packs__group[data-n="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.heb-bb-packs__btn:focus-visible, .heb-bb-qty__btn:focus-visible, .heb-bb-list__x:focus-visible, .heb-bb-bar__go:focus-visible { outline: 3px solid var(--sound, #1F6FA8); outline-offset: 2px; }

.heb-byo .single_variation_wrap { display: flex !important; flex-wrap: nowrap; align-items: center; justify-content: space-between; gap: 0.5rem; margin: auto 0 0 !important; }
.heb-byo .single_variation_wrap > * { margin: 0 !important; }
.heb-byo .bundled_item_cart_details { min-width: 0; }
.heb-byo .bundled_item_cart_details:empty { display: none; }
.heb-byo .bundled_item_cart_details .price, .heb-byo .bundled_item_cart_details p { font-size: 0.95rem !important; font-weight: 800; margin: 0 !important; }
.heb-byo .bundled_item_cart_details .stock { font-size: 0.8rem; margin: 0 !important; }
.heb-byo .bundled_item_cart_details .stock.in-stock { display: none; }
.heb-byo .woocommerce-variation-add-to-cart { flex: 0 0 auto; margin-left: auto !important; display: block !important; }

.heb-bb-qty { display: grid !important; grid-template-columns: 38px 44px 38px; align-items: center; border: 2px solid #6B645C; border-radius: var(--radius-btn); overflow: hidden; background: var(--card); }
.heb-bb-qty .qty { width: 100% !important; min-height: 38px; border: 0 !important; border-radius: 0 !important; text-align: center; font: 800 1rem var(--body); background: transparent; -moz-appearance: textfield; appearance: textfield; padding: 0 !important; margin: 0 !important; }
.heb-bb-qty .qty::-webkit-outer-spin-button, .heb-bb-qty .qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.heb-bb-qty__btn { min-height: 38px; border: 0; padding: 0; background: var(--oat); color: var(--ink); font: 800 1.25rem/1 var(--body); cursor: pointer; }
.heb-bb-qty__btn:hover:not(:disabled) { background: var(--gorse); }
.heb-bb-qty__btn:disabled { opacity: 0.4; cursor: not-allowed; }
.heb-byo .bundled_product.is-picked .heb-bb-qty { border-color: var(--ink); }

/* ---------- The panel ---------- */
.heb-byo__panel { position: sticky; top: 100px; display: flex !important; flex-direction: column; gap: 0.9rem; background: var(--paper); color: var(--ink); border: var(--line); border-radius: var(--radius); box-shadow: 8px 8px 0 var(--gorse); padding: 1.25rem; margin: 0 !important; box-sizing: border-box; scroll-margin-top: 90px; max-height: calc(100vh - 116px); overflow-y: auto; overscroll-behavior: contain; }
.heb-byo__panel > * { margin: 0 !important; }
.heb-bb-panel__head { order: 1; display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; flex-wrap: wrap; }
.heb-bb-panel__h { font-family: var(--display); text-transform: uppercase; font-size: 1.6rem; line-height: 1; margin: 0; }
.heb-bb-panel__h:focus { outline: none; }
.heb-bb-panel__count { margin: 0; font-weight: 700; font-size: 0.9rem; }
.heb-bb-list { order: 2; list-style: none; padding: 0 !important; display: flex; flex-direction: column; gap: 0.3rem; max-height: min(24vh, 220px); overflow-y: auto; }
.heb-byo__panel .bundle_wrap > .wcsatt-options-wrapper, .heb-byo__panel .bundle_wrap > .bundle_price, .heb-byo__panel .bundle_wrap > .heb-text-field { margin: 0 !important; }
.heb-byo__panel .heb-text-field label abbr { line-height: 1; }
.heb-bb-list__item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 0.45rem; background: var(--card); border: 1.5px solid #CFC5AE; border-radius: 4px; padding: 0.3rem 0.3rem 0.3rem 0.55rem; font-size: 0.92rem; }
.heb-bb-list__n { font-weight: 800; }
.heb-bb-list__name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.heb-bb-list__pack { font-size: 0.8rem; color: var(--muted); white-space: nowrap; }
.heb-bb-list__x { width: 32px; height: 32px; border: 0; border-radius: 4px; background: transparent; color: var(--ink); font: 800 1.15rem/1 var(--body); cursor: pointer; padding: 0; }
.heb-bb-list__x:hover { background: var(--oat); }
.heb-bb-list__none { color: var(--muted); font-size: 0.92rem; padding: 0.55rem 0.7rem; border: 2px dashed #8A8178; border-radius: 4px; background: var(--card); }

.heb-byo__panel .wcsatt-options-wrapper { order: 1; }
.heb-byo__panel .wcsatt-options-prompt-text, .heb-byo__panel .wcsatt-options-wrapper h3 { font-family: var(--body) !important; text-transform: none !important; font-size: 1rem !important; font-weight: 800 !important; margin: 0 0 0.45rem !important; }
.heb-byo__panel .wcsatt-options-product-prompt { margin: 0 !important; }
.heb-byo__panel .wcsatt-options-product-dropdown { width: 100%; }
.heb-byo__panel .heb-text-field, .heb-byo__panel #yith-wapo-container { order: 2; }
.heb-byo__panel .bundle_wrap > .bundle_price { order: 3; }
.heb-byo__panel .bundle_wrap > .bundle_error { order: 4; }
.heb-byo__panel .bundle_wrap > .heb-bb-total { order: 5; }
.heb-byo__panel .bundle_wrap > .bundle_availability { order: 6; }
.heb-byo__panel .bundle_wrap > .bundle_button { order: 7; }
.heb-byo__panel .bundle_wrap > .heb-postage-nudge, .heb-byo__panel .bundle_wrap > p:not(.heb-text-field):not(.heb-bb-total) { order: 8; }
/* With "How often" as a drop-down, the drop-down carries the real price per delivery. Product Bundles'
   own price line shows the price before the subscription discount, so it's swapped for that. */
.heb-byo__panel.heb-bb-often-priced .bundle_price { display: none !important; }
.heb-bb-total { margin: 0; font-size: 1.35rem; font-weight: 800; line-height: 1.2; border-top: 1.5px solid #CFC5AE; padding-top: 0.75rem !important; }
.heb-bb-total[hidden] { display: none; }
.heb-bb-total__save { display: block; font-size: 0.9rem; font-weight: 700; color: #3F6A1F; }
.heb-byo__panel .bundle_availability:empty, .heb-byo__panel .bundle_availability:not(:has(*)) { display: none; }
.heb-byo__panel .heb-text-field label { font-size: 0.95rem; line-height: 1.35 !important; margin-bottom: 0.4rem; }
.heb-byo__panel .heb-text-field textarea { min-height: 72px; }
.heb-byo__panel .bundle_wrap { order: 3; display: flex !important; flex-direction: column; gap: 0.8rem; border-top: 1.5px solid #CFC5AE; padding-top: 0.85rem !important; }
.heb-byo__panel .bundle_wrap > * { margin: 0 !important; }
.heb-byo__panel .bundle_price .price { font-size: 1.4rem !important; font-weight: 800; margin: 0 !important; }
.heb-byo__panel .bundle_price .price del { font-size: 0.95rem; font-weight: 600; opacity: 0.75; }
.heb-byo__panel .bundle_price .wcsatt-sub-discount, .heb-byo__panel .bundle_price .subscription-details { font-size: 0.95rem; }
.heb-byo__panel .bundle_error .wc-block-components-notice-banner { margin: 0; padding: 0.5rem 0.7rem; font-size: 0.9rem; }
.heb-byo__panel .bundle_error ul.msg { margin: 0; padding-left: 0; list-style: none; }
.heb-byo__panel .bundle_button { display: flex !important; gap: 0.6rem; align-items: stretch; }
.heb-byo__panel .bundle_button .quantity { display: none; }
.heb-byo__panel .bundle_button .single_add_to_cart_button { flex: 1 1 auto; width: 100%; min-height: 54px; background: var(--gorse); color: var(--ink); border: var(--line); box-shadow: var(--shadow); font-size: 1.1rem; font-weight: 800; }
.heb-byo__panel .bundle_button .single_add_to_cart_button.disabled { background: #D9D2C4; color: #4A4540; box-shadow: none; border-color: #8A8178; opacity: 1; }
.heb-byo__panel .heb-postage-nudge, .heb-byo__panel .heb-add__nudge { font-size: 0.85rem; }

/* ---------- Phone bar (hidden on wide screens, where the panel is always in view) ---------- */
.heb-bb-bar { display: none; }

@media (max-width: 1100px) {
	form.heb-byo { grid-template-columns: minmax(0, 1fr) 300px; gap: 1.25rem; }
	.heb-byo__teas { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
}
@media (max-width: 860px) {
	form.heb-byo { grid-template-columns: minmax(0, 1fr); }
	.heb-byo__panel { position: static; box-shadow: 6px 6px 0 var(--gorse); max-height: none; overflow: visible; }
	body.heb-bb-bar-on { padding-bottom: 72px; }
	.heb-bb-list { max-height: none; }
	.heb-bb-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 9991; display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.65rem var(--gutter, 1rem); background: var(--ink); color: var(--paper); box-shadow: 0 -6px 18px rgba(23, 21, 18, 0.25); }
	.heb-bb-bar[hidden] { display: none; }
	.heb-bb-bar__text { margin: 0; font-weight: 700; font-size: 0.95rem; }
	.heb-bb-bar__go { min-height: 44px; padding: 0 1.1rem; border: 2px solid var(--paper); border-radius: var(--radius-btn); background: var(--gorse); color: var(--ink); font: 800 1rem var(--body); cursor: pointer; flex: 0 0 auto; }
}
@media (max-width: 520px) {
	.heb-byo__teas { grid-template-columns: minmax(0, 1fr); gap: 0.6rem; }
	/* The heading above already says it: the per-tea question is kept for screen readers only. */
	.heb-bb-packs__label { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
	.heb-byo .bundled_item_cart_content { margin-top: 0.5rem !important; gap: 0.5rem; }
	.heb-byo .bundled_product { grid-template-columns: 56px minmax(0, 1fr); padding: 0.65rem; }
	.heb-byo .bundled_product_images, .heb-byo .bundled_product_images figure { width: 56px !important; }
	.heb-byo .bundled_product_images img { width: 56px; height: 56px; }
	.heb-bb-packs__group, .heb-bb-packs__group[data-n="3"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
	.heb-bb-packs__group[data-n="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.heb-bb-packs__btn { font-size: 0.8rem; padding: 0.25rem 0.2rem; }
}
@media (max-width: 360px) {
	.heb-bb-packs__group, .heb-bb-packs__group[data-n="3"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
	.heb-byo .bundled_product { transition: none; }
}
/* Keep Subscribe within reach in the sticky panel */
.heb-byo__panel .wcsatt-options-product-wrapper, .heb-byo__panel .wcsatt-options-product-prompt, .heb-byo__panel .wcsatt-options-wrapper > * { margin-top: 0 !important; margin-bottom: 0 !important; }
.heb-byo__panel .wcsatt-options-wrapper { padding: 0 !important; }
.heb-byo__panel .heb-text-field textarea { min-height: 56px !important; }
.heb-byo__panel .heb-text-field__hint { display: none; }

/* ---------- 1.2.18: the top of Build your own ---------- */
/* A smaller photo beside the title, the thumbnails on one line, and How it works in the space
   that was empty, so the teas start higher up. */
@media (min-width: 782px) {
	body.heb-byo-page .heb-product__top { display: grid !important; grid-template-columns: minmax(260px, 380px) minmax(0, 1fr); gap: 2.5rem 3.5rem !important; align-items: start; }
	body.heb-byo-page .heb-product__top > .wp-block-column { flex-basis: auto !important; width: auto !important; margin: 0 !important; min-width: 0; }
	body.heb-byo-page .heb-gallery, body.heb-byo-page .heb-product__media .woocommerce-product-gallery { position: static; }
}
body.heb-byo-page .heb-product__media .flex-control-thumbs { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0.4rem; }
body.heb-byo-page .heb-product__media .woocommerce-product-gallery:not(:has(.flex-control-thumbs)):has(.woocommerce-product-gallery__image:nth-child(6))::after { height: calc((100cqw - 2rem) / 6); }

/* Free postage: a plain line with a tick, no progress bar (there's nothing left to reach). */
.heb-nudge--sub { display: flex; align-items: center; gap: 0.5rem; padding: 0.55rem 0.8rem !important; background: #E5F0DA !important; border-color: var(--machair, #4F7F2A) !important; }
.heb-nudge--sub .heb-progress { display: none !important; }
.heb-nudge--sub .heb-nudge__msg { margin: 0 !important; font-weight: 800; color: #2f4f17; }
.heb-nudge--sub .heb-nudge__msg::before { content: "✓"; margin-right: 0.45rem; }

/* How it works */
.heb-byo-how { margin: 1.25rem 0 0; }
.heb-byo-how__steps { list-style: none; counter-reset: heb-step; margin: 0 0 1.1rem; padding: 0; display: grid; gap: 0.55rem; }
.heb-byo-how__steps li { counter-increment: heb-step; display: grid; grid-template-columns: 2rem minmax(0, 1fr); align-items: center; gap: 0.7rem; font-size: 1rem; line-height: 1.35; }
.heb-byo-how__steps li::before { content: counter(heb-step); width: 2rem; height: 2rem; border-radius: 50%; background: var(--gorse, #F4C430); border: 2px solid var(--ink, #171512); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 0.95rem; }
.heb-byo-how__go { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 50px; padding: 0 1.4rem; background: var(--ink, #171512); color: var(--paper, #F6F1E6) !important; border: var(--line, 2px solid #171512); border-radius: var(--radius-btn, 4px); font-weight: 800; font-size: 1.05rem; text-decoration: none !important; box-shadow: 4px 4px 0 var(--gorse, #F4C430); }
.heb-byo-how__go:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--gorse, #F4C430); }
.heb-byo-how__go:focus-visible { outline: 3px solid #1F6FA8; outline-offset: 3px; }
@media (max-width: 781px) {
	.heb-byo-how__go { width: 100%; justify-content: center; }
}
body.heb-byo-page .heb-byo-wrap { margin-top: clamp(1.75rem, 4vw, 2.5rem) !important; scroll-margin-top: 90px; }
.heb-nudge--sub { justify-content: flex-start; text-align: left; }
@media (max-width: 781px) {
	/* Phones: a smaller photo, so the title and How it works come sooner. */
	body.heb-byo-page .heb-product__media .woocommerce-product-gallery { max-width: 300px; margin-inline: auto !important; }
}
