/* --- Responsive Design (Premium V2) --- */

/* --- Tablet / Laptop (Max Width: 1024px) --- */
@media (max-width: 1024px) {
    .container {
        width: 95%;
    }

    h1 {
        font-size: 3rem;
    }

    h2 {
        font-size: 2.2rem;
    }

    /* Header Compact */
    .company-title {
        font-size: 1.5rem;
    }

    .company-tagline {
        font-size: 0.8rem;
        letter-spacing: 1px;
    }

    .company-tagline::before,
    .company-tagline::after {
        width: 20px;
    }

    .company-tagline::before {
        left: -30px;
    }

    .company-tagline::after {
        right: -30px;
    }

    /* Grids */
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    /* Footer: force stack on tablets to match "iPad Mini" look */
    .footer-content {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 40px;
    }

    .footer-section {
        width: 100%;
        max-width: 500px;
        /* Limit width for readability */
    }

    /* Center Links on Tablet */
    .footer-links ul {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .footer-links li {
        display: block;
    }

    /* Contact Info Center */
    .footer-contact p {
        justify-content: center;
    }

    .footer-section:last-child {
        grid-column: auto;
        /* Reset grid prop */
        text-align: center;
    }

    /* Contact Page: Stack Form and Map on Tablet */
    .grid-2 {
        grid-template-columns: 1fr;
        gap: 40px;
    }
}

/* --- Mobile (Max Width: 768px) --- */
@media (max-width: 768px) {

    /* --- Header & Top Bar --- */
    .top-header-section {
        display: block;
        padding: 10px 0;
    }

    /* Navbar */
    .navbar {
        padding: 10px 0;
        top: 0;
        position: sticky;
        /* Fix Navbar Position */
        position: -webkit-sticky;
        /* Safari support */
        z-index: 1000;
        width: 100%;
    }

    .navbar .container {
        justify-content: space-between;
        position: relative;
    }

    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(255, 255, 255, 0.98);
        text-align: center;
        backdrop-filter: blur(10px);
        flex-direction: column;
        height: auto;
        max-height: 0;
        overflow: hidden;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
        transition: 0.4s ease;
        padding: 0;
        z-index: 999;
    }

    .nav-links.active {
        max-height: 80vh;
        padding: 20px 0;
        overflow-y: auto;
    }

    .nav-links a {
        width: 100%;
        text-align: center;
        padding: 15px;
        border-bottom: 1px solid #eee;
    }

    /* Mobile Toggle */
    .mobile-toggle {
        display: block !important;
        font-size: 1.8rem;
        cursor: pointer;
        position: static;
    }

    /* Hero Slider */
    .hero-slider {
        height: 70vh;
        margin-top: 0;
    }

    .slide-content h1 {
        font-size: 2rem;
    }

    .slide-content p {
        font-size: 1rem;
    }

    /* Grids to Stack */
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    /* --- Footer --- */
    .footer-content {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 40px;
    }

    .footer-section {
        width: 100%;
        max-width: 400px;
    }

    .footer-logo-large {
        max-width: 150px;
        margin: 0 auto;
    }

    .footer-links ul {
        display: flex;
        flex-direction: column;
        gap: 10px;
        padding: 0;
    }

    .footer-links li {
        display: block;
        margin: 0;
    }

    /* Contact Info Alignment */
    .footer-contact p {
        display: flex;
        flex-direction: column;
        /* Stack icon and text if needed, or keep row */
        align-items: center;
        justify-content: center;
        margin-bottom: 15px;
        word-break: break-all;
        /* Prevent email overflow */
    }

    .footer-contact i {
        margin-bottom: 5px;
        font-size: 1.2rem;
        color: var(--secondary-color);
    }

    /* Flow Graph */
    .flow-graph-container {
        flex-direction: column;
    }

    .flow-node {
        width: 100% !important;
        margin-bottom: 15px !important;
    }

    /* Services Rows */
    .service-row,
    .service-row.reverse {
        flex-direction: column;
        text-align: center;
    }

    /* Center Explore Services Button */
    .btn-explore-services {
        margin: 30px auto 0 !important;
        /* Auto margins for centering */
        display: inline-block;
    }

    /* Floating Icons */
    .floating-icons {
        bottom: 20px;
        left: 20px;
    }

    /* --- Contact Page Specifics --- */
    .page-header {
        padding: 60px 0 !important;
    }

    .page-header h1 {
        font-size: 2.5rem;
    }

    /* Contact Form & Map */
    .contact-form-area,
    .contact-map-area {
        padding: 20px;
        width: 100%;
        /* Force full width */
        box-sizing: border-box;
        /* Ensure padding doesn't add to width */
        overflow: hidden;
        /* Prevent internal overflow */
    }

    .map-container iframe {
        height: 300px;
        /* Smaller map */
    }

    .office-timings {
        margin-top: 20px;
        padding: 20px;
    }

    /* Typography Adjustments */
    .contact-form-area h2 {
        font-size: 1.5rem;
        margin-bottom: 15px;
    }

    .contact-form-area p {
        font-size: 0.9rem;
        margin-bottom: 20px;
    }

    /* Spacing between Form and Details */
    .contact-details {
        margin-top: 40px !important;
        padding-top: 20px;
        border-top: 1px solid #eee;
    }

    /* Fix long text overflow (Email/Address) */
    .contact-details p,
    .contact-details a {
        word-break: break-word;
        /* Important for long emails */
        overflow-wrap: break-word;
        font-size: 0.9rem;
    }

    /* Align Icons and Text */
    .detail-item {
        display: flex;
        align-items: flex-start;
        /* Top align icon with text */
        gap: 15px;
        margin-bottom: 20px;
        text-align: left;
    }

    .detail-item i {
        font-size: 1.2rem;
        color: var(--secondary-color);
        margin-top: 4px;
        /* Slight optical adjustment */
        min-width: 20px;
    }

    .form-control {
        font-size: 16px;
        /* Prevent iOS zoom */
    }
}

/* --- Small Mobile (Max Width: 480px) --- */
@media (max-width: 480px) {
    .slide-content h1 {
        font-size: 1.8rem;
    }

    .company-title {
        font-size: 1.2rem;
    }

    .btn {
        padding: 12px 30px;
        font-size: 0.8rem;
        width: 100%;
        /* Full width button */
    }
}