/*
 * BS Handmade Pledge — styles for every surface.
 *
 * Scope:
 *  - Dashboard pledge section (signed / re-sign / unsigned card states)
 *  - Inline pledge preview
 *  - Product-edit checkbox (Dokan frontend + WC admin)
 *  - Buyer badges in three sizes: storefront, product, card
 *  - Shared modal (sign / view / revoke / accountability)
 *  - Buttons + status pills
 *
 * Colour palette is exposed as CSS custom properties on .bs-pledge-* roots
 * so Jessie can override site-wide from the global stylesheet without
 * touching this file.
 */

/* -------------------------------------------------------------------------
 * CSS variables (warm clay + parchment — intentionally subdued so the
 * badge reads as "earned" rather than "promotional")
 * ------------------------------------------------------------------------- */
.bs-pledge-badge,
.bs-pledge-modal,
.bs-pledge-dashboard,
.bs-pledge-product-field {
	--bs-pledge-color:        #7a3f1d;
	--bs-pledge-color-soft:   #a05a2c;
	--bs-pledge-bg:           #f4ebe0;
	--bs-pledge-bg-strong:    #ead7c0;
	--bs-pledge-border:       #c9a07a;
	--bs-pledge-ink:          #2a1f18;
	--bs-pledge-muted:        #6c5849;
	--bs-pledge-success:      #2f6f3a;
	--bs-pledge-warn:         #a86a00;
	--bs-pledge-danger:       #9a2b2b;
	--bs-pledge-radius:       6px;
	--bs-pledge-radius-pill:  999px;
	--bs-pledge-shadow:       0 1px 0 rgba(42, 31, 24, 0.05);
	--bs-pledge-shadow-modal: 0 24px 60px rgba(42, 31, 24, 0.25);
}

/* -------------------------------------------------------------------------
 * Buyer-facing badges — compact pill style, mirrors the Founding Seller
 * badge so the seller info area reads as a single consistent set of
 * marketplace markers rather than a competition for attention.
 * ------------------------------------------------------------------------- */
.bs-pledge-badge-wrap {
	display: block;
	margin: 8px 0 0;
}

/* Inside the .dokan-vendor-info-wrap on single product pages — used only
   for the FALLBACK path (no founder badge present). Mirrors the founder
   wrap's full-row dedicated layout so the pledge takes its own row below
   the vendor image / info / view-store-btn row. */
.dokan-vendor-info-wrap > .bs-pledge-badge-wrap--single {
	flex-basis: 100%;
	width: 100%;
	margin: 8px 0 0;
	order: 99;
}

/* As a sibling of .elementor-widget-dokan-store-name on Dokan storefronts —
   FALLBACK path when no founder wrap is present. */
.bs-pledge-badge-wrap--store-header {
	margin: 6px 0 10px;
	text-align: center;
}

/* -------------------------------------------------------------------------
 * Co-presence layout: when the pledge badge has been injected directly
 * as a child of a Founding Seller wrap (the preferred path in badge.js),
 * lay the two badges out side-by-side inside that wrap.
 *
 *   Single product page: founder wrap is `display: block` by default
 *   and already takes its own dedicated row (flex-basis: 100%, order:
 *   99) inside .dokan-vendor-info-wrap. Switch it to a flex-row so
 *   founder + pledge sit side-by-side within that row.
 *
 *   Storefront: founder wrap is already `display: flex; justify-content:
 *   center` from bs-founding-seller. Just need a gap between children.
 *
 * Both rules are scoped via :has() to fire only when our pledge badge
 * is actually inside the founder wrap — so founder's standalone layout
 * is unchanged when only the founder badge is present.
 * ------------------------------------------------------------------------- */

.bs-founding-badge-wrap--single:has(> .bs-pledge-badge) {
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}

.bs-founding-badge-wrap--store-header:has(> .bs-pledge-badge) {
	gap: 8px;
}

.bs-founding-badge-wrap--single > .bs-pledge-badge,
.bs-founding-badge-wrap--store-header > .bs-pledge-badge {
	margin: 0;
}

.bs-pledge-badge {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 3px 9px;
	background: var(--bs-pledge-bg);
	border: 1px solid var(--bs-pledge-border);
	border-radius: var(--bs-pledge-radius-pill);
	color: var(--bs-pledge-color);
	font-family: inherit;
	font-size: 11px;
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: 0.02em;
	cursor: pointer;
	white-space: nowrap;
	box-shadow: none;
	transition: border-color 0.15s ease, color 0.15s ease;
	vertical-align: middle;
}

