/*
 * Sameday – checkout panel (custom addition).
 * Colours / sizes are copied at runtime from the Speedy / Econt blocks when
 * they are on the page; the values below are the fallbacks. Override from
 * the theme's custom CSS, e.g.  :root { --sdp-btn-bg: #e30613; }
 */
:root {
	--sdp-accent: #e30613;
	--sdp-border: #dcdcdc;
	--sdp-muted: #777;
}

/* Extra Sameday rates in the courier list (one card is enough) */
.sdp-hidden-rate {
	display: none !important;
}

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

#sameday-panel {
	clear: both;
	margin: 24px 0;
	padding: 20px;
	border: 1px solid var(--sdp-border);
	border-radius: 6px;
	background: #fff;
}

#sameday-panel::after,
#sameday-panel .sdp-group::after,
#sameday-panel .sdp-view::after {
	content: "";
	display: table;
	clear: both;
}

#sameday-panel img.sdp__logo {
	display: block;
	width: auto !important;
	max-width: none !important;
	height: 38px !important;
	margin: 0 0 12px !important;
}

#sameday-panel .sdp-desc {
	margin: 0 0 .8em;
	font-size: var(--sdp-desc-size, 16px);
}

#sameday-panel .form-row {
	margin-bottom: 14px;
}

#sameday-panel .form-row label {
	display: block;
}

/* "Изпращане до" radios - one under the other like Speedy / Econt */
#sameday-panel .sdp-ship-to .woocommerce-input-wrapper {
	display: grid;
	grid-template-columns: auto 1fr;
	align-items: center;
	gap: 6px 8px;
}

#sameday-panel .sdp-ship-to input.input-radio {
	margin: 0;
}

#sameday-panel .sdp-ship-to label.radio {
	display: block;
	margin: 0;
	cursor: pointer;
}

#sameday-panel label.sdp-na {
	opacity: .5;
	cursor: not-allowed;
}

#sameday-panel label.sdp-na::before {
	content: "(не е налично) ";
	float: right;
	font-size: .85em;
}

#sameday-panel select,
#sameday-panel .select2-container {
	width: 100% !important;
}

/* Blue button - same as Speedy / Econt "Намери най-близкия офис" */
#sameday-panel .sdp-find {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: var(--sdp-btn-height, 40px);
	margin: 0;
	padding: var(--sdp-btn-padding, 5px 20px) !important;
	border: 0 !important;
	border-radius: var(--sdp-btn-radius, 3px) !important;
	background: var(--sdp-btn-bg, #0080ec) !important;
	color: var(--sdp-btn-color, #fff) !important;
	font-family: var(--sdp-btn-font, inherit);
	font-size: var(--sdp-btn-size, 15px);
	font-weight: 400;
	line-height: 1.3;
	text-transform: none;
	letter-spacing: normal;
	cursor: pointer;
}

#sameday-panel .sdp-find:hover {
	filter: brightness(.94);
}

/* Address grid */
#sameday-panel .sdp-group--address {
	display: flex;
	flex-wrap: wrap;
	gap: 0 4%;
}

#sameday-panel .sdp-group--address[hidden] {
	display: none !important;
}

#sameday-panel .sdp-group--address .form-row {
	float: none;
	width: 100%;
	box-sizing: border-box;
}

#sameday-panel .sdp-group--address .form-row-first,
#sameday-panel .sdp-group--address .form-row-last {
	width: 48%;
}

#sameday-panel .sdp-group--address .sdp-col-8 {
	width: 64%;
}

#sameday-panel .sdp-group--address .sdp-col-4 {
	width: 32%;
}

#sameday-panel .sdp-group--address .sdp-col-3 {
	width: 22%;
}

#sameday-panel #sameday_city_select + .select2 + #sameday_city,
#sameday-panel #sameday_city_select:not([hidden]) ~ #sameday_city:not([hidden]) {
	margin-top: 8px;
}

@media (max-width: 480px) {
	#sameday-panel .sdp-group--address .form-row-first,
	#sameday-panel .sdp-group--address .form-row-last,
	#sameday-panel .sdp-group--address .sdp-col-8,
	#sameday-panel .sdp-group--address .sdp-col-4 {
		width: 100%;
	}

	#sameday-panel .sdp-group--address .sdp-col-3 {
		width: 48%;
	}

	#sameday-panel .sdp-group--address {
		gap: 0 4%;
	}
}

/* Summary */
#sameday-panel .sdp-view__lines {
	line-height: 1.65;
}

#sameday-panel .sdp-view__lines .sdp-sub {
	color: var(--sdp-muted);
	font-size: .92em;
}

/* "Промени" - same as Speedy / Econt */
#sameday-panel .sdp-change {
	float: right;
	margin: 0 0 8px 12px;
	padding: var(--sdp-edit-padding, 8px 14px);
	border-radius: var(--sdp-edit-radius, 15%);
	background: var(--sdp-edit-bg, rgb(0, 107, 191));
	color: var(--sdp-edit-color, #fff) !important;
	font-family: var(--sdp-edit-font, Arial, sans-serif);
	font-size: var(--sdp-edit-size, 15px);
	font-weight: var(--sdp-edit-weight, 600);
	line-height: 1.2;
	text-decoration: none !important;
	cursor: pointer;
}

#sameday-panel .sdp-change:hover {
	filter: brightness(.94);
}

/* Errors */
#sameday-panel.sdp--error {
	border-color: #e2401c;
}

#sameday-panel .sdp-error {
	margin: 0 0 12px;
	color: #e2401c;
	font-weight: 600;
}

/* Courier list label: logo + name + price (stand-alone look) */
img.sdp-method-logo {
	display: inline-block;
	width: auto !important;
	max-width: none !important;
	height: 16px !important;
	margin: 0 6px 0 0;
	vertical-align: middle;
}

.sdp-free-note {
	display: none !important;
}

/* =====================================================================
 * Unified look - same as the couriers styled by MrejaNet Checkout
 * ================================================================== */

body.sdp-unified img.sdp-method-logo {
	height: 38px !important;
	margin: 0 !important;
}

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

body.sdp-unified .sdp-method-price {
	display: contents;
}

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

body.woocommerce-cart.sdp-unified img.sdp-method-logo {
	height: 30px !important;
	vertical-align: middle;
	margin-right: 6px !important;
}

body.woocommerce-cart.sdp-unified .sdp-free-note {
	width: 100%;
}

body.sdp-unified #sameday-panel {
	margin: 30px 0 20px;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
}

body.sdp-unified #sameday-panel.sdp--error {
	padding-left: 12px;
	border-left: 3px solid #e2401c;
}
