/* Trigger icon — inherits size/background/hover from the theme's .sticky-btn */
.sticky-btn-emi-calculator {
	padding: 12px 14px;
	color: #c9a84c;
	border: none;
	cursor: pointer;
}

.sticky-btn-emi-calculator svg {
	display: block;
}

@media (max-width: 768px) {
	.sticky-btn-emi-calculator {
		padding: 10px 12px;
	}

	.sticky-btn-emi-calculator svg {
		width: 22px;
		height: 22px;
	}
}

/* Popup */
.emi-overlay {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	background: rgba(20, 26, 27, 0.65);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.25s ease, visibility 0.25s ease;
}

.emi-overlay.emi-open {
	opacity: 1;
	visibility: visible;
}

body.emi-no-scroll {
	overflow: hidden;
}

.emi-modal {
	position: relative;
	width: 100%;
	max-width: 440px;
	max-height: 90vh;
	overflow-y: auto;
	background: #ffffff;
	border-radius: 10px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
	padding: 32px 28px 28px;
	font-family: "Nunito Sans", sans-serif;
	transform: translateY(16px);
	transition: transform 0.25s ease;
	box-sizing: border-box;
}

.emi-overlay.emi-open .emi-modal {
	transform: translateY(0);
}

.emi-modal * {
	box-sizing: border-box;
}

.emi-close {
	position: absolute;
	top: 12px;
	right: 14px;
	background: none;
	border: none;
	font-size: 26px;
	line-height: 1;
	color: #666666;
	cursor: pointer;
	padding: 4px;
}

.emi-close:hover {
	color: #2e3a3c;
}

.emi-modal h3 {
	margin: 0 0 6px;
	font-size: 22px;
	font-weight: 700;
	color: #2e3a3c;
}

.emi-subtitle {
	margin: 0 0 20px;
	font-size: 14px;
	font-weight: 300;
	color: #666666;
}

.emi-field {
	margin-bottom: 18px;
}

.emi-field label {
	display: block;
	margin-bottom: 6px;
	font-size: 13px;
	font-weight: 600;
	color: #2e3a3c;
}

.emi-input-row {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 8px;
}

.emi-currency-static {
	flex: 0 0 auto;
	padding: 10px 8px;
	font-size: 14px;
	font-family: inherit;
	color: #2e3a3c;
	background: #fafafa;
	border: 1px solid #d8dcdc;
	border-radius: 6px;
}

.emi-number-input {
	flex: 1 1 auto;
	width: 100%;
	padding: 10px 12px;
	font-size: 14px;
	font-family: inherit;
	color: #333333;
	background: #fafafa;
	border: 1px solid #d8dcdc;
	border-radius: 6px;
}

.emi-number-input:focus {
	outline: none;
	border-color: #4a5c5f;
	box-shadow: 0 0 0 3px rgba(74, 92, 95, 0.15);
	background: #ffffff;
}

.emi-range {
	width: 100%;
	height: 4px;
	border-radius: 2px;
	background: #d8dcdc;
	appearance: none;
	-webkit-appearance: none;
	outline: none;
}

.emi-range::-webkit-slider-thumb {
	appearance: none;
	-webkit-appearance: none;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #4a5c5f;
	cursor: pointer;
	border: 2px solid #ffffff;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.emi-range::-moz-range-thumb {
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #4a5c5f;
	cursor: pointer;
	border: 2px solid #ffffff;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.emi-results {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin: 20px 0;
	padding: 16px;
	background: #f0f2f2;
	border-radius: 8px;
}

.emi-result {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.emi-result-label {
	font-size: 13px;
	color: #666666;
}

.emi-result-value {
	font-size: 14px;
	font-weight: 700;
	color: #2e3a3c;
}

.emi-result--primary .emi-result-label {
	font-size: 14px;
	font-weight: 600;
	color: #2e3a3c;
}

.emi-result--primary .emi-result-value {
	font-size: 20px;
	color: #ae9468;
}

.emi-chart-wrap {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 18px;
	margin-bottom: 20px;
}

.emi-chart-legend {
	list-style: none;
	margin: 0;
	padding: 0;
	font-size: 13px;
	color: #2e3a3c;
}

.emi-chart-legend li {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 6px;
}

.emi-chart-dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	display: inline-block;
}

.emi-chart-dot--principal {
	background: #4a5c5f;
}

.emi-chart-dot--interest {
	background: #c9a84c;
}

.emi-tabs {
	display: flex;
	gap: 4px;
	margin-bottom: 18px;
	border-bottom: 1px solid #e8ebeb;
}

.emi-tab {
	flex: 1 1 auto;
	background: none;
	border: none;
	border-bottom: 2px solid transparent;
	padding: 10px 8px 12px;
	font-size: 14px;
	font-weight: 600;
	font-family: inherit;
	color: #666666;
	cursor: pointer;
	transition: color 0.2s ease, border-color 0.2s ease;
}

.emi-tab:hover {
	color: #2e3a3c;
}

.emi-tab.is-active {
	color: #2e3a3c;
	border-bottom-color: #ae9468;
}

.emi-tab-panel {
	display: none;
}

.emi-tab-panel.is-active {
	display: block;
}

/* The schedule panel is given a shared min-height (via JS, matching the
   Calculator tab) so switching tabs doesn't resize the modal; the table
   wrap flexes to fill that height instead of using a fixed max-height. */
.emi-tab-panel[data-panel="schedule"].is-active {
	display: flex;
	flex-direction: column;
}

.emi-schedule-wrap {
	flex: 1 1 auto;
	overflow: auto;
	border: 1px solid #e8ebeb;
	border-radius: 6px;
}

.emi-schedule-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 12px;
}

.emi-schedule-table th,
.emi-schedule-table td {
	padding: 8px 10px;
	text-align: right;
	white-space: nowrap;
}

.emi-schedule-table th:first-child,
.emi-schedule-table td:first-child {
	text-align: left;
}

.emi-schedule-table thead th {
	position: sticky;
	top: 0;
	background: #2e3a3c;
	color: #ffffff;
	font-weight: 600;
	z-index: 1;
}

.emi-schedule-table tbody tr:nth-child(even) {
	background: #f7f8f8;
}

@media (max-width: 480px) {
	.emi-modal {
		padding: 26px 20px 22px;
	}

	.emi-schedule-table {
		font-size: 11px;
	}
}