.bs-pledge-badge:hover,
.bs-pledge-badge:focus-visible {
	border-color: var(--bs-pledge-color-soft);
	color: var(--bs-pledge-ink);
	outline: none;
}

.bs-pledge-badge:focus-visible {
	box-shadow: 0 0 0 2px rgba(160, 90, 44, 0.25);
}

.bs-pledge-badge__icon {
	display: inline-block;
	width: 12px;
	height: 12px;
	flex-shrink: 0;
	background-repeat: no-repeat;
	background-position: center;
	background-size: contain;
	background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' fill='none' stroke='%237a3f1d' stroke-linecap='round' stroke-linejoin='round'%3E%3Cg transform='translate(-1 2.25)'%3E%3Cpath d='M16 24 C 16 24, 5 17, 4 11 C 3.5 7.5, 6.5 5, 10 5.5 C 12.5 6, 14.5 8, 16 9.5 C 17.5 8, 19.5 6, 22 5.5 C 25.5 5, 28.5 7.5, 28 11 C 27 17, 16 24, 16 24 Z' stroke-width='1.7' stroke-dasharray='2.2 1.6'/%3E%3Cline x1='28' y1='4' x2='8' y2='20' stroke-width='1.5' stroke-linecap='butt'/%3E%3Cpath d='M 7.53 19.41 L 8.47 20.59 L 5.66 21.88 Z' fill='%237a3f1d' stroke='none'/%3E%3Cellipse cx='25.5' cy='5.6' rx='1.9' ry='0.8' transform='rotate(-39 25.5 5.6)' stroke-width='1.3'/%3E%3Cpath d='M28.5 4.5 C 30.5 3.5, 31 6, 29.5 7.5 C 28 9, 30.5 11, 28.5 11' stroke-width='1.4'/%3E%3C/g%3E%3C/svg%3E");
}

.bs-pledge-badge__label {
	display: inline-block;
}

/* Variant modifiers now only adjust margin / interaction, not size.
   All three buyer surfaces present the same compact pill. */
.bs-pledge-badge--storefront,
.bs-pledge-badge--product {
	margin: 4px 0;
	padding: 6px 14px;
	font-size: 13px;
	font-weight: 400;
	gap: 8px;
}

.bs-pledge-badge--storefront .bs-pledge-badge__icon,
.bs-pledge-badge--product .bs-pledge-badge__icon {
	width: 20px;
	height: 20px;
}

.bs-pledge-badge--inline {
	cursor: default;
	pointer-events: none;
}

/* -------------------------------------------------------------------------
 * Card variant — icon-only badge, JS-repositioned to overlay the product
 * image so it doesn't add vertical height to the card.
 *
 * Mirrors bs-founding-seller's .bs-founding-badge--icon pattern. Both the
 * founder badge and this pledge badge are placed into one shared top-LEFT
 * vertical stack (.bs-badge-stack); founder sits above (order 10), pledge
 * below (order 20), keeping the product image's top-right corner clear for
 * WoodMart's wishlist / compare buttons.
 *
 * Pre-reposition, the icon sits in the card body (where the WC hook fired
 * it). Post-reposition (badge.js → repositionCardIcons), it becomes an
 * absolute overlay inside .wd-product-thumb.
 * ------------------------------------------------------------------------- */
.bs-pledge-badge--card {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 18px;
	height: 18px;
	padding: 2px;
	gap: 0;
	font-size: 0;
	background: var(--bs-pledge-bg);
	border: 1px solid var(--bs-pledge-border);
	border-radius: 50%;
	box-sizing: border-box;
	cursor: pointer;
}

.bs-pledge-badge--card .bs-pledge-badge__icon {
	width: 100%;
	height: 100%;
}

/* Positioning context for the fallback overlay (used only if the shared
   badge stack helper is unavailable). */
.wd-product-thumb,
.product-image-link {
	position: relative;
}

/* Preferred path: the pledge card badge is placed by badge.js into the
   shared `.bs-badge-stack` (owned by bs-badge-stack), anchored top-LEFT of
   the product image. Here it's a static flex child; the stack owns position.
   order: 20 keeps it BELOW the Founding Seller badge (order 10) and above any
   future badge, regardless of which plugin's JS runs first. */
.bs-badge-stack > .bs-pledge-badge--card {
	position: static;
	order: 20;
	width: 32px;
	height: 32px;
	padding: 6px;
	margin: 0;
	background: var(--bs-pledge-bg);
	border: 1px solid var(--bs-pledge-border);
	border-radius: 50%;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
	box-sizing: border-box;
}

