/* Lumixa Checkout – Frontend Styles */

/* ============ Delivery Section ============ */
.lumixa-delivery-section {
	padding: 8px 0 0;
}

/* Section header */
.lumixa-section-header {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 16px;
	padding-bottom: 8px;
	border-bottom: 1px solid #e0e0e0;
}
.lumixa-section-header__number {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: #1e1e1e;
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	flex-shrink: 0;
}
.lumixa-section-header__title {
	font-size: 16px;
	font-weight: 600;
	color: #1e1e1e;
	text-transform: uppercase;
	letter-spacing: 0.02em;
}

/* Section divider (no text) */
.lumixa-section-divider {
	border: none;
	border-top: 1px solid #e0e0e0;
	margin: 0 0 16px;
}

/* ============ Field Wrapper ============ */
.lumixa-field {
	margin-bottom: 16px;
}
.lumixa-field__label {
	display: block;
	font-size: 13px;
	font-weight: 500;
	margin-bottom: 6px;
	color: #1e1e1e;
	text-transform: uppercase;
	letter-spacing: 0.02em;
}
.lumixa-field__required {
	color: #cc1818;
}

/* Field row (side by side) */
.lumixa-field-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}

/* ============ Searchable Select ============ */
.lumixa-select {
	position: relative;
}
.lumixa-select__control {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 12px 14px;
	border: 1px solid #d1d1d1;
	border-radius: 4px;
	cursor: pointer;
	background: #fff;
	min-height: 48px;
	font-size: 14px;
	transition: border-color .2s, box-shadow .2s;
	box-sizing: border-box;
}
.lumixa-select__control:hover {
	border-color: #1e1e1e;
}
.lumixa-select--open .lumixa-select__control {
	border-color: #1e1e1e;
	box-shadow: 0 0 0 1px #1e1e1e;
	border-bottom-left-radius: 0;
	border-bottom-right-radius: 0;
}
.lumixa-select__value {
	flex: 1;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	color: #1e1e1e;
}
.lumixa-select__placeholder {
	color: #757575;
}
.lumixa-select__arrow {
	font-size: 10px;
	margin-left: 8px;
	color: #757575;
}
.lumixa-select__dropdown {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	background: #fff;
	border: 1px solid #1e1e1e;
	border-top: none;
	border-bottom-left-radius: 4px;
	border-bottom-right-radius: 4px;
	z-index: 100;
	max-height: 300px;
	display: flex;
	flex-direction: column;
	box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.lumixa-select__search {
	padding: 10px 14px;
	border: none;
	border-bottom: 1px solid #e0e0e0;
	font-size: 14px;
	outline: none;
	width: 100%;
	box-sizing: border-box;
}
.lumixa-select__options {
	overflow-y: auto;
	max-height: 250px;
}
.lumixa-select__option {
	padding: 10px 14px;
	cursor: pointer;
	font-size: 14px;
	transition: background .15s;
}
.lumixa-select__option:hover {
	background: #f5f5f5;
}
.lumixa-select__option--selected {
	background: #f0f0f0;
	font-weight: 500;
}
.lumixa-select__loading,
.lumixa-select__no-results {
	padding: 14px;
	color: #757575;
	font-size: 13px;
	text-align: center;
}

/* ============ Text Input ============ */
.lumixa-text-input {
	width: 100%;
	padding: 12px 14px;
	border: 1px solid #d1d1d1;
	border-radius: 4px;
	font-size: 14px;
	min-height: 48px;
	box-sizing: border-box;
	transition: border-color .2s, box-shadow .2s;
	background: #fff;
}
.lumixa-text-input:focus {
	border-color: #1e1e1e;
	outline: none;
	box-shadow: 0 0 0 1px #1e1e1e;
}
.lumixa-text-input::placeholder {
	color: #9e9e9e;
}

/* ============ Phone Input ============ */
.lumixa-phone-input {
	display: flex;
	gap: 0;
	border: 1px solid #d1d1d1;
	border-radius: 4px;
	overflow: hidden;
	transition: border-color .2s, box-shadow .2s;
	background: #fff;
}
.lumixa-phone-input:focus-within {
	border-color: #1e1e1e;
	box-shadow: 0 0 0 1px #1e1e1e;
}
.lumixa-phone-input__code {
	border: none;
	border-right: 1px solid #e0e0e0;
	padding: 12px 8px 12px 12px;
	font-size: 16px;
	font-weight: 500;
	background: #fafafa;
	cursor: pointer;
	outline: none;
	min-width: 110px;
	max-width: 130px;
	appearance: auto;
}
/* Number input wrapper (for floating label) */
.lumixa-phone-input__number-wrap {
	flex: 1;
	position: relative;
	display: flex;
	align-items: center;
}
.lumixa-phone-input__number {
	width: 100%;
	border: none;
	padding: 20px 14px 6px;
	font-size: 14px;
	outline: none;
	min-height: 48px;
	box-sizing: border-box;
	letter-spacing: 0.5px;
	background: transparent;
}
.lumixa-phone-input__number::placeholder {
	color: #9e9e9e;
}

/* Floating label */
.lumixa-phone-input__label {
	position: absolute;
	top: 50%;
	left: 14px;
	transform: translateY(-50%);
	font-size: 14px;
	color: #757575;
	pointer-events: none;
	transition: all .15s ease;
	transform-origin: left center;
	white-space: nowrap;
}
.lumixa-phone-input__label .lumixa-field__required {
	color: #c00;
}
/* Label floats up when wrapper has .is-active */
.lumixa-phone-input__number-wrap.is-active .lumixa-phone-input__label {
	top: 6px;
	transform: translateY(0);
	font-size: 10px;
	color: #1e1e1e;
}

/* Enhanced phone inside WC address form */
.wc-block-components-address-form__phone #lumixa-phone-enhanced {
	margin-top: 0;
}

