/* ---- Панели в колоната с адресите ---- */

.speedy-panels {
	margin: 0 0 24px;
}

/* ---- Избор на метод на доставка ---- */

.speedy-methods {
	margin: 0 0 16px;
}

.speedy-methods__title {
	margin: 0 0 10px;
	font-size: 1.05em;
	font-weight: 600;
}

.speedy-methods__slot ul#shipping_method,
.speedy-methods__slot ul.woocommerce-shipping-methods {
	margin: 0;
	padding: 0;
	list-style: none;
	display: grid;
	gap: 8px;
}

.speedy-methods__slot ul#shipping_method li,
.speedy-methods__slot ul.woocommerce-shipping-methods li {
	margin: 0;
	padding: 0;
	list-style: none;
	border: 1px solid #dcdcdc;
	border-radius: 6px;
	background: #fff;
	transition: border-color 0.15s ease, background 0.15s ease;
}

.speedy-methods__slot li:has( input:checked ),
.speedy-methods__slot li.is-selected {
	border-color: #1e40af;
	background: #f5f8ff;
}

.speedy-methods__slot li label {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	padding: 12px 14px;
	cursor: pointer;
	font-weight: 500;
	line-height: 1.4;
}

.speedy-methods__slot li input[type="radio"] {
	flex: 0 0 auto;
	margin: 0;
}

.speedy-methods__slot li .woocommerce-Price-amount {
	margin-left: auto;
	font-weight: 600;
	white-space: nowrap;
}

.speedy-methods__empty {
	display: none;
	margin: 0;
	padding: 12px 14px;
	background: #f7f7f7;
	border: 1px dashed #cfcfcf;
	border-radius: 6px;
	font-size: 0.9em;
	color: #666;
}

.speedy-methods__single {
	margin: 0;
	padding: 12px 14px;
	background: #fff;
	border: 1px solid #dcdcdc;
	border-radius: 6px;
}

.speedy-chosen-method {
	display: block;
	font-size: 0.92em;
	line-height: 1.35;
}

@media (max-width: 782px) {
	.speedy-methods__slot li label {
		flex-wrap: wrap;
		padding: 12px;
	}

	.speedy-methods__slot li .woocommerce-Price-amount {
		flex-basis: 100%;
		margin-left: 26px;
	}
}

.speedy-panel {
	display: none;
	margin: 0 0 8px;
	padding: 18px 20px;
	background: #fafafa;
	border: 1px solid #e0e0e0;
	border-radius: 6px;
}

.speedy-panel.is-active {
	display: block;
}

.speedy-panel__title {
	margin: 0 0 6px;
	font-size: 1.05em;
	font-weight: 600;
}

.speedy-panel__hint {
	margin: 0 0 14px;
	font-size: 0.85em;
	color: #666;
	line-height: 1.45;
}

.speedy-panel__grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 0 16px;
}

/* ---- Ред с доставка, платима на куриера ---- */

.speedy-courier-paid th,
.speedy-courier-paid td {
	font-weight: 600;
}

/*
 * Скрива стандартния ред „Доставка 0.00“, когато веднага след него стои
 * редът с реалната сума. Маркерът се извежда от плъгина точно преди него.
 */
tr.woocommerce-shipping-totals:has( + tr.speedy-hide-zero-shipping ),
tr.shipping:has( + tr.speedy-hide-zero-shipping ) {
	display: none !important;
}

.speedy-rate-summary {
	margin-top: 4px;
	font-size: 0.82em;
	line-height: 1.35;
	color: #555;
}

.speedy-office-picker {
	display: none;
}

.speedy-office-picker.is-active {
	display: block;
}

.speedy-office-picker__label {
	display: block;
	margin-bottom: 6px;
	font-weight: 600;
	font-size: 0.95em;
}

.speedy-office-picker .speedy-office-search {
	width: 100%;
	box-sizing: border-box;
	padding: 8px 10px;
	border: 1px solid #ccc;
	border-radius: 3px;
	line-height: 1.4;
}

.speedy-office-results {
	position: relative;
	max-height: 260px;
	overflow-y: auto;
	margin-top: 4px;
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 3px;
	z-index: 20;
}

.speedy-office-results[hidden] {
	display: none;
}

.speedy-office-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.speedy-office-item {
	display: block;
	padding: 8px 10px;
	border-bottom: 1px solid #f0f0f0;
	cursor: pointer;
}

.speedy-office-item:last-child {
	border-bottom: 0;
}

.speedy-office-item:hover,
.speedy-office-item:focus {
	background: #f3f6fb;
}

.speedy-office-item__name {
	display: block;
	font-weight: 600;
}

.speedy-office-item__address {
	display: block;
	font-size: 0.85em;
	color: #666;
}

.speedy-office-results__loading,
.speedy-office-results__empty {
	padding: 10px;
	color: #666;
	font-size: 0.9em;
}

.speedy-office-selected {
	margin: 8px 0 0;
	font-size: 0.9em;
	color: #1c7c3f;
}

.speedy-office-info {
	margin-top: 12px;
}

/* ---- Адресни полета ---- */

.speedy-address-picker {
	display: none;
}

.speedy-address-picker.is-active {
	display: block;
}

.speedy-address-picker__row {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
	gap: 0 12px;
}

.speedy-ac-field {
	position: relative;
	margin: 0 0 10px !important;
}

.speedy-ac-field label {
	display: block;
	margin-bottom: 3px;
	font-size: 0.85em;
	font-weight: 600;
}

.speedy-ac-field .input-text {
	width: 100%;
	box-sizing: border-box;
	padding: 8px 10px;
	border: 1px solid #ccc;
	border-radius: 3px;
}

.speedy-ac-results {
	position: absolute;
	z-index: 30;
	left: 0;
	right: 0;
	max-height: 240px;
	overflow-y: auto;
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 3px;
	box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.speedy-ac-results[hidden] {
	display: none;
}

.speedy-ac-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.speedy-ac-item {
	padding: 8px 10px;
	border-bottom: 1px solid #f0f0f0;
	cursor: pointer;
	font-size: 0.9em;
}

.speedy-ac-item:last-child {
	border-bottom: 0;
}

.speedy-ac-item:hover {
	background: #f3f6fb;
}

.speedy-ac-empty {
	display: block;
	padding: 9px 10px;
	font-size: 0.85em;
	color: #666;
}

/* Скриване на стандартните адресни полета в класическия checkout. */
body.speedy-hide-native-address #shipping_address_1_field,
body.speedy-hide-native-address #shipping_address_2_field,
body.speedy-hide-native-address #shipping_city_field,
body.speedy-hide-native-address #shipping_postcode_field,
body.speedy-hide-native-address #shipping_state_field,
body.speedy-hide-native-address .woocommerce-billing-fields #billing_address_1_field,
body.speedy-hide-native-address .woocommerce-billing-fields #billing_address_2_field,
body.speedy-hide-native-address .woocommerce-billing-fields #billing_city_field,
body.speedy-hide-native-address .woocommerce-billing-fields #billing_postcode_field,
body.speedy-hide-native-address .woocommerce-billing-fields #billing_state_field {
	display: none !important;
}

/* Списък с методи, рендиран от темата — скрит, когато плъгинът показва свой. */
.speedy-foreign-methods,
.speedy-foreign-methods-title {
	display: none !important;
}
