@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Sinhala:wght@400;500;600;700&display=swap');
/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: #334155;
    background-color: #ffffff;
}

/* Guardrail: avoid horizontal scroll on mobile */
html, body { max-width: 100%; overflow-x: hidden; }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header Styles */
.header {
    position: sticky;
    top: 0;
    z-index: 50;
    background-color: white;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 4rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: inherit;
}

.logo-icon {
    width: 2rem;
    height: 2rem;
    background-color: #10b981;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.375rem;
    font-weight: bold;
    font-size: 1.125rem;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: bold;
    color: #1e293b;
}

.nav-desktop {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-link {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    transition: all 0.2s;
    font-size: 0.875rem;
}

.nav-link:hover {
    color: #1e293b;
    background-color: #f1f5f9;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-language {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: 1px solid #e2e8f0;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-language:hover {
    background-color: #f8fafc;
}

.btn-primary {
    background-color: #10b981;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.btn-primary:hover {
    background-color: #059669;
}

.btn-secondary {
    background-color: #f1f5f9;
    color: #475569;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background-color: #e2e8f0;
}

.btn-mobile-menu {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}

.mobile-nav {
    display: none;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem 0;
    border-top: 1px solid #e2e8f0;
}

.nav-link-mobile {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 0.75rem;
    text-align: left;
    border-radius: 0.375rem;
    transition: all 0.2s;
}

.nav-link-mobile:hover {
    color: #1e293b;
    background-color: #f1f5f9;
}

.mobile-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}

.btn-language-mobile {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: 1px solid #e2e8f0;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.875rem;
    width: 100%;
    justify-content: center;
}

.icon {
    width: 1rem;
    height: 1rem;
}

/* Hero Section */
.hero {
    padding: 4rem 0;
    background-color: #ffffff;
}

.hero-content {
    max-width: 64rem;
    margin: 0 auto;
    text-align: center;
}

.hero-text {
    margin-bottom: 2rem;
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3.75rem);
    font-weight: bold;
    color: #1e293b;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: clamp(1rem, 3vw, 1.25rem);
    color: #64748b;
    max-width: 42rem;
    margin: 0 auto;
}

.trust-indicators {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.trust-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #64748b;
}

.icon-check {
    width: 1rem;
    height: 1rem;
    color: #10b981;
}

.hero-cta {
    margin-bottom: 3rem;
}

.btn-hero {
    background-color: #10b981;
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 1.125rem;
    transition: all 0.2s;
}

.btn-hero:hover {
    background-color: #059669;
    transform: translateY(-1px);
}

.hero-disclaimer {
    margin-top: 1rem;
    font-size: 0.875rem;
    color: #64748b;
}

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.benefit-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.2s;
}

.benefit-card:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.benefit-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    background-color: rgba(16, 185, 129, 0.1);
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.benefit-icon svg {
    width: 1.5rem;
    height: 1.5rem;
    color: #10b981;
}

.benefit-card h3 {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.benefit-card p {
    color: #64748b;
    font-size: 0.875rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 2rem;
    padding-top: 3rem;
    border-top: 1px solid #e2e8f0;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: bold;
    color: #10b981;
}

.stat-label {
    font-size: 0.875rem;
    color: #64748b;
}

/* Main Content */
.main-content {
    padding: 4rem 0;
}

.content-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title {
    font-size: 1.875rem;
    font-weight: bold;
    color: #1e293b;
    margin-bottom: 1rem;
}

.section-subtitle {
    font-size: 1.125rem;
    color: #64748b;
    max-width: 42rem;
    margin: 0 auto;
}

.content-grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
}

/* Filter Sidebar */
.filters-sidebar {
    height: fit-content;
    position: sticky;
    top: 6rem;
}

.filter-panel {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
}

.filter-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-title::before {
    content: "";
    width: 1rem;
    height: 1rem;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%2310b981" stroke-width="2"><polygon points="22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3"/></svg>') no-repeat center;
}

.filter-group {
    margin-bottom: 2rem;
}

.filter-label {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}

.range-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.range-input {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.range-input label {
    font-size: 0.75rem;
    color: #64748b;
}

.range-input input {
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.range-input input:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

input[type="range"] {
    width: 100%;
    margin: 0.75rem 0;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: #10b981;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #10b981;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.range-value {
    font-weight: 500;
    color: #10b981;
    font-size: 0.875rem;
}

select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    background: white;
    transition: border-color 0.2s, box-shadow 0.2s;
}

select:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

select[multiple] {
    height: 120px;
}

.filter-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e2e8f0;
}

