/* ========================================= */
/* Responsive Breakpoints Skeleton           */
/* ========================================= */

/* Desktop (1200px to 1399px) */
@media (max-width: 1399px) {}

/* Balanced Container Width for large screens */
@media (min-width: 1400px) {
    .container {
        max-width: 1440px !important;
    }
}

/* Make Container wider on all screens below 1200px to remove empty side spaces */
@media (max-width: 1199px) {
    .container {
        max-width: 94% !important;
    }
}

/* GLOBAL RESPONSIVE FIXES */
html,
body {
    max-width: 100%;
    overflow-x: clip;
}

/* Laptops and Desktops (992px to 1199px) */
@media (max-width: 1199px) {

    /* Hero Title Size Fix */
    .hero-title {
        font-size: 55px !important;
    }

    .hero-subtitle {
        font-size: 22px !important;
    }

    /* Homepage Sections Downscaling */
    /* Main Titles (Orig 48-50px -> 40px) */
    .who-we-are-title,
    .services-title,
    .loans-title,
    .why-choose-title,
    .faq-title-text {
        font-size: 40px !important;
    }

    /* Secondary Titles (Orig 42px -> 34px) */
    .app-download-title {
        font-size: 34px !important;
    }

    /* Subtitles and Main Descriptions (Orig 16-18px -> 15px) */
    .who-we-are-desc,
    .services-desc,
    .loans-subtitle,
    .why-choose-label,
    .app-download-desc,
    .faq-label {
        font-size: 15px !important;
    }

    /* Card Titles & Feature Titles (Orig 20-22px -> 18px) */
    .service-card-title,
    .text-title,
    .feature-title {
        font-size: 18px !important;
    }

    /* Card Descriptions & Smaller Texts (Orig 14-15px -> 13px) */
    .service-card-desc,
    .text-desc,
    .feature-desc,
    .faq-desc-text,
    .faq-desc {
        font-size: 13px !important;
    }

    /* Stats Number (Orig usually large -> 36px) */
    .stat-number {
        font-size: 36px !important;
    }

    /* App Download Section Spacing */
    .app-download-section {
        margin-bottom: -150px !important;
    }

    /* Make top bar items smaller so they don't break */
    .top-bar-phone,
    .top-bar-link {
        font-size: 12px !important;
    }

    /* Make nav links smaller so they fit before the 992px collapse */
    .nav-menu-link {
        font-size: 14px;
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }

    /* Hide the Open Account button in the navbar below 1200px */
    .navbar-nav .nav-item.ms-3 {
        display: none !important;
    }

    /* Floating Menu Design for <1200px */
    .floating-menu {
        right: 0.5rem;
        gap: 12px;
    }

    .floating-item {
        padding: 0 !important;
        width: 48px;
        height: 48px;
        justify-content: center;
        border-radius: 50% !important;
        position: relative;
        /* Anchor for tooltip */
    }

    .floating-item .floating-icon {
        margin-right: 0 !important;
        width: 22px;
        height: 22px;
    }

    /* Tooltip styling for the text */
    .floating-text {
        position: absolute;
        right: 100%;
        margin-right: 15px;
        top: 50%;
        transform: translateY(-50%);
        background-color: rgba(255, 255, 255, 0.4);
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        color: #fff !important;
        padding: 6px 12px;
        border-radius: 6px;
        font-size: 13px;
        line-height: 1.2;
        text-align: center;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.2s ease, visibility 0.2s ease;
        display: block !important;
    }

    /* Tooltip arrow */
    .floating-text::after {
        content: '';
        position: absolute;
        top: 50%;
        right: -5px;
        transform: translateY(-50%);
        border-width: 5px 0 5px 5px;
        border-style: solid;
        border-color: transparent transparent transparent rgba(255, 255, 255, 0.4);
    }

    /* Hover effect: Show tooltip, keep circle size */
    .floating-item:hover {
        width: 48px !important;
        height: 48px !important;
        padding: 0 !important;
        border-radius: 50% !important;
    }

    .floating-item:hover .floating-icon {
        margin-right: 0 !important;
    }

    .floating-item:hover .floating-text {
        opacity: 1;
        visibility: visible;
    }
}

