/* =============================================
   Loan Compare Plugin – Scoped Styles
   All selectors use #lc-wrap or .lc-* prefix
   to avoid collisions with theme styles.
   ============================================= */

#lc-wrap {
    font-family: 'Open Sans', sans-serif;
    color: #444444;
    line-height: 1.6;
    box-sizing: border-box;
}

#lc-wrap *,
#lc-wrap *::before,
#lc-wrap *::after {
    box-sizing: inherit;
}

#lc-wrap button {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* --- Typography --- */
#lc-wrap .lc-heading {
    font-family: 'Raleway', sans-serif;
    font-weight: 700;
    font-size: 40px;
    line-height: 1.1;
    color: #006938;
    margin-bottom: 10px;
    text-align: center;
}

#lc-wrap .lc-subtitle {
    font-size: 18px;
    line-height: 25px;
    color: #7A7A7A;
    margin-bottom: 40px;
    text-align: center;
}

/* ======================
   SECTION 1 – LOAN GRID
   ====================== */
#lc-wrap .lc-loan-section {
    width: 90%;
    max-width: 1200px;
    margin: auto;
    text-align: center;
    padding: 60px 0;
}

/* Filter Buttons */
#lc-wrap .lc-filters {
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

#lc-wrap .lc-filters button {
    padding: 10px 20px;
    background-color: #E2E4E9;
    border: 1px solid #E2E4E9;
    border-radius: 10px;
    font-family: 'Open Sans', sans-serif;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: 0.3s;
}

#lc-wrap .lc-filters .active,
#lc-wrap .lc-filters button:hover {
    background-color: #ffffff;
    border: 1px solid #444444;
color:black;
}

/* Loan Grid – 3 columns on desktop */
#lc-wrap .lc-loan-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    justify-content: center;
    gap: 30px;
}

/* Hidden state for filtered cards */
#lc-wrap .lc-card.lc-hidden {
    display: none;
}

/* Standard Card */
#lc-wrap .lc-card {
    width: 100%;
    max-width: 360px;
    margin: 0 auto;
    background-color: #FFFFFF;
    padding: 30px 20px;
    border: 1px solid #E2E4E9;
    border-radius: 10px;
    text-align: left;
    transition: box-shadow 0.3s;
}

#lc-wrap .lc-card:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

#lc-wrap .lc-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    min-height: 50px;
    gap: 10px;
}

#lc-wrap .lc-card-header h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: #333;
    font-size: 18px;
    font-weight: 600;
    line-height: 24px;
    font-family: 'Raleway', sans-serif;
}

#lc-wrap .lc-info-icon {
    font-size: 16px;
    color: #777;
    cursor: pointer;
}

#lc-wrap .lc-check-icon {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border: 2px solid #0E6B3D;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

#lc-wrap .lc-card.is-selected .lc-check-icon {
    display: flex;
}

#lc-wrap .lc-check-icon i {
    color: #0E6B3D;
    font-size: 14px;
}

#lc-wrap .lc-card p {
    margin: 10px 0;
    font-size: 16px;
    line-height: 25.2px;
    color: #1B1B1B;
}

#lc-wrap .lc-card ul {
    padding-left: 0;
    list-style: none;
    margin: 15px 0;
}

#lc-wrap .lc-card ul li {
    font-size: 16px;
    line-height: 25.2px;
    color: #1B1B1B;
    margin-bottom: 6px;
}

/* Card Buttons */
#lc-wrap .lc-card-buttons {
    margin-top: 25px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

#lc-wrap .lc-outline {
    flex: 1;
    min-height: 44px;
    border-radius: 10px;
    border: 1px solid #C6CAD2;
    background: #FFFFFF;
    color: #006938;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

#lc-wrap .lc-outline:hover {
    background: #f9f9f9;
}

#lc-wrap .lc-compare-btn {
    flex: 1;
    min-height: 44px;
    border: 1px solid #006938;
    border-radius: 10px;
    background: #FFFFFF;
    color: #006938;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: 0.2s;
}

#lc-wrap .lc-compare-btn:hover {
    background: #f0fdf4;
}

#lc-wrap .lc-card.is-selected .lc-compare-btn {
    background: #006938;
    color: #FFFFFF;
}

