/* Best Before Shopping Lists (bb-lists 1.0.0). Concept B tokens from bb-theme
   (--bb-*), with fallbacks so the plugin still reads if the theme changes. */

.bbl-icon { flex: none; }
.bb-btn .bbl-icon { margin-right: 6px; }
.bbl-save-cart { display: inline-flex; align-items: center; }

.bbl-linkbtn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 44px;
	padding: 0 4px;
	border: 0;
	background: none;
	color: var(--bb-ink, #111);
	font: inherit;
	font-weight: 700;
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}
.bbl-linkbtn--danger { color: var(--bb-error, #b00020); }
.bbl-minicart { margin: 8px 0 0; }

/* Heart menu: "Add to a list" button beside the wishlist heart (QA R1 D-05:
   it used to be a 24 px badge on the heart's lower-right edge, covering it).
   Now a full-size round button with an 8 px gap: stacked under the heart on
   grid cards (image corner), side by side everywhere else. 44 px targets. */
.bbl-has-caret { display: inline-flex; align-items: center; gap: 8px; }
.bb-card:not(.bb-card--row) .bbl-has-caret { flex-direction: column; }
.bbl-caret {
	position: relative;
	z-index: 2;
	display: inline-grid;
	flex: none;
	place-items: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 1.5px solid var(--bb-border-2, #d6d3cc);
	border-radius: 50%;
	background: var(--bb-surface, #fff);
	color: var(--bb-ink, #111);
	cursor: pointer;
}
.bbl-caret::before { content: ""; position: absolute; inset: -2px; } /* 44px touch target */
@media (pointer: coarse) { .bbl-caret { width: 44px; height: 44px; } .bbl-caret::before { inset: 0; } }
.bbl-caret:hover { border-color: var(--bb-ink, #111); }
.bbl-caret:focus-visible { outline: 3px solid var(--bb-ink, #111); outline-offset: 2px; }

/* Sheet dialog. */
.bbl-sheet {
	width: min(440px, calc(100vw - 24px));
	max-height: calc(100dvh - 24px);
	padding: 16px;
	border: 0;
	border-radius: var(--bb-r-panel, 20px);
	background: var(--bb-surface, #fff);
	color: var(--bb-ink, #111);
	box-shadow: var(--bb-shadow, 0 10px 30px rgba(0,0,0,.2));
}
.bbl-sheet::backdrop { background: rgba(0, 0, 0, .55); }
.bbl-sheet__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.bbl-sheet__title { margin: 0; font-family: var(--bb-font-display, inherit); font-size: 1.25rem; }
.bbl-sheet__close {
	display: inline-grid;
	place-items: center;
	width: 44px;
	height: 44px;
	border: 1px solid var(--bb-border-2, #d6d3cc);
	border-radius: 50%;
	background: var(--bb-surface, #fff);
	color: var(--bb-ink, #111);
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
}
.bbl-sheet__product { margin: 0 0 12px; color: var(--bb-muted, #555); font-size: .9375rem; }

.bbl-pick { display: grid; gap: 8px; margin: 0 0 20px; padding: 0; list-style: none; }
.bbl-pick__btn {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	width: 100%;
	min-height: 52px;
	padding: 0 16px;
	border: 1px solid var(--bb-border-2, #d6d3cc);
	border-radius: var(--bb-r-control, 12px);
	background: var(--bb-surface, #fff);
	color: var(--bb-ink, #111);
	font: inherit;
	font-weight: 700;
	text-align: left;
	cursor: pointer;
}
.bbl-pick__btn:hover { border-color: var(--bb-ink, #111); background: var(--bb-soft-yellow, #fff7cc); }
.bbl-pick__btn:focus-visible { outline: 3px solid var(--bb-ink, #111); outline-offset: 2px; }
.bbl-pick__count { flex: none; color: var(--bb-muted, #555); font-weight: 500; font-size: .875rem; }

.bbl-form label { display: block; margin-bottom: 6px; font-size: .875rem; font-weight: 600; }
.bbl-form__row { display: flex; gap: 8px; }
.bbl-form__row input {
	flex: 1;
	min-width: 0;
	min-height: 48px;
	padding: 0 12px;
	border: 1px solid var(--bb-border-2, #d6d3cc);
	border-radius: var(--bb-r-control, 12px);
	font-size: 1rem;
}
.bbl-form__row .bb-btn { min-height: 48px; }
.bbl-form__error { margin: 8px 0 0; color: var(--bb-error, #b00020); font-weight: 600; }
.bbl-form__error[hidden] { display: none; }

/* My Account > Lists and the shared page. */
.bbl-app, .bbl-panel { display: grid; gap: 16px; }
.bbl-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.bbl-head__title { margin: 0; font-family: var(--bb-font-display, inherit); font-size: 1.375rem; word-break: break-word; }
.bbl-head__count { color: var(--bb-muted, #555); font-size: .875rem; }
.bbl-empty, .bbl-loading { margin: 0; color: var(--bb-muted, #555); }
.bbl-back { margin: 0; }
.bbl-back a { color: var(--bb-ink, #111); font-weight: 700; }

.bbl-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.bbl-card {
	display: grid;
	gap: 4px;
	min-height: 72px;
	padding: 14px 16px;
	border: 1px solid var(--bb-border, #e6e3dc);
	border-radius: var(--bb-r-card, 16px);
	background: var(--bb-surface, #fff);
	color: var(--bb-ink, #111);
	text-decoration: none;
}
.bbl-card:hover { border-color: var(--bb-ink, #111); }
.bbl-card:focus-visible { outline: 3px solid var(--bb-ink, #111); outline-offset: 2px; }
.bbl-card__name { font-weight: 800; font-size: 1.0625rem; word-break: break-word; }
.bbl-card__meta { color: var(--bb-muted, #555); font-size: .875rem; }

.bbl-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.bbl-toolbar .bb-btn { min-height: 48px; }
.bbl-count { margin: 0; flex: 1; font-weight: 600; }
.bbl-status { margin: 0; padding: 12px 14px; border-radius: var(--bb-r-control, 12px); background: var(--bb-soft-yellow, #fff7cc); font-size: .9375rem; }
.bbl-status[hidden], .bbl-sharebox[hidden] { display: none; }
.bbl-sharebox { padding: 14px; border: 1px dashed var(--bb-border-2, #d6d3cc); border-radius: var(--bb-r-control, 12px); }
.bbl-sharebox label { display: block; margin-bottom: 6px; font-weight: 700; }
.bbl-sharebox__hint { margin: 8px 0 0; color: var(--bb-muted, #555); font-size: .875rem; }

.bbl-items { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.bbl-item {
	display: grid;
	grid-template-columns: 64px 1fr auto auto;
	align-items: center;
	gap: 12px;
	padding: 12px 0;
	border-top: 1px solid var(--bb-border, #e6e3dc);
}
.bbl-item:first-child { border-top: 0; }
.bbl-item.is-soldout .bbl-item__img, .bbl-item.is-soldout .bbl-item__name { opacity: .55; }
.bbl-item__img { display: block; width: 64px; height: 64px; border-radius: var(--bb-r-small, 10px); background: var(--bb-ground, #f6f4ef); overflow: hidden; }
.bbl-item__img img { width: 100%; height: 100%; object-fit: contain; }
.bbl-item__info { display: grid; gap: 2px; min-width: 0; }
.bbl-item__name { color: var(--bb-ink, #111); font-weight: 700; text-decoration: none; word-break: break-word; }
.bbl-item__name:hover { text-decoration: underline; }
.bbl-item__price { font-weight: 700; }
.bbl-item__note { color: var(--bb-error, #b00020); font-size: .8125rem; font-weight: 700; }
.bbl-item__note--low { color: var(--bb-urgency, #c8202e); }
.bbl-item__qty { font-weight: 700; }
.bbl-qty { display: inline-flex; align-items: center; border: 1px solid var(--bb-border-2, #d6d3cc); border-radius: var(--bb-r-pill, 999px); }
.bbl-qty__btn { width: 40px; height: 40px; border: 0; background: none; color: var(--bb-ink, #111); font-size: 1.25rem; font-weight: 700; cursor: pointer; }
.bbl-qty__btn:focus-visible { outline: 3px solid var(--bb-ink, #111); outline-offset: -3px; border-radius: 50%; }
.bbl-qty__val { min-width: 24px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.bbl-item__remove { width: 44px; height: 44px; border: 0; border-radius: 50%; background: none; color: var(--bb-muted, #555); font-size: 1.5rem; cursor: pointer; }
.bbl-item__remove:hover { background: var(--bb-ground, #f6f4ef); color: var(--bb-ink, #111); }

.bbl-shared .bb-pagehead { margin-bottom: 16px; }
.bbl-shared .bbl-item { grid-template-columns: 64px 1fr auto; }
.bbl-thankyou { display: grid; gap: 10px; }
.bbl-thankyou p { margin: 0; }
.bbl-vieworder { margin: 16px 0; }

@media (max-width: 560px) {
	.bbl-item { grid-template-columns: 56px 1fr auto; }
	.bbl-item__img { width: 56px; height: 56px; }
	.bbl-app .bbl-item { grid-template-areas: "img info remove" "img qty qty"; row-gap: 8px; }
	.bbl-app .bbl-item__img { grid-area: img; align-self: start; }
	.bbl-app .bbl-item__info { grid-area: info; }
	.bbl-app .bbl-qty { grid-area: qty; justify-self: start; }
	.bbl-app .bbl-item__remove { grid-area: remove; }
	.bbl-toolbar .bb-btn--primary { width: 100%; }
	.bbl-form__row { flex-wrap: wrap; }
	.bbl-form__row input { flex: 1 1 100%; }
	.bbl-form__row .bb-btn { flex: 1 1 100%; }
}

/* My Account > Orders: the extra "Save as list" action must wrap, not push the row wider than the screen. */
body.woocommerce-account .woocommerce-orders-table .woocommerce-orders-table__cell-order-actions { white-space: normal; flex-wrap: wrap; gap: 8px; }
body.woocommerce-account .woocommerce-orders-table .woocommerce-orders-table__cell-order-actions a { margin: 4px 0 0 6px; }
@media (max-width: 767px) { body.woocommerce-account .woocommerce-orders-table .woocommerce-orders-table__cell-order-actions a { margin: 0; } }