/* Tablet & Mobile Menu (Max 991px) */
@media (max-width: 991px) {

    /* Global Spacing Reductions for Mobile/Tablet */
    .py-5 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }

    .my-5 {
        margin-top: 1.5rem !important;
        margin-bottom: 1.5rem !important;
    }

    .mb-5 {
        margin-bottom: 1.5rem !important;
    }

    .mt-5 {
        margin-top: 1.5rem !important;
    }

    .mb-4 {
        margin-bottom: 1rem !important;
    }

    .pe-lg-5 {
        padding-right: 0 !important;
    }

    /* Constrain massive images on mobile */
    .section-image-cover,
    .why-choose-section img.w-100 {
        max-height: 350px;
        width: 100%;
        object-fit: cover;
    }

    /* Resize header logo on mobile */
    .header-logo {
        width: 140px;
        height: auto;
    }

    /* Floating Sticky Icons on Mobile */
    .floating-menu {
        right: 0.5rem;
        gap: 10px;
    }

    .floating-item {
        padding: 10px !important;
        border-radius: 12px !important;
    }

    .floating-text {
        display: none !important;
    }

    .floating-icon {
        margin-right: 0 !important;
        width: 20px;
        height: 20px;
    }

    /* Clean Hamburger Button */
    .navbar-toggler {
        border: none !important;
        padding: 8px 0;
    }

    .navbar-toggler:focus {
        box-shadow: none !important;
    }

    /* Mobile Menu Container */
    .navbar-collapse {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        width: 100%;
        background-color: #ffffff;
        padding: 1rem;
        border-top: 1px solid #eaeaea;
        margin-top: 0;
        z-index: 1050;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
        max-height: 80vh !important;
        padding-bottom: 40px !important;
        /* Extra padding so bottom items aren't cut off */
        overscroll-behavior: contain;
        /* Trap scroll inside menu */
        overflow-y: auto !important;
        /* Enable internal scrolling */
        -webkit-overflow-scrolling: touch;
    }

    /* Mobile Menu Links */
    .navbar-nav {
        align-items: flex-start !important;
        width: 100%;
    }

    .navbar-nav .nav-item {
        width: 100%;
        border-bottom: 1px solid #f2f2f2;
    }

    .nav-menu-link {
        font-size: 16px !important;
        font-weight: 500;
        padding: 15px 20px !important;
        display: flex;
        justify-content: space-between;
        align-items: center;
        color: #333 !important;
        width: 100%;
    }

    /* Tablet Inner Banner */
    .inner-banner {
        padding: 40px 0 !important;
    }

    .banner-title {
        font-size: 36px !important;
    }

    /* About Us / Who We Are - Mobile Centering */
    .who-we-are .col-lg-6 {
        text-align: center;
    }

    .who-we-are .row.g-0.w-75 {
        width: 100% !important;
        margin-left: auto;
        margin-right: auto;
    }

    .who-we-are .stat-number,
    .who-we-are .stat-label {
        text-align: center;
    }

    .about-primary-img {
        width: 100% !important;
        max-width: 100% !important;
        margin-bottom: 2rem !important;
    }

    /* Board of Directors - Tablet */
    .section-title-directors {
        font-size: 2.2rem !important;
    }

    .section-subtitle-directors {
        margin-bottom: 40px !important;
    }

    /* Savings Account - Tablet Fonts */
    .features-section-title {
        font-size: 38px !important;
    }

    .eligibility-section-title {
        font-size: 34px !important;
    }

    .text-heading-lg {
        font-size: 34px !important;
    }

    /* Global CTA Banner - Tablet */
    .cta-loan-banner {
        padding: 40px !important;
    }

    /* WhatsApp Banking Contrast Fix */
    .wa-feature-text {
        color: #ffffff !important;
    }

    .wa-feature-icon-bg {
        background-color: #ffffff !important;
    }

    .wa-feature-icon-bg i {
        color: #18987a !important;
    }

    /* Mobile Mega Menu Sub-items */
    .dropdown-menu.mega-menu {
        position: static !important;
        /* Force it to push the menu height down */
        float: none !important;
        background-color: #fcfcfc !important;
        border: none !important;
        padding: 0 10px 15px 10px !important;
        box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.02) !important;
        margin-top: 0 !important;
    }

    /* Make scrollbar visible so users KNOW they can scroll */
    .navbar-collapse::-webkit-scrollbar {
        width: 6px;
        background-color: transparent;
    }

    .navbar-collapse::-webkit-scrollbar-thumb {
        background-color: rgba(13, 96, 178, 0.4);
        /* Subtle brand color */
        border-radius: 10px;
    }

    .mega-menu-title {
        display: none !important;
    }

    .mega-menu-card {
        padding: 10px 15px !important;
        margin-bottom: 5px;
        border-radius: 8px;
        background-color: #fff;
        border: 1px solid #eaeaea;
    }

    .mega-menu-text {
        font-size: 14px;
        font-weight: 500;
        color: #444;
    }

    /* Mobile hamburger menu scrolling moved to top rule */

    /* Fix App Download Section on Mobile/Tablet */
    .app-download-img {
        display: none !important;
    }

    .app-download-section {
        padding-top: 60px;
        padding-bottom: 60px;
        margin-top: 40px;
        margin-bottom: 0px !important;
    }

    .app-download-content {
        text-align: center;
    }

    .app-download-desc {
        margin-left: auto;
        margin-right: auto;
    }

    .app-download-content .d-flex {
        justify-content: center;
    }

    /* Fix loan card height on tablets and mobile */
    .loan-card {
        height: auto !important;
        min-height: auto !important;
        padding: 24px !important;
    }

    .loan-card .mt-auto {
        margin-top: 15px !important;
    }

    /* Make slider buttons smaller on tablet/mobile */
    .slider-btn {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    /* Make read more buttons smaller */
    .services-btn {
        padding: 10px 30px !important;
        font-size: 15px !important;
    }

    .read-more-btn {
        padding: 10px 30px !important;
        font-size: 15px !important;
    }
}

