/* WPC Branch Price Modal - Frontend */

.wpc-bpm-shop-trigger-wrap {
	position: absolute;
	top: var(--wpc-bpm-shop-top);
	right: var(--wpc-bpm-shop-right);
	bottom: var(--wpc-bpm-shop-bottom);
	left: var(--wpc-bpm-shop-left);
	z-index: 3;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.2s ease;
}

.products .product:hover .wpc-bpm-shop-trigger-wrap,
.products .product:focus-within .wpc-bpm-shop-trigger-wrap {
	opacity: 1;
	visibility: visible;
}

.wpc-bpm-trigger-single {
	position: absolute;
	top: var(--wpc-bpm-single-top);
	right: var(--wpc-bpm-single-right);
	bottom: var(--wpc-bpm-single-bottom);
	left: var(--wpc-bpm-single-left);
	z-index: 5;
}

.wpc-bpm-single-mobile-wrap {
	margin: 0.75rem 0;
}

.wpc-bpm-trigger {
	background: var(--wpc-bpm-trigger-bg);
	color: var(--wpc-bpm-trigger-text);
	border-color: var(--wpc-bpm-trigger-border-color);
	border-style: solid;
	border-width: var(--wpc-bpm-trigger-border-width);
	border-radius: var(--wpc-bpm-trigger-radius);
	padding: var(--wpc-bpm-trigger-padding-y) var(--wpc-bpm-trigger-padding-x);
	font-size: var(--wpc-bpm-trigger-font-size);
	font-weight: var(--wpc-bpm-trigger-font-weight);
	cursor: pointer;
	line-height: 1.2;
}

.wpc-bpm-trigger:hover,
.wpc-bpm-trigger:focus {
	background: var(--wpc-bpm-trigger-hover-bg);
	color: var(--wpc-bpm-trigger-hover-text);
}

.wpc-bpm-modal-overlay {
	position: fixed;
	inset: 0;
	background: var(--wpc-bpm-overlay-bg);
	backdrop-filter: blur(var(--wpc-bpm-overlay-blur));
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	z-index: var(--wpc-bpm-z-index);
}

.wpc-bpm-modal {
	position: relative;
	animation: wpc-bpm-modal-in var(--wpc-bpm-modal-anim-duration) var(--wpc-bpm-modal-anim-easing);
	background: var(--wpc-bpm-modal-bg);
	color: var(--wpc-bpm-modal-text);
	max-width: var(--wpc-bpm-modal-width);
	width: 100%;
	border: var(--wpc-bpm-modal-border-width) solid var(--wpc-bpm-modal-border-color);
	border-radius: var(--wpc-bpm-modal-radius);
	box-shadow: var(--wpc-bpm-modal-shadow);
	padding: var(--wpc-bpm-modal-padding);
	max-height: 90vh;
	overflow: auto;
}

