/* Shipping method radio buttons — card grid */
.wc-block-components-shipping-rates-control .wc-block-components-radio-control {
	display: grid !important;
	grid-template-columns: 1fr 1fr !important;
	gap: 0.75rem !important;
}

.wc-block-components-shipping-rates-control .wc-block-components-radio-control__option {
	background-color: var(--checkout-surface) !important;
	border: 1.5px solid var(--checkout-border) !important;
	border-radius: 10px !important;
	padding: 1rem 1rem 1rem 3.5rem !important;
	margin-bottom: 0 !important;
	transition: border-color 0.2s ease, background-color 0.2s ease !important;
	outline: none !important;
	box-shadow: none !important;
	cursor: pointer !important;
	position: relative !important;
	display: flex !important;
	flex-direction: column !important;
	justify-content: center !important;
	min-height: 72px !important;
}

.wc-block-components-shipping-rates-control .wc-block-components-radio-control__option:focus,
.wc-block-components-shipping-rates-control .wc-block-components-radio-control__option:focus-within {
	outline: none !important;
	box-shadow: none !important;
}

.wc-block-components-shipping-rates-control .wc-block-components-radio-control__option:has(input:checked) {
	border-color: var(--checkout-accent) !important;
}

/* Hide native radio input */
.wc-block-components-shipping-rates-control .wc-block-components-radio-control__input {
	position: absolute !important;
	opacity: 0 !important;
	width: 0 !important;
	height: 0 !important;
	pointer-events: none !important;
}

/* Remove default WooCommerce highlight overlay on shipping and payment radio */
.wc-block-components-radio-control--highlight-checked::after,
.wc-block-components-radio-control__option::after {
	display: none !important;
}

/* Carrier icon placeholder (injected via JS) */
.muus-carrier-icon {
	position: absolute;
	left: 0.85rem;
	top: 50%;
	transform: translateY(-50%);
	width: 28px;
	height: 28px;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.muus-carrier-icon svg {
	width: 28px;
	height: 28px;
}

.muus-carrier-days {
	display: block;
	font-size: 0.75rem;
	font-weight: 400;
	color: var(--checkout-text-muted, #888) !important;
	margin-top: 0.15rem;
}

/* ── CDEK Map Widget ── */
/* Reset dark checkout theme inside CDEK widget so map controls stay light */
.wp-block-shipping-cdek-map {
	border-radius: 12px;
	overflow: hidden;
	margin-top: 0.75rem;
}

#cdek-map {
	transition: height 0.3s ease, opacity 0.2s ease;
}

/* Search input — override dark checkout input styles */
.wp-block-shipping-cdek-map input[type="text"],
.wp-block-shipping-cdek-map input {
	background-color: #fff !important;
	color: #333 !important;
	border: 1px solid #ccc !important;
	border-radius: 8px !important;
	padding: 0.5rem 0.75rem !important;
	font-size: 0.875rem !important;
}

.wp-block-shipping-cdek-map input::placeholder {
	color: #999 !important;
}

/* "Выбрать" button inside CDEK widget — black text on green */
.wp-block-shipping-cdek-map button[class*="cdek-"],
#cdek-map button[class*="cdek-"] {
	color: #000 !important;
	font-weight: 600 !important;
	border-radius: 8px !important;
}

