@media (max-width: 992px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .hero .container,
    .testimonial-content,
    .commitment-content {
        flex-direction: column;
        text-align: center;
    }

    .hero-text,
    .hero-image,
    .testimonial-image,
    .testimonial-text,
    .commitment-text,
    .commitment-image {
        width: 100%;
    }

    .hero-image {
        margin-top: 30px;
    }

    .hero-image img,
    .testimonial-image img {
        width: 80%;
        margin: 0 auto;
        display: block;
    }

    .brands-grid img {
        height: 40px;
    }
}

@media (max-width: 768px) {
    .top-bar {
        /* display: none; REMOVED to show top bar */
        display: block;
    }

    /* Resize logo for mobile */
    .logo img {
        height: 50px;
    }

    .hamburger {
        display: block;
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 100px;
        /* Adjusted based on header height with top bar */
        flex-direction: column;
        background-color: #fff;
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 10px rgba(0, 0, 0, 0.1);
        padding: 20px 0;
        z-index: 999;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-menu li {
        margin: 15px 0;
        width: 100%;
        /* Ensure full width for centering */
    }

    /* Mobile Dropdown Handling */
    .dropdown {
        display: block;
        /* Stack vertically */
    }

    .dropdown-content {
        position: static;
        /* No absolute positioning on mobile */
        display: none;
        /* Hidden by default */
        min-width: 100%;
        box-shadow: none;
        border-top: none;
        background-color: #f9f9f9;
        text-align: center;
    }

    .dropdown.active .dropdown-content {
        display: block;
    }

    .dropdown-content a {
        padding: 10px;
        font-size: 0.9rem;
        border-bottom: 1px solid #eee;
    }

    .hero-title {
        font-size: 2rem;
    }

    .footer-content {
        flex-direction: column;
        gap: 20px;
    }
}

@media (max-width: 992px) {
    /* Tablet සහ Mobile සඳහා */

    .hero-split {
        flex-direction: column-reverse;
        /* Mobile වලදී Image එක උඩටත්, Text එක යටටත් ගැනීම */
        min-height: auto;
        /* ස්වයංක්‍රීය උස */
    }

    .hero-split-content,
    .hero-split-image {
        width: 100%;
        /* සම්පූර්ණ පළල ගැනීම */
        flex: 0 0 100%;
    }

    /* Image කොටස Mobile සඳහා */
    .right-side-img {
        height: 400px;
        /* Image එකට නිශ්චිත උසක් දීම */
    }

    /* Text කොටස Mobile සඳහා */
    .left-side-blue {
        justify-content: center;
        /* මැදට ගැනීම */
        text-align: center;
        padding: 60px 20px;
    }

    .split-inner-container {
        padding-right: 20px;
        /* දකුණු පස පරතරය ඉවත් කිරීම */
        max-width: 100%;
    }

    .hero-title-white {
        font-size: 2.5rem;
        /* Font size එක කුඩා කිරීම */
    }
}

@media (max-width: 992px) {
    /* Tablet සහ Mobile සඳහා */

    .services-split-layout {
        flex-direction: column;
        /* එකක් යට එකක් පෙන්වීමට */
        gap: 40px;
    }

    .left-text-content,
    .right-grid-content {
        width: 100%;
        /* සම්පූර්ණ පළල */
    }

    .right-grid-content {
        /* Mobile වලදීත් Grid එක 2x2 ලෙස තබා ගැනීම ලස්සනයි, 
           නැත්නම් 1x1 ඕන නම් grid-template-columns: 1fr; කරන්න */
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {

    /* ඉතා කුඩා Screen සඳහා Card එකින් එක පෙන්වීමට */
    .right-grid-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 992px) {
    .main-hero-wrapper {
        flex-direction: column-reverse;
        /* Phone වලදී පින්තූරය උඩට */
        min-height: auto;
    }

    .hero-right-image {
        height: 350px;
        /* Phone එකේදි පින්තූරයේ උස */
    }

    .hero-blue-area {
        padding: 50px 20px;
        text-align: center;
    }

    .hero-logo-area {
        padding: 30px 20px;
        text-align: center;
        background-color: #f9f9f9;
        /* Phone එකේදි Logo එක කැපී පෙනෙන්න පොඩි වෙනසක් */
    }

    .hero-title {
        font-size: 2.2rem;
    }
}

@media (max-width: 768px) {
    .brand-logos-container {
        gap: 30px;
    }

    .brand-logos-container img {
        height: 50px;
        /* Phone එකේදි මධ්‍යම ප්‍රමාණයට පෙනෙන්න */
    }
}

/* Tablet & Small Desktop (Max Width: 991px) */
@media (max-width: 991px) {
    .hero-section h1 {
        font-size: 2.5rem;
    }

    .grid-4,
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }

    .row {
        gap: 30px;
    }
}

/* Mobile Devices (Max Width: 768px) */
@media (max-width: 768px) {
    .contact-info {
        flex-direction: column;
        gap: 5px;
        text-align: center;
    }

    .nav-container {
        flex-direction: column;
        gap: 15px;
    }

    .nav-menu {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    .hero-section {
        padding: 80px 0;
    }

    .hero-section h1 {
        font-size: 2rem;
    }

    /* Make grids single column on mobile */
    .grid-4,
    .grid-3 {
        grid-template-columns: 1fr;
    }

    .row {
        flex-direction: column;
    }

    .cashflow-section .image-col {
        order: -1;
        margin-bottom: 20px;
    }

    /* Image on top */

    .brands-flex {
        gap: 30px;
    }

    .brands-flex img {
        height: 50px;
    }

    .footer-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
}

@media (max-width: 768px) {

    /* Stack Head Office Section */
    .head-office-section .row {
        flex-direction: column;
    }

    .image-col {
        order: -1;
        /* Image on top for mobile if needed, or remove line to keep text top */
        margin-bottom: 20px;
    }

    /* Adjust Form Padding */
    .form-wrapper {
        padding: 25px;
    }

    .form-header h2 {
        font-size: 2rem;
    }
}

/* ================= RESPONSIVE STYLES ================= */

/* --- Tablet & Small Desktop (Max Width: 991px) --- */
@media (max-width: 991px) {

    /* Global Container Padding */
    .container {
        padding: 0 30px;
    }

    /* Header Adjustments */
    .hero-section {
        padding: 80px 0;
    }

    .hero-section h1 {
        font-size: 2.2rem;
    }

    /* Calculator Grid - Stack Columns */
    .calc-grid-layout {
        /* IMPORTANT: Reverse column order on mobile so Calculator comes FIRST, Breakdown SECOND */
        flex-direction: column-reverse;
        gap: 40px;
    }

    .left-col,
    .right-col {
        width: 100%;
        flex: auto;
    }

    /* Results Cards - Keep 3 in a row on tablet, but maybe shrink font */
    .res-value {
        font-size: 1.3rem;
    }
}

/* --- Mobile Devices (Max Width: 768px) --- */
@media (max-width: 768px) {

    /* --- Top Bar (Black Strip) --- */
    .top-bar .contact-info {
        flex-direction: column;
        gap: 8px;
        text-align: center;
        padding: 5px 0;
    }

    .top-bar .contact-info span {
        display: block;
    }

    /* --- Navbar --- */
    .nav-container {
        flex-direction: column;
        gap: 20px;
    }

    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
        width: 100%;
    }

    .nav-menu li a {
        font-size: 0.9rem;
    }

    /* --- Controls (Buttons) --- */
    .controls-wrapper {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    .toggle-group {
        width: 100%;
        justify-content: center;
    }

    .toggle-btn {
        flex: 1;
        /* Make buttons equal width on mobile */
        padding: 10px 15px;
        font-size: 0.85rem;
        text-align: center;
    }

    /* --- Results Section --- */
    .results-cards {
        flex-direction: column;
        /* Stack result cards vertically */
        gap: 15px;
    }

    .res-card {
        padding: 20px;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    }

    .res-value {
        font-size: 1.8rem;
        /* Make numbers big and clear on mobile */
    }

    /* --- Summary Box --- */
    .sum-flex {
        flex-direction: column;
        gap: 20px;
    }

    .sum-col {
        border-bottom: 1px solid #eee;
        padding-bottom: 15px;
    }

    .sum-col:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }

    /* --- Breakdown Tabs --- */
    .slab-tabs {
        flex-direction: row;
        /* Keep tabs side by side but smaller */
    }

    .slab-tab {
        font-size: 0.8rem;
        padding: 8px 5px;
    }

    /* --- Footer --- */
    .footer-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
}

/* --- Extra Small Mobile (Max Width: 480px) --- */
@media (max-width: 480px) {
    .hero-section h1 {
        font-size: 1.8rem;
    }

    .btn-calc,
    .btn-pdf {
        font-size: 0.85rem;
    }

    .breakdown-range {
        font-size: 0.8rem;
    }

    .tax-amount {
        font-size: 0.85rem;
    }
}