/* Loans Grid */
.loans-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.loan-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    display: flex;             /* <<< добавили */
    flex-direction: column;    /* <<< добавили */
    overflow: hidden;
}

.loan-card:hover {
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

.loan-card.selected {
    border-color: #10b981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2), 0 10px 15px rgba(0, 0, 0, 0.1);
}

.loan-header {
    display: flex;
    justify-content: space-between;
    align-items: center;          /* keep items vertically centered */
    gap: 0.5rem;                  /* small gap between name and badge */
    flex-wrap: wrap;              /* allow badge to move to next line on tiny widths */
    margin-bottom: 0.2rem;        /* maintain compact spacing */
}

.loan-header > * { min-width: 0; }

.bank-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.25rem;
    line-height: 1.2;
    min-width: 0;               /* allow flex shrink */
    overflow: hidden;           /* prevent pushing badge out */
    text-overflow: ellipsis;    /* gracefully trim long names */
}

.popular-badge {
    background-color: #10b981;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    flex: 0 0 auto;             /* don't shrink text unpredictably */
    margin-left: auto;          /* stick to the right edge inside header */
    max-width: 45%;             /* keep within card on narrow widths */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.loan-details {
    margin-bottom: 1.5rem;
}

.detail-row{
    display: grid;
    grid-template-columns: 1fr auto; /* лейбл тянется, значение прижато справа */
    column-gap: 12px;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f1f5f9;
}
.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-size: 0.875rem;
    color: #64748b;
}

.detail-value {
    font-weight: 500;
    color: #1e293b;
    white-space: nowrap; /* не переносить значение */
}

.interest-rate {
    font-size: 1.5rem;
    font-weight: bold;
    color: #10b981;
}

/* Star Rating */
.star-rating {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-bottom: 0.25rem;
}

.stars {
    display: flex;
    gap: 0.125rem;
}

.star {
    width: 0.875rem;
    height: 0.875rem;
    color: #fbbf24;
}

.star.filled {
    fill: currentColor;
}

.star.empty {
    fill: none;
    color: #d1d5db;
}

.rating-text {
    font-size: 0.75rem;
    color: #64748b;
    margin-left: 0.25rem;
}

.features {
    margin-bottom: 1.5rem;
}

.features h4 {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.features-list {
    list-style: none;
}

.features-list li {
    font-size: 0.875rem;
    color: #64748b;
    padding: 0.25rem 0;
    position: relative;
    padding-left: 1rem;
}

.features-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #10b981;
    font-weight: bold;
}

.loan-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: auto;  /* прижать блок с кнопками к низу карточки */
}

.btn-apply {
    flex: 1;
    background-color: #10b981;
    color: white;
    border: none;
    padding: 0.75rem;
    border-radius: 0.375rem;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-apply:hover {
    background-color: #059669;
}

.btn-select {
    background: none;
    border: 1px solid #e2e8f0;
    padding: 0.75rem;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-select:hover {
    background-color: #f8fafc;
}

.btn-select.selected {
    background-color: #10b981;
    color: white;
    border-color: #10b981;
}

.no-results {
    text-align: center;
    padding: 3rem;
    color: #64748b;
}

.no-results h3 {
    font-size: 1.25rem;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

/* Comparison Panel */
.comparison-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 -4px 6px rgba(0, 0, 0, 0.1);
    z-index: 40;
    min-height: 100px;
}

.comparison-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

.comparison-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.comparison-info h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1e293b;
}

.comparison-info p {
    font-size: 0.875rem;
    color: #64748b;
}

.comparison-actions {
    display: flex;
    gap: 0.75rem;
}

.selected-loans {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
}

.selected-loan-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #f8fafc;
    padding: 0.75rem;
    border-radius: 0.5rem;
    min-width: 200px;
}

.selected-loan-info {
    flex: 1;
}

.selected-loan-bank {
    font-weight: 500;
    color: #1e293b;
    font-size: 0.875rem;
}

.selected-loan-rate {
    font-size: 0.75rem;
    color: #64748b;
}

.btn-remove {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: all 0.2s;
}

