/**
 * DROIX Preorders & Deposits - Product Page Styles
 *
 * The base component inherits theme type and spacing. The DroiX skin sets the
 * current site's product-card treatment through scoped CSS custom properties.
 */

.cwdp-payment-options {
	display: none;
	margin: 18px 0 0;
}

.cwdp-payment-options[style*="display:block"],
.cwdp-payment-options[style*="display: block"],
.cwdp-payment-options.cwdp-visible {
	display: block;
}

.cwdp-deposit-ui,
.cwdp-deposit-ui * {
	box-sizing: border-box;
}

.cwdp-deposit-ui {
	--cwdp-accent: currentColor;
	--cwdp-accent-dark: currentColor;
	--cwdp-selected-bg: color-mix(in srgb, currentColor 8%, transparent);
	--cwdp-border: rgba(0, 0, 0, 0.18);
	--cwdp-muted-border: rgba(0, 0, 0, 0.12);
	--cwdp-panel-bg: rgba(0, 0, 0, 0.04);
	--cwdp-text: inherit;
	--cwdp-muted: currentColor;
	--cwdp-radius: 8px;
	--cwdp-pill-radius: 999px;
	--cwdp-ui-font: inherit;
	--cwdp-body-font: inherit;
	color: var(--cwdp-text);
	font-family: var(--cwdp-body-font);
}

.cwdp-skin-droix {
	--cwdp-accent: #B0CB1F;
	--cwdp-accent-dark: #74A401;
	--cwdp-selected-bg: #F3F8DC;
	--cwdp-border: #D9D9D9;
	--cwdp-muted-border: #F0F0F0;
	--cwdp-panel-bg: #F8F8F8;
	--cwdp-text: #242421;
	--cwdp-muted: #666;
	--cwdp-radius: 16px;
	--cwdp-ui-font: Ubuntu, system-ui, sans-serif;
	--cwdp-body-font: Inter, system-ui, sans-serif;
}

.cwdp-additional-text {
	margin-bottom: 14px;
}

body.single-product #right-summary-section {
	container-type: inline-size;
}

.cwdp-payment-fieldset {
	min-width: 0;
	min-inline-size: 0;
	border: 0;
	border-top: 1px solid var(--cwdp-muted-border);
	margin: 0;
	padding: 20px 0 0;
}

.cwdp-payment-method-title {
	display: block;
	width: 100%;
	padding: 0;
	margin: 0 0 14px;
	font-family: var(--cwdp-ui-font);
	font-size: 16px;
	font-weight: 700;
	line-height: 1.25;
	color: var(--cwdp-text);
}

.cwdp-payment-variants {
	display: flex;
	flex-direction: column;
	gap: 10px;
	min-width: 0;
	margin: 0;
}

.cwdp-payment-variants > input[type="radio"] {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
	pointer-events: none;
}

.cwdp-payment-option {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	min-width: 0;
	min-height: 58px;
	padding: 14px 12px;
	margin: 0;
	border: 2px solid var(--cwdp-border);
	border-radius: var(--cwdp-radius);
	background: #fff;
	color: var(--cwdp-text);
	cursor: pointer;
	transition: border-color 0.15s ease, background-color 0.15s ease;
}

.cwdp-payment-option:hover {
	border-color: var(--cwdp-accent);
}

.cwdp-payment-variants > input[type="radio"]:checked + .cwdp-payment-option,
.cwdp-payment-option.cwdp-card-selected {
	border-color: var(--cwdp-accent);
	background: var(--cwdp-selected-bg);
}

.cwdp-payment-variants > input[type="radio"]:focus-visible + .cwdp-payment-option {
	outline: 2px solid var(--cwdp-accent-dark);
	outline-offset: 2px;
}

.cwdp-radio {
	width: 22px;
	height: 22px;
	flex: 0 0 22px;
	border: 3px solid var(--cwdp-border);
	border-radius: 50%;
	background: #fff;
}

.cwdp-payment-variants > input[type="radio"]:checked + .cwdp-payment-option .cwdp-radio,
.cwdp-payment-option.cwdp-card-selected .cwdp-radio {
	border: 7px solid var(--cwdp-accent-dark);
}

.cwdp-payment-option-text {
	display: flex;
	align-items: center;
	gap: 8px;
	min-width: 0;
	flex: 1 1 auto;
	font-family: var(--cwdp-ui-font);
	font-size: 15px;
	font-weight: 700;
	line-height: 1.25;
}

.cwdp-option-label {
	min-width: 0;
	white-space: nowrap;
}

.cwdp-option-amount {
	flex: 0 0 auto;
	margin-left: auto;
	font-family: var(--cwdp-ui-font);
	font-size: 17px;
	font-weight: 700;
	line-height: 1;
	color: #0B0B0B;
	white-space: nowrap;
}

