/* ─── FlexDeposit Frontend Styles ───────────────────────────────────────────
   Aesthetic: Clean financial — precise grid, cool neutrals, indigo accent
   Fonts: inherit from theme / WooCommerce
   ─────────────────────────────────────────────────────────────────────────── */

:root {
	--fdw-accent:      #6366f1;
	--fdw-accent-dark: #4f46e5;
	--fdw-accent-light: #eef2ff;
	--fdw-success:     #10b981;
	--fdw-warn:        #f59e0b;
	--fdw-danger:      #ef4444;
	--fdw-text:        #111827;
	--fdw-muted:       #6b7280;
	--fdw-border:      #e5e7eb;
	--fdw-bg:          #f9fafb;
	--fdw-radius:      10px;
	--fdw-card-radius: 12px;
	--fdw-shadow:      0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
	--fdw-shadow-md:   0 4px 16px rgba(0,0,0,0.10);
	--fdw-transition:  0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Wrapper ────────────────────────────────────────────────────────────── */
.fdw-selector-wrap {
	margin: 24px 0 28px;
	font-family: inherit;
}

/* ─── Section Header ─────────────────────────────────────────────────────── */
.fdw-section-header {
	display: flex;
	align-items: baseline;
	gap: 10px;
	margin-bottom: 14px;
}

.fdw-section-label {
	font-size: 16px;
	font-weight: 700;
	color: var(--fdw-text);
	letter-spacing: -0.015em;
}

.fdw-section-sub {
	font-size: 13px;
	color: var(--fdw-muted);
}

/* ─── Cards Grid ─────────────────────────────────────────────────────────── */
.fdw-cards {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 12px;
	margin-bottom: 14px;
}

/* ─── Card ───────────────────────────────────────────────────────────────── */
.fdw-card {
	position: relative;
	background: #fff;
	border: 2px solid var(--fdw-border);
	border-radius: var(--fdw-card-radius);
	padding: 18px 16px 16px;
	cursor: pointer;
	transition: border-color var(--fdw-transition),
	            box-shadow var(--fdw-transition),
	            transform var(--fdw-transition);
	outline: none;
	user-select: none;
	overflow: hidden;
}

.fdw-card:hover {
	border-color: #a5b4fc;
	box-shadow: var(--fdw-shadow-md);
	transform: translateY(-2px);
}

.fdw-card:focus-visible {
	outline: 2px solid var(--fdw-accent);
	outline-offset: 2px;
}

/* Active / Selected state */
.fdw-card.fdw-card--active {
	border-color: var(--fdw-accent);
	background: var(--fdw-accent-light);
	box-shadow: 0 0 0 1px var(--fdw-accent), var(--fdw-shadow-md);
	transform: translateY(-2px);
}

/* ─── Card: Badge ────────────────────────────────────────────────────────── */
.fdw-card__badge {
	display: inline-block;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	padding: 3px 8px;
	border-radius: 20px;
	margin-bottom: 10px;
	background: var(--fdw-bg);
	color: var(--fdw-muted);
}

.fdw-badge--popular {
	background: #fef3c7;
	color: #92400e;
}

.fdw-badge--full {
	background: #f0fdf4;
	color: #166534;
}

.fdw-badge--deposit {
	background: var(--fdw-accent-light);
	color: var(--fdw-accent-dark);
}

.fdw-badge--custom {
	background: #fce7f3;
	color: #9d174d;
}

/* ─── Card: Percentage ───────────────────────────────────────────────────── */
.fdw-card__pct {
	font-size: 36px;
	font-weight: 800;
	color: var(--fdw-text);
	line-height: 1;
	letter-spacing: -0.04em;
	margin-bottom: 12px;
}

.fdw-card__pct span {
	font-size: 18px;
	font-weight: 600;
	color: var(--fdw-muted);
}

.fdw-card--active .fdw-card__pct {
	color: var(--fdw-accent-dark);
}

/* ─── Card: Row ──────────────────────────────────────────────────────────── */
.fdw-card__row {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 6px;
	margin-top: 6px;
}

.fdw-card__row--muted {
	color: var(--fdw-muted);
	font-size: 12px;
	font-style: italic;
}

.fdw-card__lbl {
	font-size: 12px;
	color: var(--fdw-muted);
	line-height: 1.3;
	flex: 1;
}

.fdw-card__lbl--balance {
	color: var(--fdw-warn);
}

.fdw-card__amt {
	font-size: 14px;
	font-weight: 700;
	color: var(--fdw-text);
	white-space: nowrap;
}

.fdw-card__amt--balance {
	color: var(--fdw-warn);
}

/* ─── Card: Check Icon ───────────────────────────────────────────────────── */
.fdw-card__check {
	position: absolute;
	top: 12px;
	right: 12px;
	width: 20px;
	height: 20px;
	color: var(--fdw-accent);
	opacity: 0;
	transform: scale(0.6) rotate(-15deg);
	transition: opacity var(--fdw-transition), transform var(--fdw-transition);
}

.fdw-card.fdw-card--active .fdw-card__check {
	opacity: 1;
	transform: scale(1) rotate(0deg);
}

/* ─── Custom Card: Slider ────────────────────────────────────────────────── */
.fdw-card__slider-wrap {
	margin: 8px 0 4px;
}

.fdw-slider {
	-webkit-appearance: none;
	appearance: none;
	width: 100%;
	height: 4px;
	border-radius: 2px;
	background: var(--fdw-border);
	outline: none;
	cursor: pointer;
	transition: background var(--fdw-transition);
}

.fdw-card--active .fdw-slider {
	background: #c7d2fe;
}

.fdw-slider::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: var(--fdw-accent);
	cursor: pointer;
	box-shadow: 0 1px 4px rgba(99, 102, 241, 0.4);
	transition: transform var(--fdw-transition);
}

