/**
 * Beta Admin UI — Shared Action Button Pattern.
 *
 * Used by Beta Product Compare, Beta Wishlist, Beta Share and any future
 * Beta Yazilim plugin that adds a frontend action button next to the
 * "Add to cart" button on single product pages. Ensures visual consistency
 * across the plugin family.
 *
 * Scope: single product pages only. No archive/loop card buttons, no
 * image overlays — Vatan Bilgisayar layout.
 *
 * Opt-in per plugin:
 *   add_filter( 'bd_enqueue_action_btn', '__return_true' );
 *
 * Variants:
 *   .bd-action-btn             -> vertical (icon top, label bottom) — default
 *   .bd-action-btn--side       -> horizontal (icon + side label)
 *   .bd-action-btn--compact    -> icon only, accessible label (sr-only)
 *   .bd-action-btn--active     -> added/selected state
 */

/**
 * Shared wrapper — plugins render their button inside a div with this class
 * alongside their own plugin-specific wrapper class. Ensures the buttons sit
 * horizontally next to each other instead of stacking vertically when three
 * plugins (Wishlist, Compare, Share) inject into the same hook.
 */
.bd-action-btn-wrap {
	display: inline-flex;
	vertical-align: middle;
	position: relative;
	width: auto !important;  /* Override GP/WC form.cart > * { width: 100% } */
	margin-block-start: 12px; /* Gap between ATC row and action buttons. */
}

.bd-action-btn-wrap + .bd-action-btn-wrap {
	margin-inline-start: 8px;
}

.bd-action-btn {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 4px;
	min-width: 60px;
	min-height: 60px;
	padding: 8px 10px;
	border: 1px solid #e0e0e0;
	border-radius: 4px;
	background-color: #fff;
	color: #333;
	font-size: 11px;
	line-height: 1.2;
	font-weight: 500;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	box-sizing: border-box;
	vertical-align: middle;
	transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
	-webkit-font-smoothing: antialiased;
}

.bd-action-btn:hover {
	background-color: #f5f5f5;
	border-color: #c0c0c0;
	color: #111;
}

.bd-action-btn:focus-visible {
	outline: 2px solid #2271b1;
	outline-offset: 2px;
}

.bd-action-btn:disabled,
.bd-action-btn[disabled] {
	opacity: 0.5;
	cursor: not-allowed;
}

.bd-action-btn__icon {
	display: block;
	width: 20px;
	height: 20px;
	flex-shrink: 0;
}

.bd-action-btn__label {
	display: block;
	white-space: nowrap;
}

/* ── Variant: side (horizontal, icon + label) ─────────── */

.bd-action-btn--side {
	flex-direction: row;
	gap: 6px;
	min-width: 0;
	min-height: 44px;
	padding: 8px 14px;
	font-size: 13px;
}

.bd-action-btn--side .bd-action-btn__icon {
	width: 16px;
	height: 16px;
}

.bd-action-btn--side .bd-action-btn__label {
	max-width: none;
}

/* ── Variant: compact (icon only) ─────────────────────── */

.bd-action-btn--compact {
	min-width: 44px;
	min-height: 44px;
	padding: 10px;
	gap: 0;
}

.bd-action-btn--compact .bd-action-btn__label {
	/* Visually hidden but accessible to screen readers. */
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect( 0, 0, 0, 0 );
	white-space: nowrap;
	border: 0;
}

/* ── Variant: active (added / selected) ───────────────── */

.bd-action-btn--active {
	background-color: #2271b1;
	border-color: #2271b1;
	color: #fff;
}

.bd-action-btn--active:hover {
	background-color: #135e96;
	border-color: #135e96;
	color: #fff;
}

/* ── Icon swap: default vs active ─────────────────────── */

.bd-action-btn .bd-action-btn__icon--active {
	display: none;
}

.bd-action-btn--active .bd-action-btn__icon--default {
	display: none;
}

.bd-action-btn--active .bd-action-btn__icon--active {
	display: block;
}

/* ── Responsive ───────────────────────────────────────── */

/* Center action buttons on mobile. */
@media ( max-width: 768px ) {
	.bcl-customize-wrap,
	form.cart {
		text-align: center;
	}

	/* Restore left-align for ATC / Ozellesitir buttons. */
	.bcl-customize-buttons,
	.single_add_to_cart_button,
	.quantity {
		text-align: start;
	}
}

@media ( max-width: 480px ) {
	.bd-action-btn {
		min-width: 56px;
		min-height: 56px;
		padding: 6px 8px;
		font-size: 10px;
	}

	.bd-action-btn__icon {
		width: 18px;
		height: 18px;
	}
}
