/*
 * BOX NOW – checkout panel (custom addition).
 * Colours can be adjusted from the theme's custom CSS, e.g.
 *   #boxnow-panel { --bxp-accent: #44b149; }
 * The "Select locker" button keeps the colour set in the BOX NOW settings.
 */
#boxnow-panel {
	--bxp-accent: #6cbe45;
	--bxp-border: #dcdcdc;
	--bxp-muted: #777;
	--bxp-bg-active: #f5fbf1;
	--bxp-radius: 6px;

	clear: both;
	margin: 24px 0;
	padding: 20px;
	border: 1px solid var(--bxp-border);
	border-radius: var(--bxp-radius);
	background: #fff;
}

#boxnow-panel[hidden] {
	display: none !important;
}

.bxp__head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 12px;
	margin-bottom: 8px;
}

#boxnow-panel img.bxp__logo {
	display: block;
	flex: 0 0 auto;
	width: auto !important;
	max-width: none !important;
	height: 22px !important;
	margin: 0 !important;
}

#boxnow-panel .bxp__title {
	flex: 1 1 auto;
	min-width: 0;
	margin: 0;
	font-size: 1.15em;
	line-height: 1.3;
}

.bxp__intro {
	margin: 0 0 14px;
	color: var(--bxp-muted);
	font-size: .9em;
}

.bxp__label {
	margin-bottom: 6px;
	font-weight: 600;
}

/* "Select locker" button from the official plugin */
#boxnow-panel #box_now_delivery_button {
	display: block;
	width: 100%;
	margin: 0 !important;
	padding: 14px 18px !important;
	border: 0 !important;
	border-radius: var(--bxp-radius) !important;
	font-weight: 600;
	font-size: 1em;
	line-height: 1.2;
	text-align: center;
	text-transform: none;
}

#boxnow-panel #box_now_delivery_button:hover {
	filter: brightness(.95);
}

/* Chosen locker as a card */
#boxnow-panel #box_now_selected_locker_details.bxp-locker {
	position: relative;
	margin: 0 !important;
	padding: 12px 110px 12px 14px;
	border: 1px solid var(--bxp-accent);
	border-radius: var(--bxp-radius);
	background: var(--bxp-bg-active);
	line-height: 1.4;
}

/* The official stylesheet boxes the locker info itself - flatten it, the
   card around it is ours. */
#boxnow-panel .boxnow-selected-locker-info {
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
	gap: 2px !important;
}

#boxnow-panel .boxnow-selected-locker-info .boxnow-locker-label {
	display: none;
}

#boxnow-panel .boxnow-selected-locker-info .boxnow-locker-name strong,
#boxnow-panel .boxnow-selected-locker-info .boxnow-locker-address strong {
	display: none;
}

#boxnow-panel .boxnow-selected-locker-info .boxnow-locker-name {
	margin: 0 !important;
	font-weight: 600;
	font-size: 1em;
}

#boxnow-panel .boxnow-selected-locker-info .boxnow-locker-address {
	margin: 2px 0 0 !important;
	color: var(--bxp-muted);
	font-size: .9em;
}

#boxnow-panel .bxp-change svg {
	display: none;
}

#boxnow-panel .bxp-change {
	position: absolute;
	top: 50%;
	right: 14px;
	transform: translateY(-50%);
	margin: 0 !important;
	padding: 6px 12px !important;
	min-height: 0 !important;
	border: 1px solid var(--bxp-border) !important;
	border-radius: var(--bxp-radius);
	background: #fff !important;
	color: inherit !important;
	font-size: .85em !important;
	line-height: 1.2 !important;
	text-transform: none !important;
	cursor: pointer;
}

/* Embedded map inside the panel */
#boxnow-panel #box_now_delivery_embedded_map {
	margin: 0;
}

#boxnow-panel #box_now_delivery_embedded_map iframe {
	width: 100%;
	min-height: 460px;
	border: 1px solid var(--bxp-border);
	border-radius: var(--bxp-radius);
}

#boxnow-panel #box_now_delivery_embedded_map #box_now_selected_locker_details.bxp-locker {
	margin-top: 10px !important;
	padding-right: 14px;
}

/* Small logo in front of the method name in the courier list */
img.bxp-method-logo {
	display: inline-block;
	width: auto !important;
	max-width: none !important;
	height: 16px !important;
	margin: 0 6px 0 0;
	vertical-align: middle;
}