.fdw-slider::-webkit-slider-thumb:hover {
	transform: scale(1.2);
}

.fdw-slider::-moz-range-thumb {
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: var(--fdw-accent);
	border: none;
	cursor: pointer;
}

.fdw-slider-range-labels {
	display: flex;
	justify-content: space-between;
	font-size: 10px;
	color: var(--fdw-muted);
	margin-top: 4px;
}

/* ─── Summary Bar ────────────────────────────────────────────────────────── */
.fdw-summary {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0;
	background: var(--fdw-text);
	border-radius: var(--fdw-radius);
	padding: 14px 20px;
	margin-top: 4px;
	opacity: 0;
	transform: translateY(8px);
	transition: opacity 0.3s ease, transform 0.3s ease;
}

.fdw-summary.is-visible {
	opacity: 1;
	transform: translateY(0);
}

.fdw-summary__col {
	text-align: center;
	flex: 1;
}

.fdw-summary__label {
	display: block;
	font-size: 10px;
	color: rgba(255,255,255,0.5);
	text-transform: uppercase;
	letter-spacing: 0.07em;
	margin-bottom: 4px;
}

.fdw-summary__val {
	display: block;
	font-size: 16px;
	font-weight: 800;
	color: #fff;
	letter-spacing: -0.02em;
}

.fdw-summary__val--total {
	color: #a5f3fc;
}

.fdw-summary__sep {
	color: rgba(255,255,255,0.2);
	font-size: 20px;
	font-weight: 300;
	padding: 0 12px;
}

/* ─── Trust Line ─────────────────────────────────────────────────────────── */
.fdw-trust-line {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 10px 0 0;
	font-size: 12px;
	color: var(--fdw-muted);
}

.fdw-trust-line svg {
	width: 12px;
	height: 12px;
	color: var(--fdw-warn);
	flex-shrink: 0;
}

/* ─── Cart Item Display ──────────────────────────────────────────────────── */
.fdw-cart-deposit-price {
	font-weight: 700;
}

.fdw-cart-deposit-note {
	font-size: 12px;
	color: var(--fdw-muted);
}