.btn-remove:hover {
    background-color: #fef2f2;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-content {
    background: white;
    border-radius: 0.75rem;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px rgba(0, 0, 0, 0.1), 0 10px 10px rgba(0, 0, 0, 0.04);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 1.5rem 0;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.modal-title-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.modal-icon {
    width: 1.5rem;
    height: 1.5rem;
    color: #10b981;
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #64748b;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: all 0.2s;
    line-height: 1;
}

.modal-close:hover {
    background-color: #f1f5f9;
    color: #1e293b;
}

.modal-body {
    padding: 0 1.5rem 1.5rem;
}

.comparison-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
}

.comparison-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1.5rem;
    position: relative;
}

.comparison-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.comparison-bank-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.comparison-interest-rate {
    font-size: 2rem;
    font-weight: bold;
    color: #10b981;
    margin-bottom: 0.25rem;
}

.comparison-interest-label {
    font-size: 0.875rem;
    color: #64748b;
    margin-bottom: 1rem;
}

.comparison-details {
    margin-bottom: 1.5rem;
}

.comparison-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.comparison-detail-row:last-child {
    border-bottom: none;
}

.comparison-detail-label {
    font-size: 0.875rem;
    color: #64748b;
    font-weight: 500;
}

.comparison-detail-value {
    font-weight: 500;
    color: #1e293b;
    white-space: nowrap; /* не переносить значение */
}

.comparison-features {
    margin-bottom: 1.5rem;
}

.comparison-features h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.75rem;
}

.comparison-features-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.comparison-features-list li {
    font-size: 0.875rem;
    color: #64748b;
    padding: 0.25rem 0;
    position: relative;
    padding-left: 1.25rem;
}

.comparison-features-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #10b981;
    font-weight: bold;
}

