/* Payment Plan Breakdown Table Styles - Modern Elegant Design */

:root {
	--ppbd-primary: #0073aa;
	--ppbd-primary-dark: #005a87;
	--ppbd-success: #28a745;
	--ppbd-text: #2c3e50;
	--ppbd-text-light: #7f8c8d;
	--ppbd-border: #ecf0f1;
	--ppbd-bg-light: #f8f9fa;
}

.ppbd-payment-plan-container {
	background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
	border: none;
	border-radius: 10px;
	padding: 0;
	margin-top: 20px;
	margin-bottom: 15px;
	box-shadow: 0 4px 15px rgba(0, 115, 170, 0.08);
	overflow: hidden;
	animation: slideDown 0.3s ease-out;
	max-width: 100%;
}

@keyframes slideDown {
	from {
		opacity: 0;
		transform: translateY(-8px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.ppbd-payment-plan-container h3 {
	margin: 0;
	color: #ffffff;
	font-size: 16px;
	font-weight: 700;
	letter-spacing: 0.4px;
	padding: 14px 18px;
	background: linear-gradient(135deg, var(--ppbd-primary) 0%, var(--ppbd-primary-dark) 100%);
	border-bottom: none;
	display: flex;
	align-items: center;
	gap: 8px;
}

.ppbd-payment-plan-container h3::before {
	content: '📊';
	font-size: 18px;
}

.ppbd-summary {
	background: #ffffff;
	padding: 16px 18px;
	border-radius: 0;
	margin-bottom: 0;
	border-left: none;
}

.ppbd-summary-item {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 12px 12px;
	margin: 0;
	border-bottom: 1px solid var(--ppbd-border);
	gap: 10px;
	transition: all 0.2s ease;
	border-radius: 6px;
	margin-bottom: 4px;
}

.ppbd-summary-item:hover {
	background: linear-gradient(90deg, rgba(0, 115, 170, 0.02) 0%, rgba(0, 115, 170, 0.03) 100%);
	padding: 12px 14px;
	transform: translateX(2px);
}

.ppbd-summary-item:last-child {
	border-bottom: none;
	margin-bottom: 0;
}

.ppbd-summary-item strong {
	color: var(--ppbd-text-light);
	font-weight: 600;
	text-align: left;
	font-size: 13px;
	letter-spacing: 0.2px;
	flex: 1;
	display: flex;
	align-items: center;
	gap: 6px;
}

.ppbd-summary-item .ppbd-value {
	color: var(--ppbd-primary);
	font-weight: 700;
	text-align: right;
	min-width: 100px;
	font-size: 14px;
	padding: 6px 12px;
	background: linear-gradient(135deg, rgba(0, 115, 170, 0.08) 0%, rgba(0, 115, 170, 0.04) 100%);
	border-radius: 6px;
	display: inline-block;
	flex-shrink: 0;
	border: 1px solid rgba(0, 115, 170, 0.1);
	transition: all 0.2s ease;
}

.ppbd-summary-item:hover .ppbd-value {
	background: linear-gradient(135deg, rgba(0, 115, 170, 0.12) 0%, rgba(0, 115, 170, 0.08) 100%);
	border-color: rgba(0, 115, 170, 0.2);
	box-shadow: 0 2px 8px rgba(0, 115, 170, 0.1);
}

/* LTR Direction (English) */
[dir="ltr"] .ppbd-summary-item {
	flex-direction: row;
	justify-content: space-between;
}

[dir="ltr"] .ppbd-summary-item strong {
	text-align: left;
	margin-right: 0;
	margin-left: 0;
}

[dir="ltr"] .ppbd-summary-item .ppbd-value {
	text-align: right;
	margin-left: auto;
}

.ppbd-summary-item.ppbd-total-amount {
	background: linear-gradient(90deg, rgba(40, 167, 69, 0.04) 0%, rgba(40, 167, 69, 0.02) 100%);
	padding: 13px 12px;
	border: 1px solid rgba(40, 167, 69, 0.15);
	margin: 6px 0;
	border-radius: 8px;
}

.ppbd-summary-item.ppbd-total-amount strong {
	color: var(--ppbd-text);
	font-weight: 700;
	font-size: 13px;
}

.ppbd-summary-item.ppbd-total-amount strong::before {
	content: '💰';
	font-size: 14px;
}

.ppbd-summary-item.ppbd-total-amount .ppbd-value {
	color: var(--ppbd-success);
	background: linear-gradient(135deg, rgba(40, 167, 69, 0.12) 0%, rgba(40, 167, 69, 0.08) 100%);
	font-size: 15px;
	font-weight: 800;
	border: 1px solid rgba(40, 167, 69, 0.2);
	box-shadow: 0 2px 6px rgba(40, 167, 69, 0.1);
}

.ppbd-summary-item.ppbd-total-amount:hover {
	background: linear-gradient(90deg, rgba(40, 167, 69, 0.06) 0%, rgba(40, 167, 69, 0.03) 100%);
	border-color: rgba(40, 167, 69, 0.25);
}

.ppbd-summary-item.ppbd-total-amount:hover .ppbd-value {
	background: linear-gradient(135deg, rgba(40, 167, 69, 0.15) 0%, rgba(40, 167, 69, 0.1) 100%);
	border-color: rgba(40, 167, 69, 0.3);
	box-shadow: 0 3px 10px rgba(40, 167, 69, 0.15);
}

.ppbd-summary-item.ppbd-monthly-payment {
	background: linear-gradient(90deg, rgba(0, 115, 170, 0.04) 0%, rgba(0, 115, 170, 0.02) 100%);
	padding: 13px 12px;
	border: 1px solid rgba(0, 115, 170, 0.15);
	margin: 6px 0;
	border-radius: 8px;
}

.ppbd-summary-item.ppbd-monthly-payment strong {
	color: var(--ppbd-text);
	font-weight: 700;
	font-size: 13px;
}

.ppbd-summary-item.ppbd-monthly-payment strong::before {
	content: '📅';
	font-size: 14px;
}

.ppbd-summary-item.ppbd-monthly-payment .ppbd-value {
	color: var(--ppbd-primary);
	background: linear-gradient(135deg, rgba(0, 115, 170, 0.12) 0%, rgba(0, 115, 170, 0.08) 100%);
	font-size: 15px;
	font-weight: 800;
	border: 1px solid rgba(0, 115, 170, 0.2);
	box-shadow: 0 2px 6px rgba(0, 115, 170, 0.1);
}

.ppbd-summary-item.ppbd-monthly-payment:hover {
	background: linear-gradient(90deg, rgba(0, 115, 170, 0.06) 0%, rgba(0, 115, 170, 0.03) 100%);
	border-color: rgba(0, 115, 170, 0.25);
}

.ppbd-summary-item.ppbd-monthly-payment:hover .ppbd-value {
	background: linear-gradient(135deg, rgba(0, 115, 170, 0.15) 0%, rgba(0, 115, 170, 0.1) 100%);
	border-color: rgba(0, 115, 170, 0.3);
	box-shadow: 0 3px 10px rgba(0, 115, 170, 0.15);
}

/* RTL Support (Arabic) */
[dir="rtl"] .ppbd-summary {
	border-left: none;
	border-right: none;
}

[dir="rtl"] .ppbd-summary-item {
	flex-direction: row-reverse;
	justify-content: space-between;
}

[dir="rtl"] .ppbd-summary-item strong {
	text-align: right;
	margin-left: 0;
	margin-right: 0;
}

[dir="rtl"] .ppbd-summary-item .ppbd-value {
	text-align: left;
	margin-left: 0;
	margin-right: auto;
}

/* Tablet Responsive Design */
@media (max-width: 768px) {
	.ppbd-payment-plan-container {
		margin-top: 18px;
		box-shadow: 0 2px 10px rgba(0, 115, 170, 0.06);
	}

	.ppbd-payment-plan-container h3 {
		font-size: 15px;
		padding: 12px 16px;
	}

	.ppbd-summary {
		padding: 14px 16px;
	}

	.ppbd-summary-item {
		padding: 9px 0;
		gap: 8px;
	}

	.ppbd-summary-item strong {
		min-width: 120px;
		font-size: 12px;
	}

	.ppbd-summary-item .ppbd-value {
		min-width: 90px;
		font-size: 13px;
		padding: 4px 8px;
	}

	.ppbd-summary-item.ppbd-total-amount .ppbd-value,
	.ppbd-summary-item.ppbd-monthly-payment .ppbd-value {
		font-size: 14px;
	}

	.ppbd-summary-item:hover {
		padding: 9px 4px;
	}
}

/* Mobile Responsive Design */
@media (max-width: 480px) {
	.ppbd-payment-plan-container {
		margin-top: 15px;
		margin-bottom: 12px;
		box-shadow: 0 2px 8px rgba(0, 115, 170, 0.06);
		border-radius: 8px;
	}

	.ppbd-payment-plan-container h3 {
		font-size: 14px;
		padding: 11px 14px;
		font-weight: 700;
	}

	.ppbd-summary {
		padding: 12px 14px;
	}

	.ppbd-summary-item {
		padding: 8px 0;
		gap: 8px;
		flex-wrap: wrap;
	}

	.ppbd-summary-item strong {
		min-width: 100%;
		text-align: right;
		font-size: 11px;
		color: var(--ppbd-text-light);
		margin-bottom: 3px;
		order: -1;
	}

	.ppbd-summary-item .ppbd-value {
		min-width: 100%;
		font-size: 13px;
		padding: 6px 9px;
		text-align: right;
		background-color: rgba(0, 115, 170, 0.07);
		border-radius: 6px;
	}

	.ppbd-summary-item.ppbd-total-amount {
		padding: 10px 0;
		margin: 3px 0;
	}

	.ppbd-summary-item.ppbd-total-amount .ppbd-value {
		font-size: 14px;
		background-color: rgba(40, 167, 69, 0.09);
		color: var(--ppbd-success);
	}

	.ppbd-summary-item.ppbd-monthly-payment {
		padding: 10px 0;
		margin: 3px 0;
	}

	.ppbd-summary-item.ppbd-monthly-payment .ppbd-value {
		font-size: 14px;
		background-color: rgba(0, 115, 170, 0.09);
		color: var(--ppbd-primary);
	}

	.ppbd-summary-item:hover {
		background-color: transparent;
		padding: 8px 0;
	}
}

/* Extra Small Phones */
@media (max-width: 360px) {
	.ppbd-payment-plan-container h3 {
		font-size: 13px;
		padding: 10px 12px;
	}

	.ppbd-summary {
		padding: 10px 12px;
	}

	.ppbd-summary-item {
		padding: 7px 0;
	}

	.ppbd-summary-item strong {
		font-size: 10px;
		margin-bottom: 2px;
	}

	.ppbd-summary-item .ppbd-value {
		font-size: 12px;
		padding: 5px 8px;
	}
}

/* Cart & Checkout Accordion Styles */
.ppbd-cart-accordion-wrapper {
	margin: 20px 0;
	width: 100%;
}

.ppbd-accordion-item {
	border: 1px solid var(--ppbd-border);
	border-radius: 8px;
	background: #fff;
	overflow: hidden;
	box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.ppbd-accordion-toggle {
	width: 100%;
	display: flex;
	align-items: center;
	padding: 15px 20px;
	background: #fff;
	border: none;
	cursor: pointer;
	text-align: left;
	transition: background 0.2s;
	outline: none;
}

.ppbd-accordion-toggle:hover {
	background: var(--ppbd-bg-light);
}

.ppbd-accordion-icon {
	margin-right: 10px;
	font-size: 12px;
	transition: transform 0.3s ease;
	color: var(--ppbd-primary);
}

[dir="rtl"] .ppbd-accordion-icon {
	margin-right: 0;
	margin-left: 10px;
}

.ppbd-accordion-toggle[aria-expanded="true"] .ppbd-accordion-icon {
	transform: rotate(90deg);
}

[dir="rtl"] .ppbd-accordion-toggle[aria-expanded="true"] .ppbd-accordion-icon {
	transform: rotate(90deg);
}

[dir="rtl"] .ppbd-accordion-toggle {
	text-align: right;
}

.ppbd-accordion-title {
	font-weight: 700;
	color: var(--ppbd-text);
	flex: 1;
	font-size: 15px;
}

[dir="rtl"] .ppbd-accordion-title {
	text-align: right;
}

.ppbd-accordion-subtitle {
	color: var(--ppbd-primary);
	font-size: 13px;
	font-weight: 700;
	background: var(--ppbd-bg-light);
	padding: 4px 10px;
	border-radius: 15px;
}

.ppbd-accordion-content {
	border-top: 1px solid var(--ppbd-border);
	background: #fafafa;
	animation: slideDown 0.3s ease-out;
}

.ppbd-accordion-inner {
	padding: 15px 20px;
}

.ppbd-accordion-inner .ppbd-summary {
	background: transparent;
	padding: 0;
	box-shadow: none;
}

.ppbd-accordion-inner .ppbd-summary-item {
	background: #fff;
	margin-bottom: 8px;
	border: 1px solid var(--ppbd-border);
}

/* Checkout Specific Adjustments */
.woocommerce-checkout-review-order .ppbd-cart-accordion-wrapper {
	margin-top: 0;
	margin-bottom: 20px;
}

/* Mobile Responsive Accordion */
@media (max-width: 480px) {
	.ppbd-cart-accordion-wrapper {
		margin: 15px 0;
	}

	.ppbd-accordion-toggle {
		padding: 12px 15px;
		flex-wrap: wrap;
		gap: 5px;
	}

	.ppbd-accordion-title {
		font-size: 14px;
		width: 100%;
		margin-bottom: 5px;
	}

	.ppbd-accordion-subtitle {
		font-size: 12px;
		margin-left: 22px;
		/* Align with title text (icon width + gap) */
	}

	[dir="rtl"] .ppbd-accordion-subtitle {
		margin-left: 0;
		margin-right: 22px;
	}

	.ppbd-accordion-inner {
		padding: 12px 15px;
	}
}