.bs-badge-stack > .bs-pledge-badge--card .bs-pledge-badge__icon {
	width: 100%;
	height: 100%;
}

/* Fallback path: stack helper absent — keep the original direct-child
   top-left overlay. Mutually exclusive with the stack rule above by DOM
   structure (a stacked badge is not a direct child of the thumb). */
.wd-product-thumb > .bs-pledge-badge--card,
.product-image-link > .bs-pledge-badge--card {
	position: absolute;
	top: 8px;
	left: 8px;
	z-index: 10;
	width: 32px;
	height: 32px;
	padding: 6px;
	margin: 0;
	background: var(--bs-pledge-bg);
	border: 1px solid var(--bs-pledge-border);
	border-radius: 50%;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
	box-sizing: border-box;
}

.wd-product-thumb > .bs-pledge-badge--card .bs-pledge-badge__icon,
.product-image-link > .bs-pledge-badge--card .bs-pledge-badge__icon {
	width: 100%;
	height: 100%;
}

/* Responsive: shrink the card overlay badge on small viewports to match the
   founder badge sizing inside the stack. */
@media (max-width: 575px) {
	.bs-badge-stack > .bs-pledge-badge--card,
	.wd-product-thumb > .bs-pledge-badge--card,
	.product-image-link > .bs-pledge-badge--card {
		width: 26px;
		height: 26px;
		padding: 5px;
	}
}

/* Screen-reader-only text — the accessible "Handmade Pledge" label that
   the icon variant uses since there's no visible text. */
.bs-pledge-badge .screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	-webkit-clip-path: inset(50%);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal !important;
}

/* -------------------------------------------------------------------------
 * Shared modal
 * ------------------------------------------------------------------------- */
.bs-pledge-modal {
	position: fixed;
	inset: 0;
	z-index: 100050;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	box-sizing: border-box;
}

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

.bs-pledge-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(20, 14, 10, 0.55);
	cursor: pointer;
}

.bs-pledge-modal__panel {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 560px;
	max-height: calc(100vh - 48px);
	background: #fffdf9;
	border: 1px solid var(--bs-pledge-border);
	border-radius: var(--bs-pledge-radius);
	box-shadow: var(--bs-pledge-shadow-modal);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	color: var(--bs-pledge-ink);
}

.bs-pledge-modal__close {
	position: absolute !important;
	top: 8px !important;
	right: 12px !important;
	left: auto !important;
	bottom: auto !important;
	width: 32px !important;
	height: 32px !important;
	padding: 0 !important;
	margin: 0 !important;
	font-size: 22px !important;
	line-height: 1 !important;
	background: transparent !important;
	border: none !important;
	color: var(--bs-pledge-muted) !important;
	cursor: pointer;
	border-radius: 50%;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
}

.bs-pledge-modal__close:hover,
.bs-pledge-modal__close:focus-visible {
	background: var(--bs-pledge-bg) !important;
	color: var(--bs-pledge-ink) !important;
	outline: none;
}

.bs-pledge-modal__header {
	padding: 24px 28px 12px;
	border-bottom: 1px solid var(--bs-pledge-bg-strong);
}

.bs-pledge-modal__title {
	margin: 0 0 4px;
	font-size: 20px;
	line-height: 1.3;
	font-weight: 700;
	color: var(--bs-pledge-color);
}

.bs-pledge-modal__signature {
	margin: 6px 0 0;
	font-size: 13px;
	color: var(--bs-pledge-muted);
}

.bs-pledge-modal__signature strong {
	color: var(--bs-pledge-ink);
	font-weight: 600;
}

.bs-pledge-modal__body {
	padding: 20px 28px;
	overflow-y: auto;
	flex: 1 1 auto;
}

.bs-pledge-modal__body h2,
.bs-pledge-modal__body h3 {
	margin: 0 0 8px;
	font-size: 16px;
	color: var(--bs-pledge-color);
}

.bs-pledge-modal__body p,
.bs-pledge-modal__body li {
	font-size: 14px;
	line-height: 1.55;
	color: var(--bs-pledge-ink);
}

.bs-pledge-modal__body ol.bs-pledge-points {
	margin: 0 0 12px 0;
	padding-left: 22px;
}

.bs-pledge-modal__body ol.bs-pledge-points li {
	margin: 0 0 10px;
}

