/* ==========================================================================
   RESPONSIVE GRID LAYOUTS (BREAKPOINTS OVERLAYS)
   ========================================================================== */

/* --- Up to 1200px (Large Desktop / Small Laptop) --- */
@media (max-width: 1200px) {
    .cpa-main-heading {
        font-size: 30px;
    }

    .cpa-info-content h3 {
        font-size: 31px;
    }

    .cpa-info-content p {
        font-size: 17px;
    }
}

/* --- Up to 1024px / 991px (Tablets / Small Screens) --- */
@media (max-width: 991px) {

    /* Hide top header bar completely on mobile/tablet */
    .top-header-warp {
        display: none !important;
    }

    /* Show hamburger toggler on navbar */
    .navbar-toggler {
        display: block !important;
    }

    /* Hide standard desktop menu */
    .navbar-collapse {
        display: none !important;
    }

    /* Wrap banner and forms */
    .hero-slider-warp {
        padding-top: 100px;
        padding-bottom: 60px;
    }

    .program-hero-card {
        max-width: 100%;
        margin-bottom: 2rem;
    }

    /* GCC Program Cards adjust height */
    .card-image-box {
        height: 250px;
    }

    /* AI domains grid */
    .domains-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        max-width: 650px;
    }

    /* Flip cards wrapper height */
    .flip-card-wrapper {
        height: 300px;
    }

    /* ACCA intro banner grid wrap */
    .cpa-info-banner {
        grid-template-columns: 60% 40%;
        min-height: 220px;
    }

    .cpa-info-image {
        height: 220px;
    }

    .cpa-info-content h3 {
        font-size: 27px;
    }

    .cpa-info-content p {
        font-size: 15px;
    }

    /* Core exam structure responsive grid */
    .exam-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .process-grid {
        grid-template-columns: 1fr !important;
        gap: 25px;
    }

    .process-wrapper {
        padding: 35px 30px 100px;
    }

    .process-flow {
        grid-template-columns: repeat(2, 1fr) !important;
        bottom: -60px;
    }

    .flow-item::after {
        display: none !important;
    }

    /* LMS grid feature padding */
    .section-container {
        padding: 40px 20px;
    }

    .feature-card {
        padding: 20px 15px;
    }

    /* Footer widgets column stack */
    .footer-widget {
        margin-bottom: 30px;
    }

    .apply-now-li {
        grid-column: 2;
    }
}