/* ============ Buyer Section – Fixed Field Order ============ */
/* Override WC Blocks grid to use flexbox with explicit order.
   Row 1: Country (50%) | Phone (50%)
   Row 2: First name (30%) | Last name (40%) | Patronymic (30%)
   Remaining WC fields stay hidden via admin CSS. */

.wp-block-woocommerce-checkout-shipping-address-block .wc-block-components-address-form,
.wp-block-woocommerce-checkout-billing-address-block .wc-block-components-address-form {
	display: flex !important;
	flex-wrap: wrap !important;
	gap: 12px !important;
	align-items: flex-start !important;
}

/* Row 1 */
.wc-block-components-address-form .wc-block-components-address-form__country {
	order: 1 !important;
	flex: 0 0 calc(50% - 6px) !important;
	max-width: calc(50% - 6px) !important;
}
.wc-block-components-address-form .wc-block-components-address-form__phone {
	order: 2 !important;
	flex: 0 0 calc(50% - 6px) !important;
	max-width: calc(50% - 6px) !important;
	/* Remove WC label above phone (we use floating label inside) */
	padding-top: 0 !important;
	margin-top: 0 !important;
}
/* Hide the original WC phone label — Lumixa phone has its own floating label */
.wc-block-components-address-form__phone > label:first-child {
	display: none !important;
}
/* Ensure phone input aligns with country dropdown height */
.wc-block-components-address-form__phone .lumixa-phone-input {
	min-height: 48px;
}

/* Row 2 — all items stretch to same height */
.wc-block-components-address-form .wc-block-components-address-form__first_name {
	order: 3 !important;
	flex: 0 0 calc(30% - 8px) !important;
	max-width: calc(30% - 8px) !important;
	align-self: stretch;
}
.wc-block-components-address-form .wc-block-components-address-form__last_name {
	order: 4 !important;
	flex: 0 0 calc(40% - 8px) !important;
	max-width: calc(40% - 8px) !important;
	align-self: stretch;
}
.wc-block-components-address-form #lumixa-patronymic-wrap {
	order: 5 !important;
	flex: 0 0 calc(30% - 8px) !important;
	max-width: calc(30% - 8px) !important;
	margin-top: 0 !important;
	padding-top: 0 !important;
}

/* Remaining fields (company, address, city, state, postcode) get high order */
.wc-block-components-address-form .wc-block-components-address-form__company,
.wc-block-components-address-form .wc-block-components-address-form__address_1,
.wc-block-components-address-form .wc-block-components-address-form__address_2,
.wc-block-components-address-form .wc-block-components-address-form__city,
.wc-block-components-address-form .wc-block-components-address-form__state,
.wc-block-components-address-form .wc-block-components-address-form__postcode {
	order: 10 !important;
	flex: 0 0 100% !important;
}

/* ============ Patronymic Field (WC floating-label style) ============ */
.lumixa-patronymic-field {
	position: relative;
	margin-bottom: 0;
	background: transparent !important;
}
/* Floating label — mirrors WC .wc-block-components-text-input label */
.lumixa-patronymic-field label {
	position: absolute;
	top: 50%;
	left: 16px;
	transform: translateY(-50%);
	font-size: 14px;
	font-weight: 400;
	color: #1e1e1e;
	pointer-events: none;
	transition: all .15s ease;
	transform-origin: left center;
	margin: 0;
	padding: 0;
	background: transparent !important;
	text-transform: uppercase;
	letter-spacing: 0.02em;
	line-height: 1;
}
/* Label floats up when input has value or focus */
.lumixa-patronymic-field .lumixa-text-input:focus + label,
.lumixa-patronymic-field .lumixa-text-input:not(:placeholder-shown) + label {
	top: 8px;
	transform: translateY(0);
	font-size: 11px;
	color: #1e1e1e;
	text-transform: uppercase;
}
.lumixa-patronymic-field .lumixa-text-input {
	width: 100%;
	height: 100%;
	min-height: 48px;
	padding: 20px 16px 8px;
	background: #fff !important;
	font-size: 14px;
	box-sizing: border-box;
}
.lumixa-patronymic-field .lumixa-text-input::placeholder {
	color: transparent;
}

/* Mobile: stack fields vertically */
@media (max-width: 600px) {
	.wc-block-components-address-form .wc-block-components-address-form__country,
	.wc-block-components-address-form .wc-block-components-address-form__phone,
	.wc-block-components-address-form .wc-block-components-address-form__first_name,
	.wc-block-components-address-form .wc-block-components-address-form__last_name,
	.wc-block-components-address-form #lumixa-patronymic-wrap {
		flex: 0 0 100% !important;
		max-width: 100% !important;
	}
}

/* ============ Legacy compat (mrkv- classes) ============ */
.mrkv-blocks-shipping-fields { padding: 16px 0 8px; }
.mrkv-blocks-field { margin-bottom: 12px; }
.mrkv-blocks-field__label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 4px; color: #1e1e1e; }
.mrkv-blocks-field__required { color: #cc1818; }
.mrkv-blocks-select { position: relative; }
.mrkv-blocks-select__control { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border: 1px solid #8c8f94; border-radius: 4px; cursor: pointer; background: #fff; min-height: 42px; font-size: 14px; }
.mrkv-blocks-text-input { width: 100%; padding: 10px 12px; border: 1px solid #8c8f94; border-radius: 4px; font-size: 14px; min-height: 42px; box-sizing: border-box; }

/* ============ Fallback container ============ */
.lumixa-fallback-container {
	margin-top: 8px;
}

/* Billing section hiding is done via JS to avoid hiding shipping fields */
