/* =====================================================
   RESPONSIVE / MOBILE OVERRIDES
   Loaded last on every page (after inline <style> blocks)
   so these rules win over page-specific desktop styles.
   ===================================================== */

/* ---------- Global safety nets ---------- */
body {
    overflow-x: hidden;
}

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

/* ---------- Navbar (collapsed below 1200px) ---------- */
@media (max-width: 1199.98px) {
    .navbar {
        min-height: 70px !important;
    }

    .navbar .navbar-brand {
        height: 70px !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    /* Logo: smaller and kept inside the bar so it doesn't cover the menu */
    .navbar .navbar-brand img {
        width: 60px !important;
        height: 60px !important;
        margin: 0 !important;
    }

    .navbar .navbar-toggler {
        margin-right: 16px !important;
    }

    .navbar .navbar-nav {
        flex-wrap: wrap;
        padding: 8px 20px 16px !important;
    }

    .navbar .navbar-nav .nav-link {
        margin-right: 0 !important;
        padding: 11px 0 !important;
        white-space: normal;
        border-bottom: 1px solid #f0f0f0;
    }

    /* Long menu stays scrollable on short phones */
    .navbar-collapse {
        max-height: calc(100vh - 70px);
        overflow-y: auto;
    }

    .whatsapp-nav-icon {
        margin: 10px 0 0 !important;
        justify-content: flex-start !important;
    }
}


/* ---------- Tablets & phones (<= 991px) ---------- */
@media (max-width: 991.98px) {
    .display-1 { font-size: 3.5rem; }
    .display-3 { font-size: 2.6rem; }
    .display-5 { font-size: 2.2rem; }

    /* Page headers */
    .page-header {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }

    .page-header .container {
        padding-top: 1.5rem !important;
        padding-bottom: 1.5rem !important;
    }

    /* Products: OFFGRID / ONGRID comparison rows stack */
    .compare-row {
        flex-direction: column;
        margin: 30px 16px !important;
    }

    .compare-row .compare-label {
        width: 100% !important;
        padding: 14px;
        font-size: 20px !important;
        background: #f4fbf7;
        border-bottom: 2px solid #32C36C;
        text-align: center;
    }

    .compare-row .compare-col {
        width: 100% !important;
        border-left: none !important;
    }

    .compare-row .compare-col + .compare-col {
        border-top: 2px solid #32C36C;
    }
}


/* ---------- Phones & small tablets (<= 767px) ---------- */
@media (max-width: 767.98px) {
    h1, .h1 { font-size: 1.9rem; }
    h2, .h2 { font-size: 1.6rem; }
    h3, .h3 { font-size: 1.35rem; }

    .display-1 { font-size: 3rem; }
    .display-3 { font-size: 2.1rem; }
    .display-4 { font-size: 2rem; }
    .display-5 { font-size: 1.8rem; }
    .display-6 { font-size: 1.6rem; }

    /* Big inline-styled headings */
    [style*="font-size:44px"],
    [style*="font-size:40px"] {
        font-size: 28px !important;
        line-height: 1.25;
    }

    /* Section padding a bit tighter */
    .py-5 {
        padding-top: 2.25rem !important;
        padding-bottom: 2.25rem !important;
    }

    .p-5 {
        padding: 1.75rem !important;
    }

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

    /* Hero carousel: every slide the same height, thumbnails smaller */
    .header-carousel .owl-carousel-item {
        min-height: 320px;
    }

    .header-carousel .owl-carousel-item img {
        height: 100% !important;
    }

    .header-carousel .owl-dots {
        width: 40px;
        right: 10px;
    }

    .header-carousel .owl-dots .owl-dot {
        width: 28px;
        height: 28px;
    }

    .header-carousel .owl-dots .owl-dot.active {
        width: 38px;
        height: 38px;
    }

    /* Index video gallery: one column */
    .video-gallery {
        padding: 40px 16px !important;
    }

    .video-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }

    .video-grid .video-wide {
        grid-column: auto !important;
        max-width: 100% !important;
    }

    /* Products: green pill section titles */
    .pill-title {
        font-size: 20px !important;
        padding: 12px 22px !important;
        border-radius: 20px !important;
        margin: 0 16px;
        line-height: 1.4;
    }

    /* Products: subsidy tables scroll sideways instead of overflowing */
    .table-scroll {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 24px 16px;
    }

    .table-scroll table {
        width: 100% !important;
        min-width: 520px;
        margin: 0 !important;
        font-size: 14px !important;
    }

    /* Testimonial nav arrows fit the screen */
    .testimonial-carousel .owl-nav,
    .testimonial-carousel:hover .owl-nav {
        width: 90%;
    }

    /* Portfolio images not too tall */
    .portfolio-img {
        height: 240px;
    }

    /* Forms: full-width submit buttons are easier to tap */
    form .btn[type="submit"],
    form button[type="submit"] {
        width: 100%;
    }

    /* Career page */
    .career-hero h1 { font-size: 30px !important; }
    .career-hero p  { font-size: 16px !important; }
    .career-heading { font-size: 26px !important; }
    .application-box { padding: 20px !important; }
}


/* ---------- Small phones (<= 575px) ---------- */
@media (max-width: 575.98px) {
    /* Bootstrap's 3rem gutters are wider than the phone padding: shrink them */
    .g-5,
    .gx-5 {
        --bs-gutter-x: 1.5rem;
    }

    /* Index: Mission / Values / Vision cards */
    .mv-card {
        min-width: 0;
        width: 100%;
        padding: 36px 20px !important;
    }

    .mv-card > div:first-child {
        width: 220px !important;
        height: auto !important;
        aspect-ratio: 1 / 1;
        margin-bottom: 28px !important;
    }

    .mv-card > div:first-child img {
        width: 150px !important;
    }

    /* Round icon badges next to text must not get squashed */
    .d-flex > .btn-square,
    .d-flex > .btn-sm-square,
    .d-flex > .btn-lg-square {
        flex-shrink: 0;
    }

    .d-flex > .btn-lg-square + .ms-4,
    .d-flex > .btn-square + .ms-4 {
        margin-left: 0.75rem !important;
    }

    .display-1 { font-size: 2.6rem; }
    .display-3 { font-size: 1.8rem; }

    .container,
    .container-fluid {
        padding-left: 16px;
        padding-right: 16px;
    }

    .header-carousel .owl-carousel-item {
        min-height: 240px;
    }

    .header-carousel .owl-dots {
        display: none;
    }

    .breadcrumb {
        font-size: 14px;
    }

    #flashMessage {
        width: calc(100% - 32px);
        padding: 16px 20px;
        font-size: 15px;
    }

    .footer .btn.btn-social {
        margin-bottom: 6px;
    }

    .compare-row .compare-col {
        padding: 14px !important;
    }
}
