/* Best Before theme - site-wide login/register modal (Gary, 16 Nov 2026).
   Base dialog chrome (.bb-dialog, ::backdrop, head/body padding, the
   <767px bottom-sheet rule) comes from assets/css/main.css - this file only
   adds what's specific to this modal. .bb-field/.bb-label/.bb-input/
   .bb-urgency are existing global tokens (main.css) - reused, not redefined. */

.bb-loginmodal { width: min(440px, 92vw); max-height: 90dvh; }
.bb-loginmodal__inner { display: flex; flex-direction: column; min-height: 0; }

.bb-dialog__head:has(.bb-loginmodal__tabs) { padding-bottom: 0; border-bottom: 0; }
.bb-loginmodal__tabs { display: flex; gap: 4px; }
.bb-loginmodal__tabs--single { margin: 0; font: 700 1.125rem/1 var(--bb-font-display); color: var(--bb-ink); }
.bb-loginmodal__tab { border: 0; background: none; padding: 10px 4px; margin-right: 18px; font: 700 1.0625rem/1 var(--bb-font-display); color: var(--bb-muted); cursor: pointer; border-bottom: 2px solid transparent; }
.bb-loginmodal__tab.is-active { color: var(--bb-ink); border-bottom-color: var(--bb-yellow); }
.bb-loginmodal__tab:focus-visible { outline: 2px solid var(--bb-ink); outline-offset: 2px; }

.bb-loginmodal__body { display: flex; flex-direction: column; overflow-y: auto; }
.bb-loginmodal__panel[hidden] { display: none; }
.bb-loginmodal__form { display: flex; flex-direction: column; }
.bb-loginmodal__form .bb-btn--block { margin-top: 4px; min-height: var(--bb-touch); }

.bb-loginmodal__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 0 16px; }
.bb-loginmodal__remember { display: flex; align-items: center; gap: 8px; font-size: .8125rem; font-weight: 500; color: var(--bb-body); cursor: pointer; }
.bb-loginmodal__remember input { margin: 0; }
.bb-loginmodal__lostpw { font-size: .8125rem; font-weight: 600; }

.bb-loginmodal__benefit { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; padding: 12px 14px; border-radius: var(--bb-r-tile); background: var(--bb-pale-yellow); font-size: .875rem; font-weight: 600; color: var(--bb-ink); }
.bb-loginmodal__benefitval { display: inline-flex; flex: none; align-items: center; justify-content: center; min-width: 40px; height: 26px; padding: 0 6px; border-radius: var(--bb-r-small); background: var(--bb-yellow); color: var(--bb-ink); font-weight: 800; }
.bb-loginmodal__hint { margin: 0 0 16px; font-size: .8125rem; color: var(--bb-muted); }
.bb-loginmodal__errors { margin: 0 0 16px; }

/* ---------- Newsletter opt-in checkbox (inc/pages/newsletter.php's
   woocommerce_register_form hook, same markup/class on every register form
   site-wide) + Woo's own register-panel notes (privacy-policy text, the
   "A link to set a new password…" paragraph). Gary found zero gap above the
   privacy text here (16 Nov 2026) because assets/css/pages/auth.css - which
   has the real fix - only loads on the My Account page, not this modal.
   Duplicated verbatim (light-panel colours swapped in) rather than
   restructured into a shared file, to land the fix without touching that
   other area's CSS file; keep both copies in sync if either changes. ---------- */
.bb-authgate__optin { display: grid; grid-template-columns: 20px minmax(0, 1fr); column-gap: 12px; align-items: start; margin: 16px 0; font-size: .875rem; line-height: 1.5; color: var(--bb-body); }
.bb-authgate__optin input { width: 20px; height: 20px; margin: 0; margin-top: calc((1.5em - 20px) / 2); flex: none; }
.woocommerce-form-register > p:not(.form-row):not(:has(button)),
.woocommerce-form-register .woocommerce-privacy-policy-text p { margin: 12px 0; font-size: .875rem; line-height: 1.5; color: var(--bb-muted); }

@media (max-width: 480px) {
	.bb-loginmodal__tab { margin-right: 14px; font-size: 1rem; }
}

/* ---------- Desktop header account control (Gary, 16 Nov 2026: "cannot see
   anywhere in the header to log in or sign up") - template-parts/global/
   header.php, next to the basket button. Hidden on the same breakpoint the
   mobile-only account icon (.bb-header__account, main.css) switches ON, so
   the two never show together. Tooltip is the existing site-wide
   [data-bbt-tip] mechanism (assets/css/card-interactions.css) - no new CSS
   needed for that part. ---------- */
.bb-header__acctctrl { display: flex; align-items: center; }
@media (max-width: 767px) {
	.bb-header__acctctrl { display: none; }
}
.bb-header__acctguest,
.bb-header__acctsummary {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 6px 4px;
	color: var(--bb-ink);
	cursor: pointer;
	list-style: none;
}
.bb-header__acctsummary::-webkit-details-marker { display: none; }
.bb-header__accticon,
.bb-header__acctsummary svg { flex: none; color: var(--bb-ink); }
.bb-header__accttext { display: flex; flex-direction: column; line-height: 1.25; text-align: left; }
.bb-header__acctgreet { font-size: .6875rem; color: var(--bb-muted); }
.bb-header__acctlink { font-size: .8125rem; font-weight: 700; color: var(--bb-ink); }
.bb-header__acctguest .bb-header__acctlink { display: flex; align-items: center; gap: 4px; }
.bb-header__acctbtn { border: 0; background: none; padding: 0; margin: 0; font: inherit; font-weight: 700; color: var(--bb-ink); cursor: pointer; text-decoration: none; }
.bb-header__acctbtn:hover, .bb-header__acctbtn:focus-visible { text-decoration: underline; }

.bb-header__acctmenu { position: relative; }
.bb-header__acctdropdown {
	position: absolute;
	top: calc(100% + 8px);
	right: 0;
	z-index: 20;
	display: flex;
	flex-direction: column;
	min-width: 180px;
	padding: 8px;
	background: var(--bb-surface);
	border: 1px solid var(--bb-border);
	border-radius: var(--bb-r-panel);
	box-shadow: 0 12px 28px rgba(0, 0, 0, .12);
}
.bb-header__acctdropdown a { padding: 9px 10px; border-radius: var(--bb-r-small); font-size: .875rem; font-weight: 600; color: var(--bb-ink); text-decoration: none; }
.bb-header__acctdropdown a:hover { background: var(--bb-ground); }

/* ---------- Mobile drawer "Log in / Register" line (template-parts/global/
   drawer.php - one line only, this theme's own entry point into the modal
   above; the drawer's own structural CSS stays in that area's catdrawer.css,
   untouched). ---------- */
.bb-catdrawer__login { margin: 12px 0 0; padding-top: 12px; border-top: 1px solid var(--bb-border); text-align: center; }
.bb-catdrawer__login a { font-weight: 700; color: var(--bb-ink); }