.bs-pledge-modal__footer {
	padding: 14px 24px 18px;
	border-top: 1px solid var(--bs-pledge-bg-strong);
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
}

.bs-pledge-modal__explainer {
	color: var(--bs-pledge-color);
	text-decoration: underline;
	text-decoration-color: var(--bs-pledge-border);
	font-size: 13px;
}

.bs-pledge-modal__explainer:hover,
.bs-pledge-modal__explainer:focus-visible {
	text-decoration-color: var(--bs-pledge-color);
}

/* -------------------------------------------------------------------------
 * Sign-mode form pieces inside the modal body
 * ------------------------------------------------------------------------- */
.bs-pledge-sign-form {
	display: block;
}

.bs-pledge-sign-form__intro {
	margin: 0 0 16px;
	font-size: 14px;
	color: var(--bs-pledge-ink);
}

.bs-pledge-sign-form__points {
	list-style: none;
	padding: 0;
	margin: 0 0 18px;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.bs-pledge-sign-form__point {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 12px;
	background: var(--bs-pledge-bg);
	border: 1px solid var(--bs-pledge-bg-strong);
	border-radius: var(--bs-pledge-radius);
	transition: border-color 0.15s ease, background 0.15s ease;
}

.bs-pledge-sign-form__point--checked {
	background: #fffdf9;
	border-color: var(--bs-pledge-border);
}

.bs-pledge-sign-form__point input[type="checkbox"] {
	margin: 4px 0 0;
	flex-shrink: 0;
}

.bs-pledge-sign-form__point-text {
	font-size: 14px;
	line-height: 1.5;
	color: var(--bs-pledge-ink);
}

.bs-pledge-sign-form__point-number {
	font-weight: 700;
	color: var(--bs-pledge-color);
	margin-right: 4px;
}

.bs-pledge-sign-form__name-field {
	margin: 0 0 14px;
}

.bs-pledge-sign-form__label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	color: var(--bs-pledge-ink);
	margin-bottom: 4px;
}

.bs-pledge-sign-form__input {
	width: 100%;
	max-width: 340px;
	padding: 8px 10px;
	font-size: 14px;
	font-family: inherit;
	color: var(--bs-pledge-ink);
	background: #fffdf9;
	border: 1px solid var(--bs-pledge-border);
	border-radius: 4px;
	box-sizing: border-box;
}

.bs-pledge-sign-form__input:focus {
	outline: 2px solid var(--bs-pledge-color-soft);
	outline-offset: 1px;
}

.bs-pledge-sign-form__hint {
	margin: 4px 0 0;
	font-size: 12px;
	color: var(--bs-pledge-muted);
}

.bs-pledge-sign-form__date {
	margin: 6px 0 0;
	font-size: 13px;
	color: var(--bs-pledge-ink);
}

.bs-pledge-sign-form__date strong {
	font-weight: 600;
}

.bs-pledge-sign-form__error {
	margin: 8px 0 0;
	padding: 10px 12px;
	font-size: 13px;
	background: #fbeae6;
	color: var(--bs-pledge-danger);
	border: 1px solid #e9b6ad;
	border-radius: 4px;
	display: none;
}

.bs-pledge-sign-form__error--visible {
	display: block;
}

/* -------------------------------------------------------------------------
 * Buttons
 * ------------------------------------------------------------------------- */
.bs-pledge-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 8px 16px;
	border: 1px solid transparent;
	border-radius: var(--bs-pledge-radius);
	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	background: transparent;
	color: var(--bs-pledge-ink);
	text-decoration: none;
	transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.bs-pledge-btn[disabled] {
	opacity: 0.55;
	cursor: not-allowed;
}

.bs-pledge-btn--primary {
	background: var(--bs-pledge-color);
	color: #fffdf9;
	border-color: var(--bs-pledge-color);
}

.bs-pledge-btn--primary:hover:not([disabled]),
.bs-pledge-btn--primary:focus-visible:not([disabled]) {
	background: var(--bs-pledge-color-soft);
	border-color: var(--bs-pledge-color-soft);
	outline: none;
}

.bs-pledge-btn--ghost {
	background: transparent;
	color: var(--bs-pledge-color);
	border-color: var(--bs-pledge-border);
}

.bs-pledge-btn--ghost:hover:not([disabled]),
.bs-pledge-btn--ghost:focus-visible:not([disabled]) {
	background: var(--bs-pledge-bg);
	color: var(--bs-pledge-ink);
	border-color: var(--bs-pledge-color);
	outline: none;
}