/* --- Up to 768px (Mobile Landscapes / Tablets) --- */
@media (max-width: 768px) {
    .ptb-100 {
        padding-top: 50px;
        padding-bottom: 50px;
    }

    .section-title {
        margin-bottom: 35px;
    }

    .section-title .title {
        font-size: 26px;
    }

    /* --- MOBILE SUB-MENU DRAWER --- */
    .offcanvas {
        position: fixed;
        bottom: 0;
        top: 0;
        right: 0;
        width: 300px;
        background-color: #321438 !important;
        z-index: 100000;
        transform: translateX(100%);
        transition: transform 0.3s ease-in-out;
        display: flex;
        flex-direction: column;
        box-shadow: -5px 0 25px rgba(0, 0, 0, 0.5);
    }

    .offcanvas.show {
        transform: translateX(0);
    }

    .offcanvas-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 16px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .offcanvas-header img {
        width: 130px;
        height: auto;
    }

    .offcanvas-header .close-btn {
        background: none;
        border: none;
        cursor: pointer;
    }

    .offcanvas-header .close-btn i {
        color: var(--white-color);
        font-size: 24px;
    }

    .offcanvas-body {
        padding: 20px;
        overflow-y: auto;
        flex: 1;
    }

    .mobile-nav {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .mobile-nav .nav-item {
        display: flex;
        align-items: center;
        gap: 16px;
        padding: 12px 16px;
        color: var(--white-color);
        font-size: 16px;
        font-weight: 500;
        border-radius: 8px;
    }

    .mobile-nav .nav-item:hover,
    .mobile-nav .nav-item.active {
        background: rgba(255, 255, 255, 0.08);
    }

    .mobile-nav .nav-item i.nav-icon-ti {
        font-size: 20px;
    }

    .mobile-submenu {
        background: rgba(0, 0, 0, 0.15);
        border-radius: 8px;
        margin: 4px 10px;
        padding: 8px 0;
        display: none;
        flex-direction: column;
        gap: 4px;
    }

    .mobile-submenu .sub-item {
        padding: 8px 20px 8px 45px;
        font-size: 15px;
        background: transparent !important;
        display: flex;
        align-items: center;
        color: var(--white-color);
    }

    .mobile-submenu .sub-item .dot {
        width: 6px;
        height: 6px;
        background-color: var(--white-color);
        border-radius: 50%;
        margin-right: 12px;
        opacity: 0.7;
    }

    .mobile-submenu .sub-item:hover .dot {
        background-color: var(--gold-accent);
        opacity: 1;
    }

    #navbarOffcanvas .apply-now-btn {
        width: calc(100% - 40px);
        margin: 20px;
        text-align: center;
        padding: 14px 0 !important;
        border-radius: 8px !important;
    }

    /* Flip cards layout restructure under 768px (disable flip, stack front and back) */
    .flip-card-wrapper {
        height: auto !important;
        perspective: none !important;
        background: var(--white-color);
        border: 1px solid #f0f0f0;
        border-radius: 12px;
        overflow: hidden;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.07);
    }

    .flip-card {
        height: auto !important;
        transform: none !important;
        transition: none !important;
        display: flex;
        flex-direction: column;
        cursor: default;
    }

    .flip-card-wrapper:hover .flip-card {
        transform: none !important;
    }

    .flip-card-front {
        position: relative !important;
        inset: auto !important;
        width: 100% !important;
        height: 150px !important;
        min-height: 150px !important;
        padding: 20px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        border: none !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        overflow: hidden !important;
        backface-visibility: visible !important;
        -webkit-backface-visibility: visible !important;
    }

    .flip-logo-img {
        height: 100px !important;
        width: auto !important;
        max-width: 180px !important;
    }

    .flip-card-back {
        position: relative !important;
        inset: auto !important;
        transform: none !important;
        height: auto !important;
        padding: 15px 20px 20px !important;
        border: none !important;
        border-top: 1px solid #f0f0f0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        overflow: visible !important;
        backface-visibility: visible !important;
        -webkit-backface-visibility: visible !important;
        align-items: flex-start !important;
        justify-content: flex-start !important;
    }

    /* ACCA intro banner vertical stack */
    .cpa-info-banner {
        display: flex;
        flex-direction: column;
    }

    .cpa-info-content {
        min-height: 220px;
        padding: 24px;
    }

    .cpa-info-content h3 {
        font-size: 27px;
    }

    .cpa-info-content p {
        font-size: 16px;
        margin-top: 20px;
    }

    .cpa-info-image {
        height: 230px;
    }

    /* Core Exam Structure grid items */
    .exam-grid {
        grid-template-columns: 1fr !important;
    }

    .exam-card {
        min-height: auto;
    }

    .exam-content {
        min-height: 270px;
    }

    .process-wrapper {
        margin: 30px 0 100px;
        padding: 40px 20px 130px;
    }

    .process-badge {
        font-size: 9px;
        width: 90%;
        text-align: center;
    }

    .process-flow {
        border-radius: 10px;
        bottom: -100px;
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .flow-item {
        font-size: 11px;
        padding: 5px;
    }

    /* Timeline Section dynamic stack rows */
    .timeline-row {
        flex-direction: column;
    }

    .row-left {
        width: 100%;
        border-radius: 0;
    }

    .row-right {
        width: 100%;
        border-radius: 0;
        padding: 10px 16px;
    }
}

/* --- Up to 425px / 375px / 320px (Mobile Portals / Phones) --- */
@media (max-width: 575px) {
    .container-fluid {
        padding: 0 15px;
    }

    .navbar-brand img {
        height: 55px;
    }

    .banner-img {
        width: 100%;
    }

    .hero-slider-warp {
        padding-top: 20px;
    }

    .program-hero-card {
        padding: 1.5rem 1rem;
    }

    .card-header h2 {
        font-size: 1.3rem;
    }

    .section-title .title {
        font-size: 22px;
        line-height: 1.3;
    }

    .ai-program-main .sub-title {
        font-size: 14px;
    }

    /* Stack AI Niche domains completely on very small widths */
    .domains-grid {
        grid-template-columns: 1fr !important;
    }

    .career-path-heading h2 {
        font-size: 24px;
    }

    .cpa-main-heading {
        font-size: 20px;
    }

    .cpa-info-content h3 {
        font-size: 22px;
    }

    .cpa-info-content p {
        font-size: 14px;
    }

    .cpa-info-image {
        height: 180px;
    }

    /* Process Flow layout changes */
    .process-wrapper {
        padding: 40px 20px 20px;
        margin: 30px 0 20px;
    }

    .process-flow {
        position: relative;
        left: 0;
        right: 0;
        bottom: 0;
        grid-template-columns: 1fr !important;
        margin-top: 20px;
    }

    /* Tee Step Cards */
    .step-card {
        padding: 24px 15px;
    }

    .step-title {
        font-size: 20px;
    }

    /* LMS prominent features layout */
    .section-container {
        padding: 0 !important;
        background: transparent !important;
    }

    .feature-card {
        padding: 15px;
    }

    /* Newsletter form input heights */
    .footer-widget .form-control {
        height: 50px;
    }
}