/* BDCommerz Core — Product Buttons */

/* ── Layout: Quantity Row ────────────────────────────────── */
.bdc-qty-row {
	display: flex;
	align-items: center;
	gap: 0.75em;
	margin-bottom: 0.75em;
}

.bdc-qty-label {
	font-weight: 700;
	font-size: 1em;
	white-space: nowrap;
}

/* ── Layout: Primary Buttons Grid ────────────────────────── */
form.cart {
	display: flex;
	flex-direction: column;
}

.bdc-primary-btns {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.75em;
	margin-top: 0.75em;
}

/* When Add to Cart is hidden */
.bdc-primary-btns.bdc-atc-hidden {
	grid-template-columns: 1fr;
}

/* Shared height for both cells. Kept as a variable so the responsive
   breakpoints below update the theme's Add to Cart and our Buy Now together. */
.bdc-primary-btns {
	--bdc-btn-height: 52px;
}

/* Themes/builders ship their own fixed height/line-height/radius on the
   add-to-cart button (e.g. Kadence: height:40px). Normalise the box model and
   decoration for every cell in the grid so both buttons stay identical
   regardless of the active theme or page builder. `!important` is required
   because those theme rules use higher specificity than this plugin's CSS. */
.bdc-primary-btns > .single_add_to_cart_button,
.bdc-primary-btns > .bdc-buy-now-btn {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	align-self: stretch !important;
	box-sizing: border-box !important;
	width: 100% !important;
	height: auto !important;
	min-height: var( --bdc-btn-height ) !important;
	margin: 0 !important;
	padding: 0 1.5em !important;
	line-height: 1.2 !important;
	font-size: 1em !important;
	font-weight: 700 !important;
	border: none !important;
	border-radius: 8px !important;
	box-shadow: none !important;
	text-decoration: none !important;
}

/* ── Buy Now Button ──────────────────────────────────────── */
.bdc-buy-now-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 52px;
	padding: 0.75em 1.5em;
	font-size: 1em;
	font-weight: 700;
	text-align: center;
	text-decoration: none;
	border: none;
	border-radius: 8px;
	cursor: pointer;
	transition: opacity 0.25s;
	box-sizing: border-box;
}

.bdc-buy-now-btn:hover {
	opacity: 0.88;
}

/* ── Contact Buttons Grid ────────────────────────────────── */
.bdc-contact-buttons {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.75em;
	margin-top: 1em;
}

.bdc-wa-btn,
.bdc-call-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5em;
	min-height: 52px;
	padding: 0.65em 1.2em;
	font-size: 0.9em;
	font-weight: 600;
	color: #fff;
	text-decoration: none;
	border-radius: 8px;
	transition: opacity 0.25s;
	box-sizing: border-box;
}

.bdc-wa-btn:hover,
.bdc-call-btn:hover {
	opacity: 0.88;
	color: #fff;
}

.bdc-wa-btn svg,
.bdc-call-btn svg {
	flex-shrink: 0;
}

/* ── Sticky Bar ──────────────────────────────────────────── */
.bdc-sticky-bar {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	z-index: 9999;
	background: #fff;
	box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.12);
	padding: 0.75em 1em;
	transform: translateY(100%);
	transition: transform 0.3s ease;
}

.bdc-sticky-bar--visible {
	transform: translateY(0);
}

.bdc-sticky-bar__inner {
	max-width: 600px;
	margin: 0 auto;
}

.bdc-sticky-btn {
	display: flex;
	flex-direction: column;
	width: 100%;
	min-height: 52px;
	padding: 0.85em 1.5em;
	font-size: 1em;
	font-weight: 700;
	text-align: center;
	border: none;
	border-radius: 8px;
	cursor: pointer;
	box-sizing: border-box;
}

.bdc-sticky-btn--has-note {
	justify-content: center;
}

.bdc-sticky-btn__text {
	display: block;
}

.bdc-sticky-btn__note {
	display: block;
	font-size: 0.8em;
	font-weight: 400;
	opacity: 0.85;
}

/* ── Loop Page ───────────────────────────────────────────── */
.bdc-loop-form {
	display: inline;
}

/* ── Loop split: segmented product link + cart icon ─────── */
.bdc-loop-split {
	display: flex;
	gap: 0;
	align-items: stretch;
	border-radius: 8px;
	overflow: hidden;
}

.bdc-loop-split__cart {
	flex: 0 0 25%;
	min-width: 0;
}