.bs-pledge-btn--danger {
	background: transparent;
	color: var(--bs-pledge-danger);
	border-color: #d6a39c;
}

.bs-pledge-btn--danger:hover:not([disabled]),
.bs-pledge-btn--danger:focus-visible:not([disabled]) {
	background: #fbeae6;
	border-color: var(--bs-pledge-danger);
	outline: none;
}

/* -------------------------------------------------------------------------
 * Dashboard section
 * ------------------------------------------------------------------------- */
.bs-pledge-dashboard__body {
	display: flex;
	flex-direction: column;
	gap: 24px;
	padding: 20px 0 32px;
}

.bs-pledge-card {
	background: #fffdf9;
	border: 1px solid var(--bs-pledge-bg-strong);
	border-radius: var(--bs-pledge-radius);
	padding: 20px 24px;
	display: grid;
	grid-template-columns: 1fr;
	gap: 14px;
}

.bs-pledge-card--signed {
	border-color: var(--bs-pledge-border);
	background: #fbf6ee;
}

.bs-pledge-card--resign {
	border-color: #e9c585;
	background: #fff7e6;
}

.bs-pledge-card__status {
	display: flex;
	align-items: center;
	gap: 10px;
}

.bs-pledge-card__title {
	margin: 0 0 6px;
	font-size: 18px;
	color: var(--bs-pledge-color);
	font-weight: 700;
}

.bs-pledge-card__meta p {
	margin: 0 0 8px;
	font-size: 14px;
	line-height: 1.55;
	color: var(--bs-pledge-ink);
}

.bs-pledge-card__hint {
	color: var(--bs-pledge-muted);
	font-size: 13px;
}

.bs-pledge-card__actions {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
}

.bs-pledge-status-pill {
	display: inline-flex;
	align-items: center;
	padding: 3px 10px;
	font-size: 12px;
	font-weight: 600;
	border-radius: var(--bs-pledge-radius-pill);
	letter-spacing: 0.03em;
}

.bs-pledge-status-pill--warn {
	background: #fff1d6;
	color: var(--bs-pledge-warn);
	border: 1px solid #e9c585;
}

/* Inline preview of the pledge text */
.bs-pledge-preview {
	background: #fffdf9;
	border: 1px solid var(--bs-pledge-bg-strong);
	border-radius: var(--bs-pledge-radius);
	padding: 20px 24px;
}

.bs-pledge-preview__title {
	margin: 0 0 12px;
	font-size: 16px;
	color: var(--bs-pledge-color);
	display: flex;
	align-items: baseline;
	gap: 10px;
	flex-wrap: wrap;
}

.bs-pledge-preview__version {
	font-size: 12px;
	color: var(--bs-pledge-muted);
	font-weight: 500;
}

.bs-pledge-preview__body h2.bs-pledge-heading {
	margin: 0 0 8px;
	font-size: 16px;
	color: var(--bs-pledge-color);
}

.bs-pledge-preview__body p,
.bs-pledge-preview__body li {
	font-size: 14px;
	line-height: 1.55;
	color: var(--bs-pledge-ink);
}

.bs-pledge-preview__body ol.bs-pledge-points {
	margin: 0;
	padding-left: 22px;
}

.bs-pledge-preview__body ol.bs-pledge-points li {
	margin: 0 0 10px;
}

/* -------------------------------------------------------------------------
 * Product-edit checkbox (Dokan frontend)
 * ------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------
 * Product edit checkbox — visually inherits Dokan's standard form-group
 * styling. We rely on .dokan-form-group, .form-label, and
 * .dokan-form-help-block from Dokan's own stylesheet so the field reads
 * as a native part of the form. Only the checkbox+label layout and the
 * muted hint colour need our own rules.
 * ------------------------------------------------------------------------- */
.bs-pledge-product-field {
	/* Inherits .dokan-form-group from Dokan — no surface treatment of our own. */
}

.bs-pledge-product-field__checkbox {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	cursor: pointer;
	font-size: 14px;
	color: var(--bs-pledge-ink);
	margin: 0;
}

.bs-pledge-product-field__checkbox input[type="checkbox"] {
	margin: 3px 0 0;
	flex-shrink: 0;
}

.bs-pledge-product-field__label {
	line-height: 1.4;
}

.bs-pledge-product-field__hint {
	display: block;
	margin: 6px 0 0 22px;
	color: var(--bs-pledge-muted);
}

/* -------------------------------------------------------------------------
 * WC admin product-edit checkbox row (lighter restyle so it sits inside
 * WC's options panel without looking out of place)
 * ------------------------------------------------------------------------- */