@keyframes wpc-bpm-modal-in {
	from {
		opacity: 0;
		transform: translateY(14px) scale(0.99);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

.wpc-bpm-close {
	position: absolute;
	top: 8px;
	right: 10px;
	font-size: 30px;
	line-height: 1;
	border: none;
	background: transparent;
	color: var(--wpc-bpm-close-btn-color);
	cursor: pointer;
}

.wpc-bpm-close:hover,
.wpc-bpm-close:focus {
	color: var(--wpc-bpm-close-btn-hover-color);
}

.wpc-bpm-modal-content {
	display: grid;
	gap: var(--wpc-bpm-content-gap);
}

.wpc-bpm-modal-heading h3 {
	font-size: var(--wpc-bpm-modal-title-size);
	font-weight: var(--wpc-bpm-modal-title-weight);
	margin: 0;
}

.wpc-bpm-modal-heading p {
	font-size: var(--wpc-bpm-modal-subtitle-size);
	margin: 6px 0 0;
}

.wpc-bpm-table-wrap {
	overflow-x: auto;
	border: var(--wpc-bpm-table-border-width) solid var(--wpc-bpm-table-border-color);
	border-radius: var(--wpc-bpm-table-radius);
}

.wpc-bpm-table {
	width: 100%;
	table-layout: fixed;
	border-collapse: collapse;
	font-size: var(--wpc-bpm-table-font-size);
	color: var(--wpc-bpm-table-text);
}

.wpc-bpm-table th:nth-child(1),
.wpc-bpm-table td:nth-child(1) {
	width: var(--wpc-bpm-col-branch-width);
	text-align: var(--wpc-bpm-col-branch-align);
}

.wpc-bpm-table th:nth-child(2),
.wpc-bpm-table td:nth-child(2) {
	width: var(--wpc-bpm-col-regular-width);
	text-align: var(--wpc-bpm-col-regular-align);
}

.wpc-bpm-table th:nth-child(3),
.wpc-bpm-table td:nth-child(3) {
	width: var(--wpc-bpm-col-sale-width);
	text-align: var(--wpc-bpm-col-sale-align);
}

.wpc-bpm-table th:nth-child(4),
.wpc-bpm-table td:nth-child(4) {
	width: var(--wpc-bpm-col-current-width);
	text-align: var(--wpc-bpm-col-current-align);
}

.wpc-bpm-table th:nth-child(5),
.wpc-bpm-table td:nth-child(5) {
	width: var(--wpc-bpm-col-stock-width);
	text-align: var(--wpc-bpm-col-stock-align);
}

.wpc-bpm-table th {
	background: var(--wpc-bpm-table-header-bg);
	color: var(--wpc-bpm-table-header-text);
	font-size: var(--wpc-bpm-table-header-font-size);
	font-weight: var(--wpc-bpm-table-header-font-weight);
	text-align: left;
}

.wpc-bpm-table th,
.wpc-bpm-table td {
	padding: var(--wpc-bpm-table-cell-padding-y) var(--wpc-bpm-table-cell-padding-x);
	border-bottom: var(--wpc-bpm-table-border-width) solid var(--wpc-bpm-table-border-color);
}

.wpc-bpm-table thead th:first-child {
	border-top-left-radius: var(--wpc-bpm-table-header-radius-tl);
}

.wpc-bpm-table thead th:last-child {
	border-top-right-radius: var(--wpc-bpm-table-header-radius-tr);
}

.wpc-bpm-table tbody tr:last-child td:first-child {
	border-bottom-left-radius: var(--wpc-bpm-table-body-radius-bl);
}

.wpc-bpm-table tbody tr:last-child td:last-child {
	border-bottom-right-radius: var(--wpc-bpm-table-body-radius-br);
}

.wpc-bpm-table tbody tr:nth-child(odd) {
	background: var(--wpc-bpm-table-row-bg);
}

.wpc-bpm-table tbody tr:nth-child(even) {
	background: var(--wpc-bpm-table-row-alt-bg);
}

.wpc-bpm-table tbody tr.is-selected-branch {
	background: var(--wpc-bpm-table-row-highlight-bg);
}

.wpc-bpm-table tbody tr:hover {
	background: var(--wpc-bpm-table-row-hover-bg);
}

.wpc-bpm-active-branch-tag {
	display: inline-block;
	margin-left: 8px;
	font-size: 11px;
	padding: 2px 6px;
	border-radius: 999px;
	background: rgba(99, 102, 241, 0.12);
	color: #4338ca;
}

.wpc-bpm-muted {
	opacity: 0.65;
}

.wpc-bpm-loading,
.wpc-bpm-error {
	padding: 12px 0;
}

@media (max-width: 768px) {
	.wpc-bpm-shop-trigger-wrap {
		opacity: 1;
		visibility: visible;
		position: static;
		margin-top: 8px;
	}

	.wpc-bpm-trigger-single {
		display: none;
	}
}