/* Bottom Compare Bar */
#lc-wrap .lc-bottom-bar {
    margin-top: 50px;
    display: flex;
    justify-content: center;
}

#lc-wrap .lc-compare-main {
    padding: 12px 30px;
    min-height: 48px;
    background: #006938;
    color: #FFFFFF;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: 0.3s;
}

#lc-wrap .lc-compare-main:hover {
    background: #0b5a32;
}

#lc-wrap .lc-compare-main:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* ============================
   SECTION 2 – COMPARE VIEW
   ============================ */
#lc-wrap .lc-compare-section {
    display: none;
    text-align: center;
    padding: 60px 20px;
    background-color: #f2f2f3;
    margin-top: 40px;
}

#lc-wrap .lc-back-nav {
    display: flex;
    justify-content: flex-end;
    max-width: 1140px;
    width: 100%;
    margin: 0 auto 20px auto;
}

#lc-wrap .lc-back-btn {
    background: transparent;
    border: 2px solid #ff0000;
    border-radius: 50%;
    color: #ff0000;
    font-size: 20px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin-left: auto;
    margin-right: 6cqi;
    transition: background 0.2s, color 0.2s;
}

#lc-wrap .lc-back-btn:hover {
    background: rgba(235, 189, 131, 0.1);
    text-decoration: none;
}

/* Compare Grid – auto-centers based on selected count */
#lc-wrap .lc-compare-grid {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto;
}

/* Compare Card */
#lc-wrap .lc-compare-card {
    width: 360px;
    flex-shrink: 0;
    padding: 30px 20px;
    background: #FFFFFF;
    border: 1px solid #E2E4E9;
    border-radius: 10px;
    text-align: left;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
}

#lc-wrap .lc-compare-card .lc-card-header {
    min-height: auto;
}

#lc-wrap .lc-compare-card .lc-close {
    cursor: pointer;
    font-size: 24px;
    color: #999;
    transition: 0.2s;
    background: none;
    border: none;
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#lc-wrap .lc-compare-card .lc-close:hover {
    color: #d9534f;
}

#lc-wrap .lc-compare-card .lc-description {
    font-size: 16px;
    line-height: 25.2px;
    color: #444444;
    margin: 15px 0;
    min-height: 50px;
}

#lc-wrap .lc-card-divider {
    border: none;
    height: 1px;
    background-color: #006938;
    margin: 15px 0 20px 0;
}

#lc-wrap .lc-loan-details {
    list-style: none;
    padding: 0;
    margin: 0;
    flex-grow: 1;
}

#lc-wrap .lc-info-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #E5E7EB;
    min-height: 40px;
}

#lc-wrap .lc-info-row:last-child {
    border-bottom: none;
}

#lc-wrap .lc-label {
    font-size: 14px;
    color: #7A7A7A;
    margin-right: 15px;
    white-space: nowrap;
}

#lc-wrap .lc-value {
    font-weight: 600;
    font-size: 14px;
    color: #1B1B1B;
    text-align: right;
    word-break: break-word;
}

#lc-wrap .lc-primary-btn {
    width: 100%;
    background-color: #0E6B3D;
    color: white;
    padding: 14px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    margin-top: 20px;
    min-height: 48px;
    transition: 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

#lc-wrap .lc-primary-btn:hover {
    background-color: #0b5a32;
}

/* CTA Box */
#lc-wrap .lc-cta-box {
    max-width: 555px;
    margin: 60px auto 0 auto;
    padding: 40px 30px;
    background: #FFFFFF;
    border: 1px solid #E2E4E9;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 15px;
}

#lc-wrap .lc-cta-box h4 {
    font-family: 'Raleway', sans-serif;
    font-size: 24px;
    color: #006938;
    margin: 0;
}

#lc-wrap .lc-cta-box p {
    font-size: 16px;
    color: #444444;
    margin: 0;
}

#lc-wrap .lc-cta-box .lc-primary-btn {
    width: auto;
    padding: 12px 30px;
    margin-top: 10px;
}

/* ==================
   ERROR MODAL
   ================== */
#lc-wrap .lc-modal-overlay {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    align-items: center;
    justify-content: center;
}

#lc-wrap .lc-modal-content {
    background: #ffffff;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