/* Mobile Large (576px to 767px) */
@media (max-width: 767px) {

    /* Mobile Inner Banner */
    .inner-banner {
        padding: 30px 0 !important;
    }

    .banner-title {
        font-size: 30px !important;
    }

    /* About Us - Mobile Grid Fixes */
    .stats-border:nth-child(even)::after {
        display: none !important;
        /* Remove right border for items that hit the right edge in 2x2 grid */
    }

    .stats-border:nth-child(1)::after,
    .stats-border:nth-child(2)::after {
        /* Add bottom border for top row in 2x2 grid to separate them from bottom row */
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
        width: 80%;
        left: 10%;
        bottom: -10px;
        top: auto;
        transform: none;
        height: 1px;
    }

    .quote-icon {
        width: 50px !important;
        right: 0px !important;
        bottom: -10px !important;
        opacity: 0.5;
    }

    /* Board of Directors - Mobile Grid */
    .section-title-directors {
        font-size: 2rem !important;
    }

    .director-img-frame {
        width: 50% !important;
        /* Scale down photo slightly on mobile */
    }

    /* Savings Account - Mobile */
    .interest-rate-card {
        padding: 12px 15px !important;
        left: 10px !important;
        top: -20px !important;
        gap: 10px !important;
        border-radius: 12px !important;
    }

    .interest-rate-card img {
        width: 28px !important;
        height: auto !important;
    }

    .interest-rate-value {
        font-size: 1.1rem !important;
    }

    .interest-rate-label {
        font-size: 0.8rem !important;
    }

    .feature-card {
        padding: 25px 20px !important;
    }

    /* Savings Account - Mobile Fonts */
    .features-section-title {
        font-size: 32px !important;
    }

    .eligibility-section-title {
        font-size: 28px !important;
    }

    .branch-card-title {
        font-size: 24px !important;
    }

    .text-heading-lg {
        font-size: 30px !important;
    }

    /* Global CTA Banner - Mobile */
    .cta-loan-banner {
        padding: 30px 25px !important;
    }

    .cta-loan-title {
        font-size: 26px !important;
    }

    .cta-loan-desc {
        font-size: 15px !important;
        margin-bottom: 20px !important;
    }

    /* Eligibility Section - Mobile */
    .eligibility-content-card {
        padding: 20px !important;
    }

    .eligibility-list li {
        font-size: 15px !important;
        margin-bottom: 15px !important;
    }

    .eligibility-heading {
        font-size: 22px !important;
        margin-bottom: 15px !important;
    }

    /* WhatsApp Banking Mobile */
    .whatsapp-hero {
        padding-bottom: 40px !important;
        min-height: auto !important;
    }

    .wa-hero-title {
        font-size: 34px !important;
    }

    .wa-phone-img {
        max-height: 400px !important;
    }

    /* Fix Hero Banner & Navigation Overlaps */
    .hero-banner .carousel-item img {
        height: calc(100vh - 100px);
        object-fit: cover;
        object-position: center;
    }

    .hero-title {
        font-size: 38px !important;
        line-height: 1.2 !important;
    }

    .hero-subtitle {
        font-size: 16px !important;
        margin-bottom: 25px !important;
    }

    .carousel-indicators-custom {
        margin-bottom: 10px !important;
        padding-bottom: 0 !important;
    }

    /* Fix Service Cards on Mobile */
    .service-card {
        min-height: auto !important;
        padding: 24px !important;
    }
}

