
/* ========================================
   CHAIYO BRAND THEME
   ======================================== */

:root {
    --chaiyo-blue: #080EAD;
    --chaiyo-blue-dark: #050783;
    --chaiyo-blue-mid: #1015A8;
    --chaiyo-yellow: #FFD900;
    --chaiyo-yellow-soft: #FFF4A8;
    --chaiyo-red: #F52F43;
    --chaiyo-green: #00C853;
    --chaiyo-text: #111111;
    --chaiyo-muted: #555555;
    --chaiyo-border: #E5E5E5;
    --chaiyo-surface: #FFFFFF;
    --chaiyo-surface-soft: #F7F7F7;
    --chaiyo-shadow: 0 4px 18px rgba(8, 14, 173, .12);
}

/* ========================================
   GLOBAL
   ======================================== */

html,
body {
    color: var(--chaiyo-text);
    background: #fff;
}

a {
    color: var(--chaiyo-blue);
}

    a:hover,
    a:focus {
        color: var(--chaiyo-red);
    }

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--chaiyo-blue);
}

/* Brand colors */

.loan-header,
.loan-products-title,
.steps-title,
.about-section-heading h2,
.repayment-header h1,
.payment-header h2,
.faq-title,
.compare-table-wrapper h2,
.rate-label,
.rate-content h2,
.about-content strong,
.service-card h3 {
    color: var(--chaiyo-blue) !important;
}

.confirm-button,
.rate-button {
    background: var(--chaiyo-blue) !important;
    color: #fff !important;
    border-color: var(--chaiyo-yellow) !important;
}

    .confirm-button:hover,
    .rate-button:hover,
    .confirm-button:focus,
    .rate-button:focus {
        background: var(--chaiyo-red) !important;
        color: #fff !important;
    }

.loan-item:hover,
.loan-item.active {
    background: var(--chaiyo-yellow-soft) !important;
    color: var(--chaiyo-blue) !important;
}

.loan-table thead th {
    background: var(--chaiyo-blue) !important;
    color: #fff !important;
}

.benefit-check {
    background: var(--chaiyo-blue) !important;
}

.feature-card > span {
    background: var(--chaiyo-red) !important;
}

.rate-card {
    background: #FFF8CC !important;
    border-left-color: var(--chaiyo-yellow) !important;
}

.repayment-card {
    border-top-color: var(--chaiyo-blue) !important;
}

.repayment-highlight {
    background: #FFF8CC !important;
    color: var(--chaiyo-blue) !important;
}

.service-icon,
.office-icon,
.about-number,
.repayment-icon {
    background: var(--chaiyo-yellow-soft) !important;
}

/* ========================================
   FIRST SECTION / SECOND SECTION
   ======================================== */

#firstcon > .row,
#firstcon .right-panel > .row {
    background-color: var(--chaiyo-blue) !important;
}

#firstcon .loan-header,
#firstcon .loan-header * {
    color: #fff !important;
}

#seccon > .content > .row,
#seccon > .content > .row > .row {
    border-left-color: var(--chaiyo-blue) !important;
    border-right-color: var(--chaiyo-blue) !important;
}

#seccon > .content > div[style*="background-color"] {
    background-color: var(--chaiyo-blue) !important;
}

#seccon .footer-text {
    color: #fff !important;
}

    #seccon .footer-text a {
        color: var(--chaiyo-yellow) !important;
    }

/* ========================================
   FLOATING LINE BUTTON
   ======================================== */

.floating-line-button {
    background: var(--chaiyo-green) !important;
    color: #fff !important;
}

    .floating-line-button:hover,
    .floating-line-button:focus {
        background: #00B84A !important;
        color: #fff !important;
    }

/* ========================================
   FOOTER
   ======================================== */

.footer {
    position: fixed;
    bottom: 0;
    width: 100%;
    background-repeat: repeat;
    background-position: center;
    background-size: 100% 100%;
    background-color: rgba(0, 0, 0, 0.15);
    height: 40px;
}

/* ========================================
   FLOATING APPLY BUTTON
   ======================================== */

#floatingApplyBtn {
    position: fixed;
    bottom: 50px;
    left: 0;
    right: 0;
    margin: 0 auto;
    z-index: 9999;
    width: min(500px, 90%);
    height: 60px;
    border: none;
    border-radius: 15px;
    background: #00a2ff;
    color: #fff;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .25);
    display: none;
    transition: all .3s ease;
    letter-spacing: 2px;
}

    #floatingApplyBtn:hover {
        background: #0088dd;
    }

/* ========================================
   ABOUT ACCORDION
   ======================================== */

.about-accordion {
    width: 100%;
    margin: 20px 0;
    color: #333;
    font-size: 14px;
    font-family: inherit;
}

.about-accordion-title {
    margin-bottom: 12px;
    color: darkblue;
    font-size: 15px;
    font-weight: 700;
}

.about-accordion .faq-item {
    margin-bottom: 10px;
    overflow: hidden;
    border: 1px solid #e2e7ef;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .035);
}