.cwdp-reserve-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 3px 7px;
	border: 1px solid var(--cwdp-accent);
	border-radius: var(--cwdp-pill-radius);
	background: #fff;
	color: var(--cwdp-accent-dark);
	font-family: var(--cwdp-ui-font);
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.08em;
	line-height: 1;
	text-transform: uppercase;
	white-space: nowrap;
}

.cwdp-deposit-ui .cwdp-dates-container {
	display: none;
	flex-direction: column;
	gap: 14px;
	margin: 18px 0 0;
	padding: 16px 18px;
	border-radius: var(--cwdp-radius);
	background: var(--cwdp-panel-bg);
}

.cwdp-deposit-ui .cwdp-dates-container.cwdp-has-dates {
	display: none;
}

.cwdp-deposit-ui.is-deposit .cwdp-dates-container.cwdp-has-dates {
	display: flex;
}

/* Preorder ship date stays visible even on "Pay in full". */
.cwdp-deposit-ui .cwdp-dates-container.cwdp-has-ship-date {
	display: flex;
}

/* The balance-due row is only relevant when paying a deposit. */
.cwdp-deposit-ui:not(.is-deposit) .cwdp-dates-container .cwdp-partial-pay-date {
	display: none;
}

.cwdp-date-row {
	display: none;
	align-items: center;
	gap: 12px;
	width: 100%;
}

.cwdp-date-row.cwdp-has-date {
	display: flex;
}

.cwdp-date-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	flex: 0 0 34px;
	border: 1px solid var(--cwdp-muted-border);
	border-radius: 10px;
	background: #fff;
	color: var(--cwdp-accent-dark);
}

.cwdp-date-icon svg {
	width: 18px;
	height: 18px;
}

.cwdp-date-label {
	min-width: 0;
	flex: 1 1 auto;
	font-family: var(--cwdp-body-font);
	font-size: 15px;
	font-weight: 400;
	line-height: 1.3;
	color: #484848;
}

.cwdp-date-value {
	flex: 0 0 auto;
	font-family: var(--cwdp-ui-font);
	font-size: 15px;
	font-weight: 700;
	line-height: 1.2;
	color: var(--cwdp-text);
	text-align: right;
	white-space: nowrap;
}

.cwdp-balance-amount {
	white-space: nowrap;
}

body.single-product form.cart:has(.cwdp-deposit-ui) .payment-icons {
	margin: 20px 0 16px;
}

body.single-product form.cart.cwdp-deposit-selected .single_add_to_cart_button {
	height: 64px !important;
	min-height: 64px;
}

body.single-product form.cart .single_add_to_cart_button .cwdp-button-deposit,
body.single-product form.cart .single_add_to_cart_button .cwdp-button-main {
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

body.single-product form.cart .single_add_to_cart_button .cwdp-button-deposit {
	flex-direction: column;
	gap: 4px;
	line-height: 1.1;
}

body.single-product form.cart .single_add_to_cart_button .cwdp-button-main {
	gap: 8px;
	font-size: inherit;
	font-weight: inherit;
	white-space: nowrap;
}

body.single-product form.cart .single_add_to_cart_button .cwdp-button-main img {
	width: 24px;
	height: 24px;
	flex: 0 0 auto;
}

body.single-product form.cart .single_add_to_cart_button .cwdp-button-sub {
	display: block;
	font-family: var(--cwdp-body-font);
	font-size: 12px;
	font-weight: 600;
	line-height: 1.1;
	opacity: 0.95;
	white-space: nowrap;
}

@container (max-width: 420px) {
	.cwdp-payment-options {
		margin: 18px 20px 0;
	}

	.cwdp-payment-option {
		gap: 6px;
		min-height: 56px;
		padding: 12px 8px;
	}

	.cwdp-radio {
		width: 18px;
		height: 18px;
		flex-basis: 18px;
	}

	.cwdp-payment-variants > input[type="radio"]:checked + .cwdp-payment-option .cwdp-radio,
	.cwdp-payment-option.cwdp-card-selected .cwdp-radio {
		border-width: 5px;
	}

	.cwdp-payment-option-text {
		gap: 5px;
		font-size: 12px;
	}

	.cwdp-option-amount {
		font-size: 14px;
	}

	.cwdp-reserve-badge {
		padding: 3px 5px;
		font-size: 7px;
		letter-spacing: 0.02em;
	}
}

@media (max-width: 480px) {
	.cwdp-payment-option {
		min-height: 56px;
		padding: 12px 10px;
		gap: 8px;
	}

	.cwdp-payment-option-text {
		flex-wrap: nowrap;
		gap: 6px;
		font-size: 14px;
	}

	.cwdp-option-amount {
		font-size: 15px;
	}

	.cwdp-reserve-badge {
		padding: 3px 7px;
		font-size: 9px;
		letter-spacing: 0.06em;
	}

	.cwdp-dates-container {
		padding: 14px;
	}

	.cwdp-date-label,
	.cwdp-date-value {
		font-size: 14px;
	}

}