/* Mobile (480px to 575px) */
@media (max-width: 575px) {

    /* Small Mobile Inner Banner */
    .inner-banner {
        padding: 25px 0 !important;
    }

    .banner-title {
        font-size: 26px !important;
    }

    /* Board of Directors - Small Mobile */
    .section-title-directors {
        font-size: 1.8rem !important;
    }

    .section-subtitle-directors {
        margin-bottom: 30px !important;
    }

    .director-img-frame {
        max-width: 180px !important;
        /* Stop the image from becoming huge when it spans 100% column width */
    }

    /* Savings Account - Small Mobile */
    .interest-rate-card {
        left: 5px !important;
        top: -15px !important;
    }

    /* Savings Account - Small Mobile Fonts */
    .features-section-title {
        font-size: 28px !important;
    }

    .eligibility-section-title {
        font-size: 24px !important;
    }

    .savings-hero-btn {
        width: 100%;
        margin-bottom: 5px;
    }

    .branch-card-title {
        font-size: 20px !important;
    }

    .text-heading-lg {
        font-size: 26px !important;
    }

    /* Global CTA Banner - Small Mobile */
    .cta-loan-banner {
        padding: 25px 20px !important;
    }

    .cta-loan-banner .btn {
        width: 100%;
        margin-bottom: 10px;
    }

    .cta-loan-banner .d-flex {
        flex-direction: column;
        gap: 0 !important;
    }

    /* Move hero text below image on very small screens */
    .hero-banner {
        display: flex;
        flex-direction: column;
    }

    .hero-content-wrapper {
        position: relative !important;
        background-color: #f4f6f9;
        /* Clean light background */
        padding: 30px 0;
        height: auto !important;
    }

    .hero-content-wrapper .cmpad {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }

    .hero-content-wrapper .hero-content {
        width: 100% !important;
        max-width: 100% !important;
        text-align: center !important;
    }

    .hero-content-wrapper .hero-content .btn {
        margin: 0 auto;
    }

    /* Make banner image smaller since text is now below it */
    .hero-banner .carousel-item img {
        height: 350px;
        object-fit: cover;
        object-position: center;
    }

    /* Keep the floating menu locked inside the 300px banner image area */
    .floating-menu {
        top: 150px !important;
        transform: translateY(-50%) !important;
    }

    /* Allow Attention bar to expand its height for the stacked text */
    .attention-bar {
        height: 32px !important;
    }

    .marquee-link {
        font-size: 13px !important;
    }

    /* Move carousel dots back up into the image */
    .carousel-indicators-custom {
        bottom: 100% !important;
        /* Align to the top of the white box */
        top: auto !important;
        margin-bottom: 20px !important;
        /* Push up into the image */
        z-index: 10 !important;
    }

    /* Hide top bar phone number on mobile, show icon only */
    .top-bar-phone {
        display: none !important;
    }

    /* Fix Attention Customers bar spacing */
    .attention-bar .container {
        flex-direction: column !important;
        align-items: flex-start !important;
        padding-top: 12px;
        padding-bottom: 8px;
    }

    .attention-bar .text-warning {
        margin-bottom: 4px;
        font-size: 14px;
    }

    /* Refine FAQ design on mobile for a premium app-like feel */
    .custom-accordion .accordion-item {
        margin-bottom: 12px !important;
        border-radius: 12px !important;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05) !important;
        border: none !important;
    }

    .custom-accordion .accordion-button {
        padding: 16px 16px 16px 20px !important;
        font-size: 15px !important;
        gap: 15px;
        /* Prevent text from hitting the icon */
    }

    .custom-accordion .accordion-button::after {
        min-width: 24px !important;
        width: 24px !important;
        height: 24px !important;
        background-size: 12px !important;
        /* Scale down the plus/minus svg */
    }

    .custom-accordion .accordion-body {
        padding: 0 20px 20px 20px !important;
        font-size: 14px !important;
    }

    /* Make slider buttons even smaller on mobile */
    .slider-btn {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }

    /* Make read more buttons even smaller */
    .services-btn,
    .read-more-btn {
        padding: 8px 24px !important;
        font-size: 14px !important;
    }
}