/* Selected office info card */
.cdek-office-info {
	background: var(--checkout-surface, #1a1a1a) !important;
	color: var(--checkout-text, #e8e5e0) !important;
	border: 1px solid var(--checkout-border, #333) !important;
	border-radius: 8px !important;
	padding: 0.75rem 1rem !important;
	margin-top: 0.5rem;
	font-size: 0.85rem;
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.cdek-office-info::before {
	filter: invert(1) !important;
}

/* "Выбрать пункт выдачи" / "Изменить ПВЗ" button */
.open-pvz-btn {
	background-color: var(--checkout-accent, #c8a97e) !important;
	border: none !important;
	border-radius: 8px !important;
	color: #111 !important;
	font-weight: 600 !important;
	padding: 0.65rem 1.25rem !important;
	cursor: pointer !important;
	font-size: 0.85rem !important;
	transition: opacity 0.2s ease !important;
}

.open-pvz-btn:hover {
	opacity: 0.85 !important;
}

.open-pvz-btn a {
	color: inherit !important;
	text-decoration: none !important;
}

/* Compact selected-office summary shown after map collapses */
.muus-selected-office {
	background: var(--checkout-surface, #1a1a1a);
	border: 1.5px solid var(--checkout-accent, #c8a97e);
	border-radius: 10px;
	padding: 0.85rem 1rem;
	margin-top: 0.75rem;
	display: flex;
	align-items: center;
	gap: 0.75rem;
}

.muus-selected-office-icon {
	flex-shrink: 0;
	width: 32px;
	height: 32px;
	color: var(--checkout-accent, #c8a97e);
}

.muus-selected-office-details {
	flex: 1;
	min-width: 0;
}

.muus-selected-office-name {
	font-weight: 600;
	font-size: 0.85rem;
	color: var(--checkout-text, #e8e5e0);
}

.muus-selected-office-address {
	font-size: 0.78rem;
	color: var(--checkout-text-muted, #888);
	margin-top: 0.15rem;
}

.muus-selected-office-change {
	color: var(--checkout-accent, #c8a97e);
	font-size: 0.78rem;
	font-weight: 500;
	cursor: pointer;
	flex-shrink: 0;
	text-decoration: none;
	border: none;
	background: none;
	padding: 0;
}

.muus-selected-office-change:hover {
	text-decoration: underline;
}

/* Label & price layout inside card */
.wc-block-components-shipping-rates-control .wc-block-components-radio-control__label {
	color: var(--checkout-text) !important;
	font-size: 0.88rem !important;
	font-weight: 600 !important;
	line-height: 1.3 !important;
}

.wc-block-components-shipping-rates-control .wc-block-components-radio-control__description {
	color: var(--checkout-text-muted) !important;
	font-size: 0.78rem !important;
}

.wc-block-components-shipping-rates-control .wc-block-components-radio-control__secondary-label {
	color: var(--checkout-accent) !important;
	font-weight: 600 !important;
	font-size: 0.88rem !important;
}

/* ── Payment method cards — grid layout ── */
.wc-block-checkout__payment-method .wc-block-components-radio-control {
	display: grid !important;
	grid-template-columns: 1fr 1fr !important;
	gap: 0.75rem !important;
}

.wc-block-checkout__payment-method .wc-block-components-radio-control-accordion-option {
	background-color: var(--checkout-surface) !important;
	border: 1.5px solid var(--checkout-border) !important;
	border-radius: 10px !important;
	padding: 0 !important;
	overflow: hidden !important;
	transition: border-color 0.2s ease, background-color 0.2s ease !important;
	outline: none !important;
	box-shadow: none !important;
}

.wc-block-checkout__payment-method .wc-block-components-radio-control-accordion-option--checked-option-highlighted {
	border-color: var(--checkout-accent) !important;
}

.wc-block-checkout__payment-method .wc-block-components-radio-control__option {
	padding: 1rem 1.25rem !important;
	margin: 0 !important;
	background: transparent !important;
	border: none !important;
	border-radius: 0 !important;
	cursor: pointer !important;
	display: flex !important;
	flex-direction: column !important;
	align-items: flex-start !important;
	gap: 0.5rem !important;
	min-height: 72px !important;
}

.wc-block-checkout__payment-method .wc-block-components-radio-control__input {
	position: absolute !important;
	opacity: 0 !important;
	width: 0 !important;
	height: 0 !important;
	pointer-events: none !important;
}

.wc-block-checkout__payment-method .wc-block-components-radio-control__option-layout {
	width: 100% !important;
}

.wc-block-checkout__payment-method .wc-block-components-radio-control__label-group {
	display: flex !important;
	align-items: center !important;
	justify-content: space-between !important;
	width: 100% !important;
}

.wc-block-checkout__payment-method .wc-block-components-radio-control__label {
	color: var(--checkout-text) !important;
	font-size: 0.9rem !important;
	font-weight: 600 !important;
	flex: 1 !important;
}

/* Inner span with text + icon — flex row */
.wc-block-checkout__payment-method .wc-block-components-radio-control__label > span {
	display: flex !important;
	align-items: center !important;
	justify-content: space-between !important;
	width: 100% !important;
}

/* Payment gateway icon */
.wc-block-checkout__payment-method .wc-block-components-radio-control__label img {
	float: none !important;
	margin: 0 !important;
	height: 26px !important;
	width: auto !important;
	object-fit: contain !important;
	flex-shrink: 0 !important;
}

/* Description text below the label */
.wc-block-checkout__payment-method .wc-block-components-radio-control-accordion-content {
	padding: 0.5rem 1.25rem 1rem !important;
	color: var(--checkout-text-muted) !important;
	font-size: 0.78rem !important;
	line-height: 1.4 !important;
	border-top: 1px solid var(--checkout-border) !important;
}

/* Mobile: stack payment cards vertically */
@media (max-width: 480px) {
	.wc-block-checkout__payment-method .wc-block-components-radio-control {
		grid-template-columns: 1fr !important;
	}
}

/* Generic radio controls (non-payment, non-shipping) */
.wc-block-components-radio-control__option {
	color: var(--checkout-text) !important;
}

.wc-block-components-radio-control__label,
.wc-block-components-radio-control__description {
	color: var(--checkout-text) !important;
}

.wc-block-components-radio-control__secondary-label {
	color: var(--checkout-accent) !important;
	font-weight: 600 !important;
}

/* Mobile: stack shipping cards vertically */
@media (max-width: 480px) {
	.wc-block-components-shipping-rates-control .wc-block-components-radio-control {
		grid-template-columns: 1fr !important;
	}
}

/* Shipping address compact display */
.wc-block-components-address-card {
	background-color: var(--checkout-bg) !important;
	border: 1px solid var(--checkout-border) !important;
	border-radius: 6px !important;
	padding: 0.85rem 1rem !important;
}

.wc-block-components-address-card__address-info span {
	color: var(--checkout-text) !important;
}

.wc-block-components-address-card__edit {
	color: var(--checkout-accent) !important;
	font-size: 0.85rem !important;
}

/* Phone field: hide in address section (moved to contact via JS) */
.wc-block-components-address-form__phone {
	display: none !important;
}

/* "Use same address for billing": hidden on both sites. It ships checked, so
   hiding it pins billing to the delivery address. Across 133 orders on the two
   stores not one paid order ever carried a genuinely different billing address
   (the handful of mismatches were case/ZIP+4/transliteration noise), and neither
   YooKassa nor Robokassa asks us for a separate card address. The label was also
   actively misleading in Russian — WooCommerce translates "billing" as
   "выставление счетов", which reads as invoicing rather than the card address.
   The billing form itself is NOT hidden: a session that already unchecked the box
   must stay able to fill it, or checkout would fail on invisible required fields. */
.wc-block-checkout__use-address-for-billing {
	display: none !important;
}

/* DaData Address Suggestions dropdown */
.muus-suggest-dropdown {
	position: absolute;
	left: 0;
	right: 0;
	top: 100%;
	background-color: #222;
	border: 1px solid var(--wp--preset--color--primary);
	border-radius: 8px;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
	max-height: 280px;
	overflow-y: auto;
	scrollbar-width: thin;
	scrollbar-color: var(--wp--preset--color--border) transparent;
}

.muus-suggest-item {
	display: block;
	padding: 0.75rem 1rem;
	font-size: 0.9rem;
	line-height: 1.45;
	color: #fff;
	cursor: pointer;
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
	transition: background-color 0.15s ease;
	white-space: normal !important;
	overflow-wrap: break-word;
	word-break: break-word;
}

.muus-suggest-item:last-child {
	border-bottom: none;
}

.muus-suggest-item:hover,
.muus-suggest-item--active {
	background-color: rgba(200, 169, 126, 0.15);
	color: var(--wp--preset--color--primary);
}

@media (max-width: 781px) {
	.muus-suggest-dropdown {
		max-height: 180px;
	}
	.muus-suggest-item {
		padding: 0.85rem 1rem;
		font-size: 0.95rem;
	}
}

/* Return to cart link — hidden */
.wc-block-components-checkout-return-to-cart-button {
	display: none !important;
}

/* Expand buttons (+ Add apartment, Add coupons) */
.wc-block-checkout button:not(.wc-block-components-checkout-place-order-button) {
	color: var(--checkout-text-muted) !important;
	font-size: 0.82rem !important;
}

.wc-block-components-totals-coupon button[aria-expanded] {
	color: var(--checkout-text) !important;
}

/* Mobile responsive */
@media (max-width: 781px) {
	/* Prevent iOS Safari auto-zoom on input focus (requires >= 16px) */
	.wc-block-checkout input[type="text"],
	.wc-block-checkout input[type="email"],
	.wc-block-checkout input[type="tel"],
	.wc-block-checkout input[type="number"],
	.wc-block-checkout input[type="password"],
	.wc-block-checkout select,
	.wc-block-checkout textarea,
	.wc-block-components-text-input input,
	.wc-block-components-text-input textarea,
	.wc-block-components-combobox .components-combobox-control input {
		font-size: 16px !important;
	}

	.wc-block-checkout__main {
		padding-right: 0 !important;
		order: 1;
	}

	.wc-block-checkout {
		padding: 1rem !important;
		display: flex !important;
		flex-direction: column !important;
	}

	.wc-block-checkout::before {
		font-size: 1.3rem;
		padding-bottom: 1rem;
		margin-bottom: 1.5rem;
		order: 0;
	}

	.wc-block-checkout fieldset {
		padding: 1.25rem 1rem !important;
	}

	.wc-block-checkout__sidebar {
		position: static !important;
		margin-top: 0.5rem;
		padding-top: 0 !important;
		order: 2;
	}

	.wc-block-components-checkout-order-summary__title {
		margin-top: 0 !important;
		padding-top: 0.75rem !important;
	}

	/* Hide duplicate order summary rendered inside the actions block on mobile */
	.wc-block-checkout__actions .wp-block-woocommerce-checkout-order-summary-block {
		display: none !important;
	}
}