@media (max-width: 480px) {
	#boxnow-panel {
		padding: 14px;
	}

	#boxnow-panel #box_now_selected_locker_details.bxp-locker {
		padding-right: 14px;
		padding-bottom: 48px;
	}

	#boxnow-panel .bxp-change {
		top: auto;
		bottom: 10px;
		right: 10px;
		transform: none;
	}
}

/* Order placed without a locker */
#boxnow-panel.bxp--error {
	border-color: #e2401c;
	box-shadow: 0 0 0 1px #e2401c inset;
}

#boxnow-panel .bxp-error {
	margin: 0 0 10px;
	color: #e2401c;
	font-weight: 600;
	font-size: .95em;
}

/* Address line that only repeats what the locker name already says */
#boxnow-panel .boxnow-selected-locker-info .bxp-dup,
#boxnow-panel .bxp-k {
	display: none !important;
}

/* Courier list label: name visible, unified-only bits hidden */
.bxp-free-note,
img.bxp-method-logo--unified-only {
	display: none !important;
}

/* =====================================================================
 * Unified look - same as the other couriers styled by MrejaNet Checkout
 * (big logo + price + "free over" line in the list, Speedy-like block).
 * ================================================================== */

body.bxp-unified img.bxp-method-logo,
body.bxp-unified img.bxp-method-logo--unified-only {
	display: inline-block !important;
	height: 38px !important;
	margin: 0 !important;
}

body.bxp-unified .bxp-method-name {
	display: none !important;
}

/* The price behaves exactly like the other couriers' price (the wrapper
   steps out of the layout, so the same theme / MrejaNet rules apply). */
body.bxp-unified .bxp-method-price {
	display: contents;
}

body.bxp-unified .bxp-free-note {
	display: block !important;
	margin: 4px 0 0;
	color: rgb(63, 158, 127);
	font-size: 12px;
	font-weight: 600;
	line-height: 1.4;
}

/* Cart page: a smaller logo next to the radio, like Speedy / Econt there */
body.woocommerce-cart.bxp-unified img.bxp-method-logo,
body.woocommerce-cart.bxp-unified img.bxp-method-logo--unified-only {
	height: 30px !important;
	vertical-align: middle;
	margin-right: 6px !important;
}

body.bxp-unified #boxnow-panel {
	margin: 30px 0 20px;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
}

body.bxp-unified #boxnow-panel .bxp__head {
	margin-bottom: 6px;
}

body.bxp-unified #boxnow-panel img.bxp__logo {
	height: 38px !important;
}

body.bxp-unified #boxnow-panel .bxp__title,
body.bxp-unified #boxnow-panel .bxp__intro,
body.bxp-unified #boxnow-panel .bxp__label {
	display: none;
}

body.bxp-unified #boxnow-panel #box_now_selected_locker_details.bxp-locker {
	position: static;
	min-height: 45px;
	padding: 0 !important;
	border: 0;
	border-radius: 0;
	background: transparent;
	font-size: 1em;
	line-height: 1.65;
}

body.bxp-unified #boxnow-panel #box_now_selected_locker_details.bxp-locker::after {
	content: "";
	display: block;
	clear: both;
}

body.bxp-unified #boxnow-panel .boxnow-selected-locker-info .boxnow-locker-name {
	font-weight: 400;
}

body.bxp-unified #boxnow-panel .boxnow-selected-locker-info .boxnow-locker-address {
	color: inherit;
	font-size: 1em;
}

body.bxp-unified #boxnow-panel .bxp-k {
	display: inline !important;
}

body.bxp-unified #boxnow-panel .bxp-change {
	position: relative;
	top: auto;
	right: auto;
	transform: none;
	float: right;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 45px;
	height: 45px;
	margin: 0 0 0 10px !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 15%;
	background: var(--bxp-edit-bg, #0080ec) !important;
	color: #fff !important;
}

body.bxp-unified #boxnow-panel .bxp-change svg {
	display: block;
}

body.bxp-unified #boxnow-panel .bxp-change__text {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

body.bxp-unified #boxnow-panel #box_now_delivery_button {
	background-color: var(--bxp-edit-bg, #0080ec) !important;
	border-radius: 8px !important;
}

body.bxp-unified #boxnow-panel.bxp--error {
	box-shadow: none;
}

@media (max-width: 480px) {
	body.bxp-unified #boxnow-panel #box_now_selected_locker_details.bxp-locker {
		padding-bottom: 0;
	}
}

/* Cart: "free over" line under the radio button, like the other couriers */
body.woocommerce-cart.bxp-unified .bxp-free-note {
	width: 100%;
}