.comparison-apply-btn {
    width: 100%;
    background-color: #10b981;
    color: white;
    border: none;
    padding: 0.75rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.comparison-apply-btn:hover {
    background-color: #059669;
}

/* Footer */
.footer {
    background-color: #1e293b;
    color: #94a3b8;
    padding: 3rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    color: white;
    font-weight: 600;
    margin-bottom: 1rem;
}

.footer-description {
    margin-top: 1rem;
    line-height: 1.6;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #334155;
    font-size: 0.875rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .content-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .filters-sidebar {
        position: static;
    }

    .loans-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .nav-desktop,
    .header-actions {
        display: none;
    }

    .btn-mobile-menu {
        display: block;
    }

    .mobile-nav.show {
        display: flex;
    }

    .hero {
        padding: 2rem 0;
    }

    .benefits-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .loans-container {
        grid-template-columns: 1fr;
    }

    .comparison-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .comparison-actions {
        justify-content: center;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }

    .comparison-cards {
        grid-template-columns: 1fr;
    }

    .modal-content {
        margin: 1rem;
        max-height: calc(100vh - 2rem);
    }
    /* Compact filters & cards on tablets/phones */
    .filters-sidebar { top: auto; }
    .filter-panel { padding: 0.75rem; }
    .filter-title { font-size: 1.1rem; margin-bottom: 1rem; }
    .filter-group { margin-bottom: 1rem; }
    .range-inputs { grid-template-columns: 1fr; gap: 0.5rem; }
    .range-input input { padding: 0.5rem; }
    input[type="range"] { height: 4px; margin: 0.5rem 0; }
    select { padding: 0.5rem; }
    .filter-buttons { gap: 0.5rem; margin-top: 1rem; padding-top: 1rem; }

    .loans-container { gap: 1rem; }

    .bank-logo { height: 32px !important; max-width: 140px; margin-top: 8px; transform: translateX(-2px); }

    .loan-card { padding: 0.75rem; }
    .loan-header { margin-bottom: 0.25rem; }
    .bank-name { font-size: 1rem; }
    .popular-badge { padding: 0.15rem 0.5rem; font-size: 0.65rem; }

    .loan-details { margin-bottom: 1rem; }
    .detail-row { padding: 0.25rem 0; }
    .detail-label { font-size: 0.8rem; }
    .detail-value { font-size: 0.85rem; }
    .interest-rate { font-size: 1.25rem; }

    .star { width: 0.75rem; height: 0.75rem; }
    .rating-text { font-size: 0.7rem; }

    .features h4 { font-size: 0.8rem; }
    .features-list li { font-size: 0.8rem; padding: 0.125rem 0; padding-left: 0.875rem; }
    .features-list li::before { font-size: 0.85em; }

    .loan-actions { gap: 0.5rem; }
    .btn-apply, .btn-select { padding: 0.5rem; font-size: 0.8rem; }
}

@media (max-width: 480px) {
    .container {
        padding: 0 0.75rem;
    }

    .filter-panel {
        padding: 1rem;
    }

    .loan-card {
        padding: 1rem;
    }

    .selected-loans {
        flex-direction: column;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    /* Extra compact on small phones */
    .filter-panel { padding: 0.5rem; }
    .filter-title { font-size: 1rem; margin-bottom: 0.75rem; }
    .filter-group { margin-bottom: 0.75rem; }
    .range-input input, select { padding: 0.45rem; }
    input[type="range"] { height: 3px; margin: 0.4rem 0; }

    .loans-container { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }

    .loan-card { padding: 0.6rem; }
    .bank-logo { height: 28px !important; max-width: 120px; transform: translateX(-2px); }
    .popular-badge { padding: 0.12rem 0.45rem; font-size: 0.6rem; }
    .popular-badge { max-width: 40%; }
    .loan-actions { gap: 0.4rem; }
    .bank-name { font-size: 0.95rem; }
    .interest-rate { font-size: 1.15rem; }
    .detail-label { font-size: 0.75rem; }
    .detail-value { font-size: 0.8rem; }
    .btn-apply, .btn-select { padding: 0.45rem; font-size: 0.78rem; }

    /* Prevent value column from forcing card width */
    .detail-row { grid-template-columns: minmax(0,1fr) minmax(0,1fr); column-gap: 8px; }
    .detail-value { white-space: normal; word-break: break-word; text-align: right; }

    /* Keep buttons inside card width on tiny screens */
    .btn-select { flex: 1 1 0; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .loan-actions * { min-width: 0; }

    /* Guardrail: prevent viewport expansion by inline elements */
    .loan-card, .loan-card * { max-width: 100%; }

    /* === Mobile super‑compact hero & benefits (phones only) === */
    .hero { padding: 1.25rem 0 0.5rem; }
    .hero-title { font-size: 1.65rem; margin-bottom: 0.5rem; }
    .hero-subtitle { font-size: 0.92rem; margin: 0.25rem auto 0; max-width: 28rem; }
    .trust-indicators { gap: 0.5rem; margin-bottom: 0.75rem; }
    .trust-item { font-size: 0.78rem; }
    .hero-cta { margin-bottom: 1rem; }
    .btn-hero { padding: 0.65rem 1rem; font-size: 1rem; border-radius: 0.5rem; }
    .hero-disclaimer { font-size: 0.72rem; margin-top: 0.5rem; }

    /* Turn 3 feature cards into tiny chips so above‑the‑fold is shorter */
    .benefits-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; margin-bottom: 1rem; }
    .benefit-card { padding: 0.5rem; border-radius: 0.6rem; }
    .benefit-icon { width: 28px; height: 28px; margin-bottom: 0.35rem; }
    .benefit-icon svg { width: 16px; height: 16px; }
    .benefit-card h3 { font-size: 0.9rem; margin-bottom: 0; }
    .benefit-card p { display: none; } /* hide long descriptions on small phones */

    /* Stats under hero — ultra‑compact on phones */
    .stats-grid {
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 0.5rem;
      padding-top: 0.5rem;
      border-top: 1px solid #eef2f7; /* lighter divider on phones */
    }
    .stat-item { padding: 0.15rem 0; }
    .stat-number { font-size: 1.12rem; }
    .stat-label { font-size: 0.68rem; }

    /* Get to the offers faster */
    .main-content { padding: 2rem 0 1.25rem; }
    .content-header { margin-bottom: 1.25rem; }
    .section-title { font-size: 1.35rem; margin-bottom: 0.5rem; }
    .section-subtitle { font-size: 0.95rem; }

    /* Why‑Choose‑Us / steps — compact spacing on phones */
    .features-section { padding: 32px 0 16px; }
    .reasons-grid { gap: 12px; }
    .reason-card { padding: 14px; }
    .reason-title { font-size: 1rem; }
    .reason-text { font-size: 0.9rem; }
    .steps-grid { gap: 12px; }
    .step-card { padding: 14px; }
    .cta-banner { padding: 16px; }
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Animation for smooth transitions (scoped to interactive elements) */
button, a, .btn-hero, .btn-primary, .btn-secondary, .btn-apply, .btn-select,
.loan-card, .benefit-card, .reason-card, .step-card {
  transition: background-color .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}
.bank-logo{
  display:block;
  height:40px !important;     /* было 48 */
  width:auto !important;
  max-width:160px;            /* было 200 */
  object-fit:contain;
  margin:12px 0 0 0;          /* чуть меньше сверху */
  transform: translateX(-4px);/* безопасный сдвиг влево */
  border-radius:0;
  vertical-align:middle;
}
@media (min-width:768px){
  .bank-logo{
    height:56px !important;   /* было 64 */
    max-width:180px;          /* ограничение ширины на десктопе */
    transform: translateX(-6px);
  }
}

.bank-header{
  display:flex;
  flex-direction:column;
  align-items:flex-start;   /* use center if you prefer centered */
  gap:4px;
  margin-bottom:1px;        /* чуть меньше снизу */
}
/* === Why Choose Us (features) === */
.features-section { padding: 80px 0; background: #fff; }
.features-header { text-align: center; margin-bottom: 40px; }

.reasons-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
  margin-bottom: 48px;
}
.reason-card {
  background: #fff;
  border: 1px solid #e7ebf0;
  border-radius: 18px;
  padding: 28px;
  box-shadow: 0 1px 2px rgba(16,24,40,0.04);
}
.reason-icon {
  width: 48px; height: 48px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: #e9f6ef; /* мягкий зелёный фон */
  font-size: 22px;
  margin-bottom: 14px;
}
.reason-title { font-weight: 600; margin: 0 0 6px; font-size: 1.125rem; }
.reason-text { color: #667085; margin: 0; font-size: 0.95rem; line-height: 1.55; }

@media (min-width: 1280px) {
  .reasons-grid { gap: 36px; }
  .reason-card { padding: 32px; }
}

/* Steps */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 24px;
  margin: 8px 0 48px;
}
.step-card {
  border: 1px dashed #d9e1ea;
  border-radius: 16px;
  padding: 20px;
  background: #fafcfd;
}
.step-icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: #e9f6ef;
  color: #0f9150;
  font-weight: 700;
  margin-bottom: 10px;
}
.step-title { font-weight: 600; margin: 0 0 6px; }
.step-text { color: #667085; margin: 0; }

/* CTA banner */
.cta-banner {
  border-radius: 16px;
  padding: 24px;
  background: #0f9150;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.cta-title { margin: 0 0 4px; }
.cta-subtitle { margin: 0; opacity: 0.9; }
.cta-btn { background: #fff; color: #0f9150; }
.cta-btn:hover { background: #f0fff7; }

/* Responsive */
@media (max-width: 1024px) {
  .reasons-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .steps-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 640px) {
  .reasons-grid, .steps-grid { grid-template-columns: 1fr; }
  .cta-banner { flex-direction: column; text-align: center; }
}
  
  /* === Mobile Filters Toggle & Bottom Sheet === */
  .filters-toggle { display: none; }
  .btn-filter {
    display: inline-flex; align-items: center; gap: 0.5rem;
    background: #10b981; color: #fff; border: none;
    padding: 0.6rem 1rem; border-radius: 0.5rem; font-weight: 600;
    box-shadow: 0 1px 2px rgba(0,0,0,.05);
  }
  .btn-filter .icon { width: 1rem; height: 1rem; }

  .filters-backdrop { display: none; }
  .filters-backdrop.show {
    display: block;
    position: fixed; inset: 0; background: rgba(0,0,0,.4);
    z-index: 1090;
  }

  .filters-close { display: none; }

  @media (max-width: 1024px) {
    .filters-toggle {
      display: flex; justify-content: center; align-items: center;
      position: sticky; top: 4rem; z-index: 35;
      background: #fff; padding: 0.5rem 0; border-bottom: 1px solid #e2e8f0;
    }

    .filters-sidebar {
      position: fixed;
      left: 0; right: 0; bottom: 0; top: auto;
      height: 80dvh;                 /* динамическая высота для мобильных */
      max-height: 80vh;              /* fallback */
      padding: 0;
      z-index: 1100;
      background: #fff;
      transform: translateY(100%);
      transition: transform .25s ease;
      border-top-left-radius: 16px;
      border-top-right-radius: 16px;
      box-shadow: 0 -12px 24px rgba(0,0,0,.18);
      overscroll-behavior: contain;  /* изоляция прокрутки внутри дравера */
    }
    .filters-sidebar.open { transform: translateY(0); }
    .filters-sidebar::before {
      content: "";
      position: absolute;
      top: 8px;
      left: 50%;
      transform: translateX(-50%);
      width: 44px;
      height: 4px;
      border-radius: 999px;
      background: #cbd5e1;
    }

    .filter-panel {
      height: 100%;
      overflow: auto;
      border: none;
      border-radius: 16px 16px 0 0;
      padding: 1rem;
      padding-bottom: max(env(safe-area-inset-bottom), 16px); /* запас под «подбородок» */
    }

    .filters-close {
      display: inline-flex; align-items: center; justify-content: center;
      position: sticky; top: 0;
      width: 40px; height: 40px; margin: 0.5rem 0.5rem 0 auto;
      background: #f1f5f9; color: #334155;
      border: 1px solid #e2e8f0; border-radius: 8px;
      font-size: 1.25rem; line-height: 1;
      z-index: 1; /* поверх содержимого панели при скролле */
    }

    .filters-backdrop.show {
      display: block;
      position: fixed; inset: 0; background: rgba(0,0,0,.4);
      z-index: 1090;
      backdrop-filter: saturate(120%) blur(2px);
    }

    body.no-scroll {
      overflow: hidden;
      height: 100dvh;
      overscroll-behavior: none;
      touch-action: none;
    }
  }
/* Prevent background scroll when drawer is open */
@media (max-width: 1024px) {
  body.no-scroll {
    overflow: hidden;
    height: 100dvh;
    overscroll-behavior: none;
    touch-action: none;
  }
}

/* Sinhala page typography — consistent size with EN and correct shaping */
html[lang="si"] body,
html[lang="si"] button,
html[lang="si"] input,
html[lang="si"] select,
html[lang="si"] textarea {
  font-family: 'Noto Sans Sinhala', -apple-system, system-ui, 'Segoe UI', sans-serif;
  font-size-adjust: 0.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.55;
}

/* Keep visual scale close to EN */
html[lang="si"] .hero-title { font-size: clamp(1.9rem, 4.9vw, 3.35rem); line-height: 1.25; }
html[lang="si"] .hero-subtitle { font-size: clamp(0.95rem, 2.8vw, 1.15rem); }
html[lang="si"] .section-title { font-size: 1.75rem; }
html[lang="si"] .bank-name { font-size: 1.05rem; line-height: 1.25; }

html[lang="si"] .detail-label,
html[lang="si"] .features-list li,
html[lang="si"] .rating-text { font-size: 0.92em; }

html[lang="si"] .btn-hero { font-size: 1rem; }
html[lang="si"] .btn-apply,
html[lang="si"] .btn-select { font-size: 0.85rem; }

/* Stabilize numerals and currency */
html[lang="si"] .detail-value,
html[lang="si"] .interest-rate,
html[lang="si"] .selected-loan-rate,
html[lang="si"] .comparison-interest-rate {
  font-variant-numeric: tabular-nums lining-nums;
}

/* --- Sinhala compact sizing for loan cards (keeps 3-up layout) --- */
html[lang="si"] .loan-card { padding: 1.25rem; }
html[lang="si"] .loan-header { margin-bottom: 0.15rem; }
html[lang="si"] .bank-name { font-size: 1.02rem; line-height: 1.2; }

html[lang="si"] .loan-details { margin-bottom: 1rem; }
html[lang="si"] .detail-row { padding: 0.35rem 0; }
html[lang="si"] .detail-label { font-size: 0.82rem; }
html[lang="si"] .detail-value { font-size: 0.9rem; }

html[lang="si"] .features { margin-bottom: 1rem; }
html[lang="si"] .features h4 { font-size: 0.82rem; margin-bottom: 0.35rem; }
html[lang="si"] .features-list li { font-size: 0.82rem; line-height: 1.3; }

html[lang="si"] .loan-actions { gap: 0.5rem; }
html[lang="si"] .btn-apply,
html[lang="si"] .btn-select { padding: 0.55rem 0.65rem; font-size: 0.8rem; }