/* WPC Branch Pricing - Frontend Styles */

/* Popup Overlay */
.wpc-bp-popup-overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.6);
	display: flex;
	justify-content: center;
	align-items: center;
	z-index: 999999;
	backdrop-filter: blur(2px);
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}

/* Popup Modal */
.wpc-bp-popup-modal {
	background: white;
	border-radius: 8px;
	padding: 2.5rem;
	max-width: 600px;
	width: 90%;
	max-height: 90vh;
	overflow-y: auto;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
	position: relative;
	animation: slideUp 0.3s ease-out;
	margin: 2rem auto;
	z-index: 1000000;
}

@keyframes slideUp {
	from {
		opacity: 0;
		transform: translateY(20px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Close Button */
.wpc-bp-popup-close {
	position: absolute;
	top: 1rem;
	right: 1rem;
	background: none;
	border: none;
	font-size: 2.5rem;
	cursor: pointer;
	color: #666;
	padding: 0;
	width: 2.5rem;
	height: 2.5rem;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: color 0.2s ease;
	line-height: 1;
	z-index: 1000001;
	font-weight: 300;
}

.wpc-bp-popup-close:hover {
	color: #000;
	background: rgba(0, 0, 0, 0.05);
	border-radius: 50%;
}

.wpc-bp-popup-close:focus {
	outline: 2px solid #c41e3a;
	outline-offset: 2px;
}

/* Popup Title */
.wpc-bp-popup-title {
	margin: 0 0 0.5rem 0;
	font-size: 1.5rem;
	line-height: 1.4;
	color: #000;
	font-weight: 600;
}

/* Popup Subtitle */
.wpc-bp-popup-subtitle {
	margin: 0 0 1.5rem 0;
	font-size: 0.95rem;
	color: #666;
	line-height: 1.5;
}

/* Branches List */
.wpc-bp-branches-list {
	display: grid;
	grid-template-columns: 1fr;
	gap: 0.75rem;
	margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
	.wpc-bp-branches-list {
		grid-template-columns: 1fr 1fr;
	}
}

/* Branch Button */
.wpc-bp-branch-btn {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	padding: 1rem;
	border: 2px solid #ddd;
	background: #f9f9f9;
	border-radius: 6px;
	cursor: pointer;
	transition: all 0.2s ease;
	text-align: left;
	min-height: 5rem;
	justify-content: center;
}

.wpc-bp-branch-btn:hover {
	border-color: #999;
	background: #fff;
}

.wpc-bp-branch-btn.selected {
	border-color: #c41e3a;
	border-width: 2px;
	background: #fff;
	box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.1);
}

/* Branch Name */
.wpc-bp-branch-btn .branch-name {
	font-size: 1rem;
	font-weight: 600;
	color: #000;
	margin-bottom: 0.25rem;
}

/* Branch HQ Badge */
.wpc-bp-branch-btn .branch-hq-badge {
	display: inline-block;
	background: #0073aa;
	color: white;
	padding: 0.15rem 0.4rem;
	border-radius: 3px;
	font-size: 0.7rem;
	font-weight: 600;
	margin-bottom: 0.25rem;
}

/* Branch Address */
.wpc-bp-branch-btn .branch-address {
	font-size: 0.8rem;
	color: #999;
}

/* Confirm Button */
.wpc-bp-confirm-btn {
	width: 100%;
	padding: 0.75rem;
	background: #000;
	color: white;
	border: 1px solid #c41e3a;
	border-radius: 4px;
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s ease;
}

.wpc-bp-confirm-btn:hover {
	background: #1a1a1a;
	border-color: #c41e3a;
}

/* Widget */
.wpc-bp-widget {
	display: inline-block;
}

/* Widget Button */
.wpc-bp-widget-btn {
	padding: 0.5rem 1rem;
	background: #000;
	color: white;
	border: 1px solid #c41e3a;
	border-radius: 4px;
	font-size: 0.9rem;
	cursor: pointer;
	transition: all 0.2s ease;
	font-weight: 600;
	white-space: nowrap;
}

.wpc-bp-widget-btn:hover {
	background: #1a1a1a;
	border-color: #c41e3a;
}

/* Red Change text */
.wpc-bp-change-text {
	color: #c41e3a;
	font-weight: 700;
}

/* Widget Placements */
.wpc-bp-widget-header {
	margin: 0.5rem 0;
}

.wpc-bp-widget-menu {
	margin: 0.5rem 0;
}

.wpc-bp-widget-footer {
	margin: 1rem 0 0 0;
}

/* Light Theme - Dark text on light background */
.wpc-bp-widget-theme-light .wpc-bp-widget-btn {
	background: #ffffff;
	color: #000000;
	border: 1px solid #cccccc;
}

.wpc-bp-widget-theme-light .wpc-bp-widget-btn:hover {
	background: #f5f5f5;
	border-color: #999999;
}

.wpc-bp-widget-theme-light .wpc-bp-widget-btn:active {
	background: #eeeeee;
}

/* Red Change text in light theme */
.wpc-bp-widget-theme-light .wpc-bp-change-text {
	color: #c41e3a;
	font-weight: 700;
}

/* Dropdown Selector - Box Style (matches site design) */
.wpc-bp-dropdown-box {
	display: inline-block;
	position: relative;
	border-radius: 0.3rem;
	cursor: pointer;
}

.wpc-bp-branch-select-box {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	opacity: 0;
	cursor: pointer;
	z-index: 10;
}

.wpc-bp-dropdown-display {
	display: inline-block;
	padding: 0.6rem 0.9rem;
	font-size: 0.9rem;
	line-height: 1.5;
}

.wpc-bp-dropdown-icon {
	margin-right: 0.4rem;
	filter: hue-rotate(345deg) saturate(2);
}

.wpc-bp-branch-name {
	color: inherit;
}

.wpc-bp-dropdown-separator {
	color: inherit;
	margin: 0 0.3rem;
}

.wpc-bp-dropdown-change {
	color: #c41e3a;
	text-decoration: underline;
	font-weight: 600;
	cursor: pointer;
}

.wpc-bp-dropdown-box:hover .wpc-bp-dropdown-change {
	color: #a01830;
}

/* Custom dropdown styling for branch select */
.wpc-bp-branch-select-box option {
	padding: 0.6rem 0.9rem;
	font-size: 0.9rem;
	background: #ffffff;
	color: #000000;
}

.wpc-bp-branch-select-box option:hover {
	background: #c41e3a;
	color: #ffffff;
}

.wpc-bp-branch-select-box option:checked,
.wpc-bp-branch-select-box option[selected] {
	background-color: #c41e3a !important;
	background: #c41e3a !important;
	color: #ffffff !important;
}

/* Light Theme */
.wpc-bp-dropdown-theme-light {
	border: 1px solid #cccccc;
	background: #ffffff;
}

.wpc-bp-dropdown-theme-light .wpc-bp-dropdown-icon {
	filter: hue-rotate(345deg) saturate(2);
}

.wpc-bp-dropdown-theme-light .wpc-bp-branch-name {
	color: #000000;
}

.wpc-bp-dropdown-theme-light .wpc-bp-dropdown-separator {
	color: #000000;
}

.wpc-bp-dropdown-theme-light .wpc-bp-dropdown-change {
	color: #c41e3a;
}

/* Dark Theme */
.wpc-bp-dropdown-theme-dark {
	border: 1px solid #c41e3a;
	background: #000000;
}

.wpc-bp-dropdown-theme-dark .wpc-bp-branch-name {
	color: #ffffff;
}

.wpc-bp-dropdown-theme-dark .wpc-bp-dropdown-separator {
	color: #ffffff;
}

.wpc-bp-dropdown-theme-dark .wpc-bp-dropdown-change {
	color: #c41e3a;
}

/* Responsive - Mobile */
@media (max-width: 600px) {
	.wpc-bp-popup-modal {
		padding: 1.5rem;
		margin: 1rem;
	}

	.wpc-bp-popup-title {
		font-size: 1.2rem;
	}

	.wpc-bp-popup-subtitle {
		font-size: 0.85rem;
	}

	.wpc-bp-branches-list {
		grid-template-columns: 1fr;
	}

	.wpc-bp-branch-btn {
		padding: 0.75rem;
		min-height: 4rem;
	}

	.wpc-bp-branch-btn .branch-name {
		font-size: 0.95rem;
	}

	.wpc-bp-branch-btn .branch-address {
		font-size: 0.75rem;
	}

	.wpc-bp-dropdown-display {
		padding: 0.6rem 0.4rem;
	}

	.wpc-bp-dropdown-icon {
		display: none;
	}
}

/* Loading State */
.wpc-bp-loading {
	opacity: 0.6;
	pointer-events: none;
}

.wpc-bp-loading::after {
	content: '';
	display: inline-block;
	width: 1rem;
	height: 1rem;
	border: 2px solid #f3f3f3;
	border-top: 2px solid #000;
	border-radius: 50%;
	animation: spin 0.8s linear infinite;
	margin-left: 0.5rem;
}

@keyframes spin {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}

/* Branch sale badge */
.wpc-bp-sale-badge {
	display: block;
	margin-top: 6px;
	padding: 6px 12px;
	border-radius: 5px;
	border: 1px solid #c41e3a;
	background: linear-gradient(135deg, #c41e3a, #000000);
	color: #ffffff;
	font-size: 12px;
	font-weight: 700;
	line-height: 1.2;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}

.wpc-bp-sale-badge--loop {
	display: none;
}

.wpc-bp-sale-badge--inline {
	display: inline-block;
}

.wpc-bp-sale-badge__label {
	display: inline-block;
	margin-right: 6px;
}

.wpc-bp-sale-badge__ticker {
	display: inline-block;
	vertical-align: middle;
	height: 1.2em;
	overflow: hidden;
}

.wpc-bp-sale-badge__branches {
	list-style: none;
	margin: 0;
	padding: 0;
	animation-name: wpc-bp-branch-scroll;
	animation-timing-function: linear;
	animation-iteration-count: infinite;
	animation-duration: var(--wpc-bp-branch-scroll-speed, 10s);
}

.wpc-bp-sale-badge__branches li {
	line-height: 1.2em;
	white-space: nowrap;
}

@keyframes wpc-bp-branch-scroll {
	0% {
		transform: translateY(0);
	}
	100% {
		transform: translateY(-100%);
	}
}

/* Horizontal sale ticker */
.wpc-bp-sale-ticker {
	position: relative;
	overflow: hidden;
	background: #ffffff;
	border-top: 1px solid #f0f0f0;
	border-bottom: 1px solid #f0f0f0;
	padding: 8px 0;
}

.wpc-bp-sale-ticker__track {
	display: flex;
	flex-wrap: nowrap;
	gap: 16px;
	animation-name: wpc-bp-sale-ticker-scroll;
	animation-timing-function: linear;
	animation-iteration-count: infinite;
	animation-duration: var(--wpc-bp-sale-ticker-speed, 25s);
}

.wpc-bp-sale-ticker__item {
	min-width: 260px;
	max-width: 320px;
	display: flex;
	align-items: center;
	background: #ffffff;
	border-radius: 6px;
	box-shadow: 0 2px 6px rgba(0, 0, 0, var(--wpc-bp-sale-ticker-shadow-opacity, 0.12));
	padding-top: var(--wpc-bp-sale-ticker-pad-top, 6px);
	padding-right: var(--wpc-bp-sale-ticker-pad-right, 10px);
	padding-bottom: var(--wpc-bp-sale-ticker-pad-bottom, 6px);
	padding-left: var(--wpc-bp-sale-ticker-pad-left, 10px);
}

.wpc-bp-sale-ticker__link {
	display: flex;
	align-items: center;
	gap: 8px;
	text-decoration: none;
	color: inherit;
	width: 100%;
}

.wpc-bp-sale-ticker__image img {
	width: 40px;
	height: 40px;
	border-radius: 4px;
	object-fit: cover;
}

.wpc-bp-sale-ticker__content {
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.wpc-bp-sale-ticker__title {
	display: flex;
	align-items: center;
	gap: 4px;
	font-size: 12px;
	font-weight: 600;
	color: #000000;
	flex-wrap: wrap;
	white-space: normal;
}

.wpc-bp-sale-ticker__emoji {
	color: #c41e3a;
}

.wpc-bp-sale-ticker__prices {
	margin-top: 2px;
	display: flex;
	align-items: baseline;
	gap: 6px;
	font-size: 12px;
}

.wpc-bp-sale-ticker__price-regular {
	color: #999999;
	text-decoration: line-through;
	font-size: var(--wpc-bp-sale-ticker-font-regular, 11px);
}

.wpc-bp-sale-ticker__price-sale {
	color: #c41e3a;
	font-weight: 800;
	font-size: var(--wpc-bp-sale-ticker-font-sale, 13px);
}

@keyframes wpc-bp-sale-ticker-scroll {
	0% {
		transform: translateX(0);
	}
	100% {
		transform: translateX(-50%);
	}
}

@media (max-width: 600px) {
	.wpc-bp-sale-ticker__item {
		min-width: 220px;
		max-width: 260px;
	}
}