#lc-wrap .lc-modal-content h3 {
    color: #d9534f;
    margin: 0 0 10px 0;
    font-family: 'Raleway', sans-serif;
    font-size: 24px;
}

#lc-wrap .lc-modal-content p {
    color: #444444;
    font-size: 16px;
    margin-bottom: 20px;
}

#lc-wrap .lc-modal-btn {
    background: #006938;
    color: white;
    border: none;
    padding: 10px 30px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    min-height: 44px;
}

#lc-wrap .lc-modal-btn:hover {
    background: #0b5a32;
}

/* ===================================
   RESPONSIVE – TABLET (max 1024px)
   =================================== */
@media (max-width: 1024px) {
    #lc-wrap .lc-loan-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    #lc-wrap .lc-card {
        max-width: 100%;
    }

    #lc-wrap .lc-compare-card {
        width: 340px;
    }
}

/* ===================================
   RESPONSIVE – MOBILE (max 767px)
   =================================== */
@media (max-width: 767px) {
    #lc-wrap .lc-heading {
        font-size: 28px;
        line-height: 1.2;
    }

    #lc-wrap .lc-subtitle {
        font-size: 15px;
        line-height: 22px;
        margin-bottom: 25px;
    }

    #lc-wrap .lc-subtitle br {
        display: none;
    }

    #lc-wrap .lc-loan-section {
        width: 100%;
        padding: 40px 16px;
    }

    /* Filters scroll horizontally on mobile */
    #lc-wrap .lc-filters {
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 8px;
        margin-bottom: 25px;
        gap: 8px;
    }

    #lc-wrap .lc-filters button {
        flex-shrink: 0;
        font-size: 14px;
        padding: 8px 16px;
    }

    /* Single column on mobile */
    #lc-wrap .lc-loan-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    #lc-wrap .lc-card {
        max-width: 100%;
        padding: 24px 16px;
    }

    #lc-wrap .lc-card-header h3 {
        font-size: 16px;
        line-height: 22px;
    }

    #lc-wrap .lc-card p {
        font-size: 14px;
        line-height: 22px;
    }

    #lc-wrap .lc-card ul li {
        font-size: 14px;
        line-height: 22px;
    }

    #lc-wrap .lc-card-buttons {
        gap: 8px;
    }

    #lc-wrap .lc-outline,
    #lc-wrap .lc-compare-btn {
        font-size: 14px;
        min-height: 44px;
    }

    #lc-wrap .lc-bottom-bar {
        margin-top: 30px;
    }

    #lc-wrap .lc-compare-main {
        width: 100%;
        font-size: 15px;
    }

    /* Compare Section Mobile */
    #lc-wrap .lc-compare-section {
        padding: 30px 16px;
        margin-top: 20px;
    }

    #lc-wrap .lc-compare-grid {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    #lc-wrap .lc-compare-card {
        width: 100%;
        padding: 24px 16px;
    }

    #lc-wrap .lc-compare-card .lc-description {
        min-height: auto;
        font-size: 14px;
    }

    #lc-wrap .lc-label {
        font-size: 13px;
    }

    #lc-wrap .lc-value {
        font-size: 13px;
    }

    /* CTA box */
    #lc-wrap .lc-cta-box {
        margin-top: 30px;
        padding: 30px 20px;
    }

    #lc-wrap .lc-cta-box h4 {
        font-size: 20px;
    }

    #lc-wrap .lc-cta-box p {
        font-size: 14px;
    }

    /* Modal */
    #lc-wrap .lc-modal-content {
        width: 90%;
        padding: 24px 20px;
    }

    #lc-wrap .lc-modal-content h3 {
        font-size: 20px;
    }

    #lc-wrap .lc-modal-content p {
        font-size: 14px;
    }
}

/* ===================================
   RESPONSIVE – SMALL MOBILE (max 380px)
   =================================== */
@media (max-width: 380px) {
    #lc-wrap .lc-heading {
        font-size: 24px;
    }

    #lc-wrap .lc-card-header h3 {
        font-size: 15px;
    }

    #lc-wrap .lc-card-buttons {
        flex-direction: column;
    }

    #lc-wrap .lc-outline,
    #lc-wrap .lc-compare-btn {
        width: 100%;
    }
}