/* Mobile Small (320px to 479px) */
@media (max-width: 479px) {
    .hero-banner .carousel-item img {
        object-position: right center;
    }

    .hero-title {
        font-size: 30px !important;
    }

    .hero-subtitle {
        font-size: 14px !important;
        margin-bottom: 20px !important;
    }

    .floating-menu {
        right: 0.5rem !important;
        transform: translateY(-50%) scale(0.9);
        /* Scale down the whole menu slightly */
    }
}

/* RTI Page Responsive */
@media (max-width: 767.98px) {

    .rti-badge {
        min-width: 70px;
        font-size: 12px;
        padding: 4px 8px;
    }

    .rti-acc-text {
        font-size: 13.5px;
        line-height: 1.4;
        display: block;
    }

    .stat-card {
        padding: 1.25rem;
    }
}

/* Auth Table Mobile Card Layout */
@media (max-width: 767px) {
    .auth-table-wrapper {
        border: none !important;
        box-shadow: none !important;
        background: transparent !important;
    }

    .auth-table {
        min-width: 100% !important;
        border: none !important;
    }

    .auth-table thead {
        display: none;
    }

    .auth-table tbody tr {
        display: block;
        margin-bottom: 15px;
        background-color: #fff;
        border: 1px solid #CBCBCB;
        border-radius: 8px;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
        overflow: hidden;
    }

    .auth-table td {
        display: block;
        text-align: right;
        padding: 12px 15px 12px 45% !important;
        position: relative;
        border-bottom: 1px solid #f2f2f2;
        font-size: 14px;
        min-height: 48px;
    }

    .auth-table td::before {
        content: attr(data-label);
        position: absolute;
        left: 15px;
        width: 40%;
        text-align: left;
        font-weight: 600;
        color: #1A2980;
        font-size: 13px;
        top: 50%;
        transform: translateY(-50%);
    }

    .auth-table td.border-right {
        border-right: none !important;
    }

    .auth-table td:last-child {
        border-bottom: none !important;
    }
}

/* Branch Locator Media Queries */
@media (min-width: 992px) {
    .border-end-lg {
        border-right: 1px solid #dee2e6 !important;
    }
}