.bs-pledge-admin-options {
	padding: 9px 0;
}

.bs-pledge-admin-options__row label {
	display: inline-block;
	min-width: 200px;
	font-weight: 600;
}

.bs-pledge-admin-options__row .description {
	display: block;
	margin: 6px 0 0 200px;
	color: #5f5d56;
	font-size: 12px;
}

/* -------------------------------------------------------------------------
 * Responsive: tighten paddings on small screens
 * ------------------------------------------------------------------------- */
@media (max-width: 600px) {
	.bs-pledge-modal {
		padding: 12px;
	}
	.bs-pledge-modal__header,
	.bs-pledge-modal__body,
	.bs-pledge-modal__footer {
		padding-left: 18px;
		padding-right: 18px;
	}
	.bs-pledge-card,
	.bs-pledge-preview {
		padding: 16px;
	}
	.bs-pledge-card__actions {
		flex-direction: column;
		align-items: stretch;
	}
	.bs-pledge-btn {
		width: 100%;
	}
}

/* -------------------------------------------------------------------------
 * WoodMart override defenses (inside the modal only)
 *
 * The site theme aggressively styles semantic HTML5 elements and buttons
 * with rules that beat ours on specificity or use !important themselves.
 * Specifically:
 *   - <header> and <footer> elements get display: none in dashboard contexts
 *     (the theme uses these selectors for the site chrome and hides them
 *     when the dashboard takes over the layout).
 *   - Any <button> gets WoodMart's default pill styling (black background,
 *     white text, 16px font), overriding our variant colours.
 *
 * Scope all defenses to `.bs-pledge-modal ...` so they only apply inside
 * the modal, leaving the dashboard cards' buttons untouched (those work
 * fine because they're outside the modal context).
 * ------------------------------------------------------------------------- */
.bs-pledge-modal .bs-pledge-modal__header {
	display: block !important;
	visibility: visible !important;
}

.bs-pledge-modal .bs-pledge-modal__footer {
	display: flex !important;
	visibility: visible !important;
	justify-content: space-between !important;
	align-items: center !important;
	gap: 12px !important;
	flex-wrap: wrap !important;
}

.bs-pledge-modal .bs-pledge-btn {
	padding: 8px 16px !important;
	font-family: inherit !important;
	font-size: 14px !important;
	font-weight: 600 !important;
	line-height: 1.2 !important;
	border-width: 1px !important;
	border-style: solid !important;
	border-radius: var(--bs-pledge-radius) !important;
	text-transform: none !important;
	letter-spacing: normal !important;
	text-shadow: none !important;
	box-shadow: none !important;
	min-height: 0 !important;
	min-width: 0 !important;
	cursor: pointer;
}

.bs-pledge-modal .bs-pledge-btn--primary {
	background: var(--bs-pledge-color) !important;
	color: #fffdf9 !important;
	border-color: var(--bs-pledge-color) !important;
}

.bs-pledge-modal .bs-pledge-btn--primary:hover:not([disabled]),
.bs-pledge-modal .bs-pledge-btn--primary:focus-visible:not([disabled]) {
	background: var(--bs-pledge-color-soft) !important;
	border-color: var(--bs-pledge-color-soft) !important;
	color: #fffdf9 !important;
}

.bs-pledge-modal .bs-pledge-btn--ghost {
	background: transparent !important;
	color: var(--bs-pledge-color) !important;
	border-color: var(--bs-pledge-border) !important;
}

.bs-pledge-modal .bs-pledge-btn--ghost:hover:not([disabled]),
.bs-pledge-modal .bs-pledge-btn--ghost:focus-visible:not([disabled]) {
	background: var(--bs-pledge-bg) !important;
	color: var(--bs-pledge-ink) !important;
	border-color: var(--bs-pledge-color) !important;
}

.bs-pledge-modal .bs-pledge-btn--danger {
	background: transparent !important;
	color: var(--bs-pledge-danger) !important;
	border-color: #d6a39c !important;
}

.bs-pledge-modal .bs-pledge-btn--danger:hover:not([disabled]),
.bs-pledge-modal .bs-pledge-btn--danger:focus-visible:not([disabled]) {
	background: #fbeae6 !important;
	border-color: var(--bs-pledge-danger) !important;
	color: var(--bs-pledge-danger) !important;
}

.bs-pledge-modal .bs-pledge-btn[disabled] {
	opacity: 0.55 !important;
	cursor: not-allowed !important;
}