.about-accordion .faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    margin: 0;
    padding: 16px 18px;
    border: 0;
    border-radius: 0;
    background: #fff;
    color: #183b70;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
    text-align: left;
    cursor: pointer;
    box-shadow: none;
}

    .about-accordion .faq-question:hover {
        background: #f5f8fc;
    }

    .about-accordion .faq-question:focus-visible {
        outline: 2px solid #2674d9;
        outline-offset: -3px;
    }

.about-accordion .faq-number {
    display: inline-block;
    margin-right: 8px;
    color: #e36b28;
    font-size: 12px;
    font-weight: 700;
}

.about-accordion .faq-arrow {
    display: inline-block;
    flex-shrink: 0;
    color: #64748b;
    font-size: 11px;
    transition: transform .25s ease;
}

.about-accordion .faq-item.active .faq-arrow {
    transform: rotate(180deg);
}

.about-accordion .faq-answer {
    display: none;
    padding: 0 18px 18px;
    color: #555;
    line-height: 1.85;
    overflow-wrap: anywhere;
    font-family: inherit;
    font-size: 14px;
    font-weight: 400;
}

.about-accordion .faq-item.active .faq-answer {
    display: block;
}

.about-accordion .faq-answer p {
    margin: 0 0 12px;
}

    .about-accordion .faq-answer p:last-child {
        margin-bottom: 0;
    }

/* FAQ sub-items */

.about-accordion .faq-subitem {
    padding: 10px 0;
    border-bottom: 1px solid #edf0f4;
}

    .about-accordion .faq-subitem:last-child {
        border-bottom: 0;
    }

    .about-accordion .faq-subitem h4 {
        margin: 0 0 5px;
        color: #183b70;
        font-family: inherit;
        font-size: 14px;
        font-weight: 600;
        line-height: 1.5;
    }

    .about-accordion .faq-subitem p {
        margin: 0;
    }

/* Card benefits list */

.about-accordion .card-benefit-list {
    padding-left: 22px;
    margin: 0;
}

    .about-accordion .card-benefit-list li {
        padding: 5px 0;
    }

/* Note / disclaimer */

.about-accordion .faq-note {
    margin: 14px 0 0 !important;
    color: #7b8491;
    font-family: inherit;
    font-size: 11px;
    line-height: 1.6;
}

/* ========================================
   7 CARD BENEFITS
   ======================================== */

.about-accordion .card-benefit-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
}

.about-accordion .card-benefit-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
    padding: 13px;
    border: 1px solid #e7edf5;
    border-radius: 10px;
    background: #f8fafd;
    transition: background .2s ease, border-color .2s ease, transform .2s ease;
}

    .about-accordion .card-benefit-item:hover {
        background: #fff;
        border-color: #cbd9ed;
        transform: translateY(-2px);
    }

.about-accordion .card-benefit-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #eaf1fc;
    color: #183b70;
    font-size: 11px;
    font-weight: 700;
}

.about-accordion .card-benefit-text {
    padding-top: 3px;
    color: #424b57;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.65;
    overflow-wrap: anywhere;
}

/* ========================================
   TABLET + MOBILE
   ใช้ Layout แบบ Mobile ถึง 991.98px
   Desktop เริ่มตั้งแต่ 992px
   ======================================== */

@media (max-width: 991.98px) {

    /* Brand colors */
    #firstcon > .row {
        background-color: var(--chaiyo-blue) !important;
    }

    .loan-table thead th {
        background: var(--chaiyo-blue) !important;
    }

    /* Accordion spacing */
    .about-accordion {
        margin: 15px 0;
    }

    .about-accordion-title {
        font-size: 14px;
    }

    .about-accordion .faq-question {
        gap: 8px;
        padding: 14px;
        font-size: 13px;
    }

    .about-accordion .faq-number {
        margin-right: 5px;
        font-size: 11px;
    }

    .about-accordion .faq-answer {
        padding: 0 14px 15px;
        font-size: 13px;
        line-height: 1.75;
    }

    .about-accordion .faq-subitem h4 {
        font-size: 13px;
    }

    /* Benefits: single column on tablet and mobile */
    .about-accordion .card-benefit-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .about-accordion .card-benefit-item {
        padding: 11px 12px;
    }

    .about-accordion .card-benefit-text {
        font-size: 13px;
    }

    /* Floating button fits smaller screens */
    #floatingApplyBtn {
        width: min(500px, 92%);
        height: 54px;
        font-size: 20px;
        letter-spacing: 1px;
    }
}

/* ========================================
   SMALL MOBILE
   ======================================== */

@media (max-width: 375px) {

    .about-accordion .faq-question {
        padding: 12px;
        font-size: 12px;
    }

    .about-accordion .faq-answer {
        padding: 0 12px 14px;
        font-size: 12px;
    }

    .about-accordion .card-benefit-item {
        gap: 8px;
        padding: 10px;
    }

    .about-accordion .card-benefit-number {
        flex-basis: 27px;
        width: 27px;
        height: 27px;
    }

    #floatingApplyBtn {
        height: 48px;
        font-size: 17px;
    }
}


/* ========================================
   MOBILE + TABLET: PREVENT HORIZONTAL OVERFLOW
   ======================================== */

