/**
 * Daela Helper — Payment Plan storefront styles.
 *
 * Brand palette: rust #AC6B53, tan #C7A485, olive #9D986F, cool gray #7B8794.
 *
 * The picker is a card-style dropdown:
 *   - Closed state: only the .is-selected card is visible. It has a chevron
 *     pointing down. Clicking expands the picker.
 *   - Open state: all cards visible. Chevron rotates up. Clicking any card
 *     selects it and collapses the picker.
 *
 * Cards are rendered as <button> elements so they're keyboard-focusable and
 * the entire card surface is clickable.
 */

/* ========================================================================
   Outer container — bordered fieldset wrapping the picker
   ====================================================================== */

.dh-pp-options {
	margin: 24px 0;
	padding: 16px 18px 12px;
	border: 1px solid #e6e2db;
	border-radius: 10px;
	background: #fdfcfa;
}

.dh-pp-options-legend {
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: #7b8794;
	margin: 0 0 12px;
	padding: 0 4px;
	float: none;
	width: auto;
	display: block;
}

/* ========================================================================
   Picker container — holds the cards
   ====================================================================== */

.dh-pp-picker {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

/* Closed state: hide every card except the selected one. */
.dh-pp-picker.is-closed .dh-pp-card:not(.is-selected) {
	display: none;
}

/* ========================================================================
   Card — used for both the trigger (selected) and dropdown options
   ====================================================================== */

.dh-pp-card {
	display: flex;
	align-items: flex-start;
	gap: 14px;
	width: 100%;
	padding: 16px 18px;
	margin: 0;
	cursor: pointer;
	background: #fff;
	border: 2px solid #e6e2db;
	border-radius: 8px;
	text-align: left;
	font: inherit;
	color: inherit;
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.dh-pp-card:hover {
	border-color: #c7a485;
	box-shadow: 0 2px 10px rgba(172, 107, 83, 0.08);
}

.dh-pp-card:focus-visible {
	outline: none;
	border-color: #ac6b53;
	box-shadow: 0 0 0 3px rgba(172, 107, 83, 0.18);
}

/* Selected card — rust accent, warm cream background, soft shadow. */
.dh-pp-card.is-selected {
	border-color: #ac6b53;
	background: #fdf6f1;
	box-shadow: 0 2px 14px rgba(172, 107, 83, 0.15);
}

.dh-pp-card.is-selected:hover {
	box-shadow: 0 2px 18px rgba(172, 107, 83, 0.20);
}

/* ========================================================================
   Card content
   ====================================================================== */

.dh-pp-card-body {
	display: flex;
	flex-direction: column;
	gap: 4px;
	flex: 1;
	min-width: 0;
}

.dh-pp-card-row {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 12px;
	flex-wrap: wrap;
}

.dh-pp-card-title {
	font-weight: 600;
	font-size: 15px;
	line-height: 1.3;
	color: #2a2a2a;
}

.dh-pp-card-headline {
	font-size: 16px;
	font-weight: 600;
	color: #ac6b53;
	white-space: nowrap;
}

.dh-pp-card-headline .woocommerce-Price-amount {
	color: inherit;
}

.dh-pp-card-sub {
	font-size: 13px;
	color: #7b8794;
	line-height: 1.4;
}

.dh-pp-card-schedule {
	display: flex;
	flex-direction: column;
	gap: 2px;
	margin-top: 8px;
	padding-top: 10px;
	border-top: 1px solid #f0ebe3;
}

.dh-pp-installment {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 12px;
	font-size: 13px;
	padding: 3px 0;
}

.dh-pp-installment-label {
	color: #7b8794;
	flex: 1;
	min-width: 0;
}

.dh-pp-installment-amount {
	color: #ac6b53;
	font-weight: 500;
	white-space: nowrap;
}

.dh-pp-installment-amount .woocommerce-Price-amount {
	color: inherit;
}

/* ========================================================================
   Chevron — only visible on the selected card; rotates when picker opens
   ====================================================================== */

.dh-pp-chevron {
	width: 12px;
	height: 12px;
	flex-shrink: 0;
	border-right: 2px solid #ac6b53;
	border-bottom: 2px solid #ac6b53;
	transform: rotate(45deg) translate(-2px, -2px);
	transition: transform 0.2s ease;
	margin-top: 6px;
	opacity: 0;
}

.dh-pp-card.is-selected .dh-pp-chevron {
	opacity: 1;
}

.dh-pp-picker.is-open .dh-pp-card.is-selected .dh-pp-chevron {
	transform: rotate(-135deg) translate(-2px, -2px);
}

/* ========================================================================
   Notice
   ====================================================================== */

.dh-pp-notice {
	font-size: 12px;
	color: #7b8794;
	line-height: 1.5;
	margin: 12px 0 0;
}

/* Mobile */
@media (max-width: 480px) {
	.dh-pp-options { padding: 14px; }
	.dh-pp-card { padding: 14px; gap: 12px; }
	.dh-pp-card-title { font-size: 14px; }
	.dh-pp-card-headline { font-size: 15px; }
}

/* ========================================================================
   Cart / checkout / order email — "Payment Plan" badge after product name
   ====================================================================== */

.dh-pp-cart-badge {
	display: inline-block;
	margin-left: 8px;
	padding: 2px 8px;
	font-size: 10px;
	font-weight: 600;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: #ac6b53;
	background: #fdf6f1;
	border: 1px solid #e6d4c8;
	border-radius: 10px;
	vertical-align: middle;
	line-height: 1.4;
	white-space: nowrap;
}

.cfw-order-summary .dh-pp-cart-badge,
.cfw-side-cart .dh-pp-cart-badge {
	margin-left: 6px;
	padding: 1px 6px;
	font-size: 9px;
}
