/*
 * BoberStore consent banner — STRUCTURAL styles only.
 *
 * Layout, stacking and legibility live here so the banner is usable with no
 * theme at all; brand styling (colour, type, radii, motion curve) is the
 * theme's job — happymonday/assets/consent.css. Same split as the account
 * block + theme commerce.css.
 *
 * Two structural rules are load-bearing rather than cosmetic:
 *
 *   - Accept and Reject share one row and one size. Making refusal smaller or
 *     harder to hit is the failure mode this whole layer exists to prevent, and
 *     a theme override that reintroduces it is a compliance bug, not a taste
 *     one.
 *   - z-index 150: above the theme's floating add-to-cart pill (50), below the
 *     cart scrim and drawer (200/201). Both the pill and the banner stay
 *     visible — the pill lifts itself by --hm-consent-h, which banner.js keeps
 *     current.
 */

/* ========================================================== first layer */

.bs-consent {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 150;
	box-sizing: border-box;
	padding: 1rem;
	background: #fff;
	color: #000;
	border-top: 1px solid rgba(0, 0, 0, 0.15);
	font-size: 0.95rem;
	line-height: 1.5;
}

.bs-consent[hidden] {
	display: none;
}

.bs-consent *,
.bs-consent-dialog * {
	box-sizing: border-box;
}

.bs-consent__inner {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	align-items: center;
	justify-content: space-between;
	max-width: 68rem;
	margin: 0 auto;
}

.bs-consent__copy {
	flex: 1 1 22rem;
	min-width: 0;
}

.bs-consent__heading {
	margin: 0 0 0.25rem;
	font-size: 1.05rem;
	line-height: 1.2;
}

.bs-consent__body {
	margin: 0;
}

.bs-consent__policy {
	margin: 0.4rem 0 0;
	font-size: 0.85rem;
}

.bs-consent__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
}

/* Accept and Reject: same box, same row. Do not specialise one of them. */
.bs-consent__btn {
	flex: 0 0 auto;
	display: inline-block;
	padding: 0.7rem 1.4rem;
	border: 1px solid currentColor;
	background: transparent;
	color: inherit;
	font: inherit;
	line-height: 1.2;
	cursor: pointer;
	text-align: center;
}

.bs-consent__btn--primary {
	background: #000;
	color: #fff;
}

.bs-consent__link {
	padding: 0.7rem 0.4rem;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	text-decoration: underline;
	cursor: pointer;
}

.bs-consent__btn:focus-visible,
.bs-consent__link:focus-visible,
.bs-consent-open:focus-visible,
.bs-consent-dialog button:focus-visible,
.bs-consent-dialog summary:focus-visible,
.bs-consent-dialog input:focus-visible {
	outline: 3px solid currentColor;
	outline-offset: 2px;
}

@media (max-width: 640px) {
	.bs-consent__inner {
		align-items: stretch;
	}

	.bs-consent__actions {
		width: 100%;
	}

	.bs-consent__btn {
		flex: 1 1 10rem;
	}
}

/* ============================================================== dialog */

.bs-consent-dialog {
	width: min(46rem, calc(100vw - 2rem));
	max-height: min(80vh, 46rem);
	padding: 0;
	border: 0;
	color: #000;
	background: #fff;
}

.bs-consent-dialog::backdrop {
	background: rgba(0, 0, 0, 0.45);
}

/* Fallback for browsers without <dialog>: banner.js sets [open] directly. */
.bs-consent-dialog:not([open]) {
	display: none;
}

.bs-consent-dialog__inner {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	max-height: inherit;
	padding: 1.25rem;
	overflow: auto;
}

.bs-consent-dialog__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem;
}

.bs-consent-dialog__title {
	margin: 0;
	font-size: 1.2rem;
}

.bs-consent-dialog__close {
	border: 0;
	background: none;
	color: inherit;
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
	padding: 0.2rem 0.4rem;
}

.bs-consent-dialog__intro {
	margin: 0;
	font-size: 0.9rem;
}

.bs-consent-dialog__body {
	display: flex;
	flex-direction: column;
	gap: 0.9rem;
}

.bs-consent-dialog__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	padding-top: 0.25rem;
}

/* ---------------------------------------------------------- categories */

.bs-consent-cat {
	padding: 0.75rem 0 0;
	border-top: 1px solid rgba(0, 0, 0, 0.12);
}

.bs-consent-cat:first-child {
	border-top: 0;
	padding-top: 0;
}

.bs-consent-cat__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
}

.bs-consent-cat__toggle {
	display: inline-flex;
	align-items: center;
	gap: 0.55rem;
	cursor: pointer;
}

.bs-consent-cat__input {
	width: 1.15rem;
	height: 1.15rem;
	flex: 0 0 auto;
	margin: 0;
}

.bs-consent-cat__input:disabled {
	cursor: not-allowed;
}

.bs-consent-cat__name {
	font-weight: 700;
}

.bs-consent-cat__always {
	font-size: 0.8rem;
	opacity: 0.7;
}

.bs-consent-cat__desc {
	margin: 0.35rem 0 0;
	font-size: 0.9rem;
}

/* ------------------------------------------------------------- vendors */

.bs-consent-vendor {
	margin-top: 0.5rem;
	font-size: 0.88rem;
}

.bs-consent-vendor__summary {
	cursor: pointer;
	padding: 0.25rem 0;
}

.bs-consent-vendor__facts {
	display: grid;
	grid-template-columns: minmax(7rem, max-content) 1fr;
	gap: 0.15rem 0.75rem;
	margin: 0.25rem 0 0.5rem;
}

.bs-consent-vendor__facts dt {
	font-weight: 700;
}

.bs-consent-vendor__facts dd {
	margin: 0;
	min-width: 0;
	overflow-wrap: anywhere;
}

.bs-consent-cookies {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.82rem;
	/* Long cookie tables must scroll inside the dialog, never widen the page. */
	display: block;
	overflow-x: auto;
}

.bs-consent-cookies th,
.bs-consent-cookies td {
	padding: 0.3rem 0.5rem;
	text-align: left;
	vertical-align: top;
	border-top: 1px solid rgba(0, 0, 0, 0.1);
}

/* --------------------------------------------------- withdrawal control */

.bs-consent-open {
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	padding: 0;
	text-decoration: underline;
	cursor: pointer;
}