.bdc-loop-details {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 52px;
	padding: 0 1em;
	font-size: 1em;
	font-weight: 700;
	text-align: center;
	text-decoration: none;
	color: #fff;
	background-color: #1f3a1f;
	border: none;
	border-radius: 8px;
	transition: filter 0.2s ease;
	box-sizing: border-box;
}

.bdc-loop-split .bdc-loop-details {
	flex: 1 1 0;
	width: auto;
	min-width: 0;
	border-radius: 0;
}

.bdc-loop-details:hover {
	filter: brightness(0.9);
}

.bdc-loop-split__cart .bdc-loop-form {
	display: block;
	width: 100%;
	height: 100%;
}

.bdc-loop-split__cart .bdc-buy-now-btn {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	width: 100% !important;
	height: 100% !important;
	padding: 0 !important;
	border-radius: 0 !important;
	line-height: 1 !important;
	transition: filter 0.2s ease;
}

.bdc-loop-split__cart .bdc-buy-now-btn:hover {
	filter: brightness(0.9);
	opacity: 1;
}

/* ── Variation popup (loop Buy Now for variable products) ── */
.bdc-loop-modal {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 100000;
	align-items: center;
	justify-content: center;
	padding: 1em;
}

.bdc-loop-modal--open {
	display: flex;
}

body.bdc-loop-modal-open {
	overflow: hidden;
}

.bdc-loop-modal__overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
}

.bdc-loop-modal__dialog {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 420px;
	background: #fff;
	border-radius: 10px;
	padding: 1.5em;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
	box-sizing: border-box;
}

.bdc-loop-modal__close {
	position: absolute;
	top: 8px;
	right: 10px;
	width: 32px;
	height: 32px;
	line-height: 1;
	font-size: 24px;
	color: #6b7280;
	background: none;
	border: none;
	padding: 0;
	cursor: pointer;
}

.bdc-loop-modal__close:hover {
	color: #111827;
}

.bdc-loop-modal__title {
	margin: 0 0 1em;
	padding-right: 32px;
	font-size: 1.15em;
	font-weight: 700;
	color: #111827;
}

.bdc-loop-modal__label {
	display: block;
	margin-bottom: 0.4em;
	font-size: 0.9em;
	font-weight: 600;
	color: #374151;
}

.bdc-loop-modal__select {
	width: 100%;
	height: 46px;
	padding: 0 12px;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	background: #fff;
	font-size: 1em;
	color: #1d2327;
	box-sizing: border-box;
}

.bdc-loop-modal__select:focus {
	border-color: #2271b1;
	box-shadow: 0 0 0 1px #2271b1;
	outline: 2px solid transparent;
}

.bdc-loop-modal__error {
	margin: 0.75em 0 0;
	color: #b91c1c;
	font-size: 0.9em;
}

.bdc-loop-modal__confirm {
	width: 100%;
	margin-top: 1em;
}

/* ── Responsive: Tablet (<=900px) ────────────────────────── */
@media (max-width: 900px) {
	.bdc-qty-row {
		gap: 0.5em;
	}

	.bdc-primary-btns {
		--bdc-btn-height: 46px;
	}

	.bdc-buy-now-btn,
	.bdc-sticky-btn {
		min-height: 46px;
		font-size: 14px;
	}

	.bdc-wa-btn,
	.bdc-call-btn {
		min-height: 46px;
		font-size: 13px;
	}
}

/* ── Responsive: Mobile (<=600px) ────────────────────────── */
@media (max-width: 600px) {
	.bdc-primary-btns {
		grid-template-columns: 1fr;
		--bdc-btn-height: 52px;
	}

	.bdc-primary-btns.bdc-atc-hidden {
		grid-template-columns: 1fr;
	}

	.bdc-contact-buttons {
		grid-template-columns: 1fr;
	}

	.bdc-buy-now-btn,
	.bdc-sticky-btn {
		min-height: 52px;
	}

	.bdc-wa-btn,
	.bdc-call-btn {
		min-height: 52px;
		justify-content: center;
	}

	.bdc-loop-split__cart {
		flex: 0 0 30%;
	}

	.bdc-loop-details {
		font-size: 0.9em;
		padding: 0 0.75em;
	}
}

/* ── Responsive: Desktop (>900px) — hide sticky bar ──────── */
@media (min-width: 901px) {
	.bdc-sticky-bar {
		display: none !important;
	}
}