@media (max-width: 991.98px) {

    html,
    body {
        width: 100%;
        max-width: 100%;
    }

    body {
        overflow-x: clip;
    }

    *,
    *::before,
    *::after {
        box-sizing: border-box;
    }

    img,
    video,
    iframe {
        max-width: 100%;
    }

    /* Bootstrap containers */
    .container,
    .container-fluid {
        max-width: 100%;
    }

    /* Rows must not exceed their parent */
    .row {
        max-width: 100%;
    }

    /* Prevent long text from forcing page width */
    p,
    h1,
    h2,
    h3,
    h4,
    h5,
    h6,
    a,
    span,
    li {
        overflow-wrap: anywhere;
    }

    /* Accordion */
    .about-accordion,
    .about-accordion .faq-item,
    .about-accordion .faq-question,
    .about-accordion .faq-answer {
        min-width: 0;
        max-width: 100%;
    }

        .about-accordion .faq-question {
            flex-wrap: wrap;
        }

        /* Benefit cards */
        .about-accordion .card-benefit-grid {
            grid-template-columns: minmax(0, 1fr);
            min-width: 0;
            max-width: 100%;
        }

        .about-accordion .card-benefit-item {
            min-width: 0;
            max-width: 100%;
        }

        .about-accordion .card-benefit-text {
            min-width: 0;
            overflow-wrap: anywhere;
        }

    /* Tables: allow horizontal scrolling inside table wrapper */
    .table-responsive,
    .loan-table-wrapper,
    .compare-table-wrapper {
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Floating buttons */
    #floatingApplyBtn,
    .floating-line-button {
        max-width: calc(100% - 24px);
    }
}


/* ========================================
   TABLET + MOBILE: FULL WIDTH
   ======================================== */

@media screen and (max-width: 991.98px) {

    #firstcon {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow-x: clip;
    }

        #firstcon > div,
        #firstcon .desktop-layout {
            width: 100% !important;
            max-width: 100% !important;
            margin-left: 0 !important;
            margin-right: 0 !important;
            padding-left: 0 !important;
            padding-right: 0 !important;
            box-sizing: border-box !important;
        }

        #firstcon .desktop-layout {
            display: flex !important;
            flex-direction: column !important;
            align-items: stretch !important;
            gap: 0 !important;
        }

            #firstcon .desktop-layout > .left-panel,
            #firstcon .desktop-layout > .right-panel {
                flex: 0 0 100% !important;
                width: 100% !important;
                max-width: 100% !important;
                min-width: 0 !important;
                margin: 0 !important;
                box-sizing: border-box !important;
            }

            /* Image: use full available width */
            #firstcon .desktop-layout > .left-panel {
                padding: 0 !important;
            }

        #firstcon .side-image {
            display: block !important;
            width: 100% !important;
            max-width: 100% !important;
            height: auto !important;
            margin: 0 !important;
            object-fit: contain;
        }

        /* Form: full width with small inner spacing */
        #firstcon .desktop-layout > .right-panel {
            padding: 5px 10px 20px !important;
        }

        #firstcon .right-panel > .col-md-12,
        #firstcon .right-panel > .col-md-12-1,
        #firstcon .right-panel .row,
        #firstcon .right-panel .row > [class*="col-"] {
            width: 100% !important;
            max-width: 100% !important;
            min-width: 0 !important;
            box-sizing: border-box !important;
        }

        #firstcon .right-panel input,
        #firstcon .right-panel select,
        #firstcon .right-panel textarea,
        #firstcon .right-panel .loan-dropdown,
        #firstcon .right-panel .loan-selector {
            width: 100% !important;
            max-width: 100% !important;
            box-sizing: border-box !important;
        }
}

/* FIX: FULL BLEED ON TABLET AND MOBILE */
@media screen and (max-width: 991.98px) {

    html,
    body {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    #firstcon {
        position: relative !important;
        width: 100vw !important;
        max-width: 100vw !important;
        margin-left: calc(50% - 50vw) !important;
        margin-right: calc(50% - 50vw) !important;
        padding: 0 !important;
        box-sizing: border-box !important;
        overflow-x: clip;
    }

        #firstcon > div,
        #firstcon .desktop-layout,
        #firstcon .left-panel,
        #firstcon .right-panel {
            width: 100% !important;
            max-width: 100% !important;
            min-width: 0 !important;
            margin-left: 0 !important;
            margin-right: 0 !important;
            box-sizing: border-box !important;
        }

        #firstcon .desktop-layout {
            display: flex !important;
            flex-direction: column !important;
            gap: 0 !important;
        }

        #firstcon .left-panel {
            padding: 0 !important;
        }

        #firstcon .side-image {
            display: block !important;
            width: 100% !important;
            max-width: 100% !important;
            height: auto !important;
            margin: 0 !important;
        }

        #firstcon .right-panel {
            padding: 5px 10px 20px !important;
        }
}

@media screen and (max-width: 991.98px) {
    #seccon {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
      
        box-sizing: border-box !important;
    }

        #seccon * {
            box-sizing: border-box;
        }

        #seccon .row {
            margin-left: 0 !important;
            margin-right: 0 !important;
        }
}