/**
 * Checkout: invoice type cards and form polish.
 */

:root {
	--kor-accent: #f3571d;
	--kor-accent-soft: rgba(243, 87, 29, 0.14);
	--kor-border: #3a3a3a;
	--kor-text: #e8e8e8;
	--kor-muted: #9a9a9a;
}

/* Invoice type: two selectable cards */
.woocommerce form .kor-invoice-type {
	margin-bottom: 22px;
}

.woocommerce form .kor-invoice-type > label:first-child {
	display: block;
	margin-bottom: 10px;
	font-weight: 600;
	color: var(--kor-text);
}

.kor-invoice-type .woocommerce-input-wrapper {
	position: relative;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}

.kor-invoice-type input.input-radio {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
	pointer-events: none;
}

.woocommerce form .kor-invoice-type label.radio {
	position: relative;
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 0;
	padding: 16px 18px 16px 16px;
	border: 1.5px solid var(--kor-border);
	border-radius: 12px;
	background: var(--kor-surface-2, #242424);
	color: var(--kor-text);
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s;
}

.woocommerce form .kor-invoice-type label.radio::before {
	content: "";
	flex: 0 0 26px;
	width: 26px;
	height: 26px;
	background-color: var(--kor-muted);
	-webkit-mask: var(--kor-icon) center / contain no-repeat;
	mask: var(--kor-icon) center / contain no-repeat;
	transition: background-color 0.2s;
}

.kor-invoice-type label.radio[for$="_bireysel"] {
	--kor-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 12a5 5 0 1 0 0-10 5 5 0 0 0 0 10Zm0 2c-4.4 0-8 2.2-8 5v2h16v-2c0-2.8-3.6-5-8-5Z'/%3E%3C/svg%3E");
}

.kor-invoice-type label.radio[for$="_kurumsal"] {
	--kor-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 21V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6h5a1 1 0 0 1 1 1v10h-5v-4h-3v4H3Zm4-14v2h2V7H7Zm4 0v2h2V7h-2ZM7 12v2h2v-2H7Zm4 0v2h2v-2h-2Z'/%3E%3C/svg%3E");
}

.kor-invoice-type input.input-radio:checked + label.radio {
	border-color: var(--kor-accent);
	background: var(--kor-accent-soft);
	box-shadow: 0 0 0 3px rgba(243, 87, 29, 0.12);
}

.kor-invoice-type input.input-radio:checked + label.radio::before {
	background-color: var(--kor-accent);
}

.kor-invoice-type input.input-radio:checked + label.radio::after {
	content: "";
	position: absolute;
	top: 10px;
	right: 10px;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: var(--kor-accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5 9-10'/%3E%3C/svg%3E") center / 11px no-repeat;
}

.kor-invoice-type input.input-radio:focus-visible + label.radio {
	outline: 2px solid var(--kor-accent);
	outline-offset: 2px;
}

.kor-invoice-type label.radio:hover {
	border-color: var(--kor-accent);
}

/* We only ship inside Turkey: the country stays in the form (value TR) but is not shown */
#billing_country_field,
#shipping_country_field,
#calc_shipping_country_field {
	display: none !important;
}

/* Radio labels: WooCommerce adds a required asterisk to each option, hide it */
.kor-invoice-type label.radio abbr.required,
.kor-invoice-type label.radio span.required {
	display: none;
}

/* Company block: visually grouped */
.woocommerce form .kor-corp-field {
	position: relative;
}

/* Field helper text */
.woocommerce form .form-row .description,
.woocommerce form .form-row span.description {
	display: block;
	margin-top: 6px;
	color: var(--kor-muted);
	font-size: 12.5px;
	line-height: 1.4;
}

/* Inputs */
.woocommerce form .form-row input.input-text,
.woocommerce form .form-row select {
	transition: border-color 0.2s, box-shadow 0.2s;
}

.woocommerce form .form-row input.input-text:focus {
	border-color: var(--kor-accent);
	box-shadow: 0 0 0 3px rgba(243, 87, 29, 0.12);
}

/* Phone field: mobile keyboard friendly, monospace-ish digits */
.woocommerce form #billing_phone,
.woocommerce form #billing_tc_no,
.woocommerce form #billing_tax_no {
	letter-spacing: 0.04em;
}

/* ---------- Order summary card: payment methods, terms and button inside it ---------- */

/* The payment block sits under the order table inside the same card: no extra indent */
.e-con:has( > .elementor-widget-wd_checkout_payment_methods ) {
	margin-top: 4px;
	padding: 0 !important;
}

.e-con:has( > .elementor-widget-wd_checkout_payment_methods ) .woodmart-title-container {
	margin: 0;
	font-size: 20px !important;
	font-weight: 700;
	text-transform: none;
}

.e-con:has( > .elementor-widget-wd_checkout_payment_methods ) .title-wrapper {
	margin-bottom: 12px !important;
}

#payment {
	background: transparent;
}

#payment ul.wc_payment_methods {
	display: grid;
	gap: 10px;
	margin: 0 0 16px;
	padding: 0;
	border: 0;
	list-style: none;
}

#payment li.wc_payment_method {
	margin: 0;
	padding: 14px 16px;
	border: 1.5px solid var(--kor-border);
	border-radius: 12px;
	background: var(--kor-surface-2, #242424);
	transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s;
}

#payment li.wc_payment_method > label {
	margin: 0;
	font-weight: 600;
	color: var(--kor-text);
	cursor: pointer;
}

#payment li.wc_payment_method:has( input.input-radio:checked ) {
	border-color: var(--kor-accent);
	background: var(--kor-accent-soft);
	box-shadow: 0 0 0 3px rgba(243, 87, 29, 0.1);
}

#payment div.payment_box {
	margin: 10px 0 0;
	padding: 12px 14px;
	border: 0;
	border-radius: 8px;
	background: var(--kor-surface-2, #242424);
	color: var(--kor-muted);
	font-size: 13.5px;
	line-height: 1.5;
}

#payment div.payment_box::before {
	display: none;
}

#payment .form-row.place-order {
	margin: 0;
	padding: 0;
}

#payment .woocommerce-privacy-policy-text {
	margin: 0 0 14px;
	color: var(--kor-muted);
	font-size: 12.5px;
	line-height: 1.5;
}

/* Terms box */
#payment .woocommerce-terms-and-conditions-wrapper .validate-required {
	margin: 0 0 16px;
	padding: 12px 14px;
	border: 1.5px solid var(--kor-border);
	border-radius: 10px;
	background: var(--kor-surface-2, #242424);
}

#payment .woocommerce-terms-and-conditions-wrapper label {
	margin: 0;
	font-size: 13.5px;
	line-height: 1.5;
	cursor: pointer;
}

#payment .woocommerce-terms-and-conditions-wrapper a {
	color: var(--kor-accent);
	font-weight: 600;
	text-decoration: underline;
}

/* Place order button: full width, prominent */
#payment #place_order {
	display: block;
	width: 100%;
	min-height: 52px;
	border-radius: 10px;
	font-size: 15px;
	font-weight: 700;
	letter-spacing: 0.03em;
	text-transform: uppercase;
}

@media (max-width: 575px) {
	.kor-invoice-type .woocommerce-input-wrapper {
		grid-template-columns: 1fr;
	}
}