/* ─── Thank You Notice ───────────────────────────────────────────────────── */
.fdw-thankyou-notice {
	display: flex;
	gap: 16px;
	align-items: flex-start;
	background: var(--fdw-accent-light);
	border: 2px solid #c7d2fe;
	border-radius: 12px;
	padding: 24px;
	margin: 24px 0;
}

.fdw-thankyou-notice__icon {
	width: 40px;
	height: 40px;
	background: var(--fdw-accent);
	border-radius: 50%;
	color: #fff;
	font-size: 20px;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.fdw-thankyou-notice__body h3 {
	margin: 0 0 8px;
	font-size: 18px;
	color: var(--fdw-accent-dark);
}

.fdw-thankyou-notice__body p {
	margin: 0 0 12px;
	color: #374151;
	font-size: 14px;
	line-height: 1.6;
}

.fdw-pay-balance-btn {
	display: inline-block;
	background: var(--fdw-accent) !important;
	color: #fff !important;
	padding: 10px 22px;
	border-radius: 8px;
	font-weight: 700;
	font-size: 14px;
	text-decoration: none;
	border: none;
	transition: background var(--fdw-transition);
}

.fdw-pay-balance-btn:hover {
	background: var(--fdw-accent-dark) !important;
}

/* ─── Order Details ──────────────────────────────────────────────────────── */
.fdw-order-deposit-info {
	background: var(--fdw-bg);
	border: 1px solid var(--fdw-border);
	border-radius: 10px;
	padding: 20px;
	margin-top: 24px;
}

.fdw-order-deposit-info h3 {
	margin: 0 0 12px;
	font-size: 15px;
	color: var(--fdw-text);
}

.fdw-order-deposit-info table {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: 14px;
}

.fdw-order-deposit-info th,
.fdw-order-deposit-info td {
	padding: 8px 0;
	border-bottom: 1px solid var(--fdw-border);
	font-size: 14px;
}

.fdw-order-deposit-info th {
	color: var(--fdw-muted);
	font-weight: 500;
	text-align: left;
	width: 40%;
}

.fdw-status-badge {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 20px;
	font-size: 12px;
	font-weight: 600;
	background: #f3f4f6;
	color: #374151;
}

.fdw-status-badge.pending,
.fdw-status-badge.balance-pending {
	background: #fef3c7;
	color: #92400e;
}

.fdw-status-badge.processing,
.fdw-status-badge.completed {
	background: #d1fae5;
	color: #065f46;
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
	.fdw-cards {
		grid-template-columns: 1fr 1fr;
		gap: 10px;
	}

	.fdw-card__pct {
		font-size: 28px;
	}

	.fdw-summary {
		flex-wrap: wrap;
		gap: 8px;
	}

	.fdw-summary__sep {
		display: none;
	}

	.fdw-summary__col {
		flex: 0 0 calc(50% - 8px);
	}

	.fdw-section-header {
		flex-direction: column;
		gap: 4px;
	}
}

@media (max-width: 400px) {
	.fdw-cards {
		grid-template-columns: 1fr;
	}
}

/* ─── Animations ─────────────────────────────────────────────────────────── */
@keyframes fdw-pop-in {
	0%   { opacity: 0; transform: scale(0.92) translateY(4px); }
	100% { opacity: 1; transform: scale(1) translateY(0); }
}

.fdw-selector-wrap {
	animation: fdw-pop-in 0.3s ease both;
}

/* ─── My Account: Balance Payment CTA ────────────────────────────────────── */
.fdw-balance-cta {
	background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
	color: #fff;
	border-radius: 12px;
	padding: 28px;
	margin: 24px 0;
	box-shadow: 0 10px 25px -5px rgba(99, 102, 241, 0.35);
}

.fdw-balance-cta__header {
	margin-bottom: 16px;
}

.fdw-balance-cta__eyebrow {
	display: inline-block;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	font-size: 11px;
	font-weight: 700;
	padding: 3px 10px;
	background: rgba(255, 255, 255, 0.2);
	border-radius: 20px;
	margin-bottom: 10px;
}

.fdw-balance-cta__title {
	margin: 0;
	font-size: 22px;
	font-weight: 700;
	color: #fff;
}

.fdw-balance-cta__amount {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	padding: 16px 0;
	border-top: 1px solid rgba(255, 255, 255, 0.2);
	border-bottom: 1px solid rgba(255, 255, 255, 0.2);
	margin-bottom: 14px;
}

.fdw-balance-cta__amount-label {
	font-size: 14px;
	color: rgba(255, 255, 255, 0.85);
}

.fdw-balance-cta__amount-value {
	font-size: 28px;
	font-weight: 800;
	color: #fff;
}

.fdw-balance-cta__amount-value .woocommerce-Price-currencySymbol {
	margin-right: 2px;
}

.fdw-balance-cta__due {
	font-size: 14px;
	color: rgba(255, 255, 255, 0.88);
	margin: 0 0 16px;
}

.fdw-balance-cta__btn {
	display: inline-block !important;
	background: #fff !important;
	color: #4f46e5 !important;
	font-weight: 700 !important;
	font-size: 15px !important;
	padding: 14px 28px !important;
	border-radius: 8px !important;
	text-decoration: none !important;
	border: none !important;
	transition: all 0.2s;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.fdw-balance-cta__btn:hover,
.fdw-balance-cta__btn:focus {
	background: #f9fafb !important;
	color: #4338ca !important;
	transform: translateY(-1px);
	box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.fdw-balance-cta__note {
	font-size: 12px;
	color: rgba(255, 255, 255, 0.75);
	margin: 12px 0 0;
}

/* Paid variant */
.fdw-balance-cta--paid {
	background: linear-gradient(135deg, #10b981 0%, #059669 100%);
	display: flex;
	align-items: center;
	gap: 16px;
	box-shadow: 0 10px 25px -5px rgba(16, 185, 129, 0.35);
}

.fdw-balance-cta__icon {
	width: 48px;
	height: 48px;
	background: rgba(255, 255, 255, 0.25);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 24px;
	font-weight: 700;
	flex-shrink: 0;
}

/* ─── My Account: "Pay Balance" action button ───────────────────────────── */
.woocommerce-orders-table .woocommerce-button.fdw_pay_balance,
.woocommerce .woocommerce-button.fdw_pay_balance {
	background: #4f46e5 !important;
	color: #fff !important;
	border: none !important;
	font-weight: 600 !important;
}

.woocommerce-orders-table .woocommerce-button.fdw_pay_balance:hover,
.woocommerce .woocommerce-button.fdw_pay_balance:hover {
	background: #4338ca !important;
	color: #fff !important;
}

/* ─── My Account: Balance-order banner (shown on the balance order view) ── */
.fdw-balance-order-banner {
	display: flex;
	align-items: center;
	gap: 16px;
	background: #fef3c7;
	border: 1px solid #fcd34d;
	border-left: 4px solid #d97706;
	border-radius: 10px;
	padding: 16px 20px;
	margin: 24px 0;
}

.fdw-balance-order-banner__icon {
	font-size: 28px;
	line-height: 1;
	flex-shrink: 0;
}

.fdw-balance-order-banner__body {
	flex: 1;
}

.fdw-balance-order-banner__body h4 {
	margin: 0 0 4px;
	font-size: 15px;
	font-weight: 700;
	color: #92400e;
}

.fdw-balance-order-banner__body p {
	margin: 0;
	font-size: 13px;
	color: #78350f;
}

.fdw-balance-order-banner__body a {
	color: #78350f;
	font-weight: 600;
	text-decoration: underline;
}

.fdw-balance-order-banner__btn {
	flex-shrink: 0;
}

/* ─── CTA actions row (pay button + view link) ─────────────────────────── */
.fdw-balance-cta__actions {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 16px;
}

.fdw-balance-cta__view {
	color: rgba(255, 255, 255, 0.85) !important;
	text-decoration: underline !important;
	font-size: 13px !important;
	font-weight: 500 !important;
}

.fdw-balance-cta__view:hover {
	color: #fff !important;
}
