/* --- RESPONSIVE & MOBILE DESIGN --- */

/* Tablet & Mobile Layout (Max Width: 991px) */
@media screen and (max-width: 991px) {
    .container {
        padding: 0 20px;
    }

    .hero-title {
        font-size: 2.8rem;
    }

    .section-title {
        font-size: 2rem;
    }

    /* Navbar Tablet Adjustments */
    .nav-links {
        gap: 1rem;
    }
}

/* Mobile Layout (Max Width: 768px) */
@media screen and (max-width: 768px) {

    /* Header & Navigation */
    .mobile-toggle {
        display: flex;
        z-index: 1001;
        margin-left: 1rem;
    }

    nav {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        position: relative;
    }

    /* Force Logo to Left */
    .logo {
        margin-right: auto;
        /* Pushes other items to right */
        font-size: 1rem;
        /* Slightly smaller to fit */
        white-space: nowrap;
        /* max-width: 50%; RE MOVED */
        flex: 1 1 auto;
        /* Allow grow/shrink */
        min-width: 0;
        /* Allow shrinking if absolutely needed */
        overflow: hidden;
        text-overflow: ellipsis;
        display: flex;
        align-items: center;
    }

    .logo img {
        width: 32px !important;
        height: 32px !important;
        border-radius: 50% !important;
        object-fit: cover !important;
        margin-right: 8px;
    }

    /* Login Button - Moved to Menu for space */
    #loginBtn {
        display: none !important;
    }


    .nav-links {
        position: fixed;
        top: 70px;
        /* Header Height */
        left: 0;
        width: 100%;
        height: auto;
        background: rgba(255, 255, 255, 0.98);
        -webkit-backdrop-filter: blur(10px);
        backdrop-filter: blur(10px);
        flex-direction: column;
        padding: 2rem;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
        transform: translateY(-150%);
        /* Hidden by default */
        transition: transform 0.4s ease-in-out;
        z-index: 1000;
        border-bottom: 2px solid var(--accent);
    }

    .nav-links.active {
        transform: translateY(0);
        /* Slide down */
        box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
    }

    .nav-link {
        font-size: 1.1rem;
        padding: 1rem 0;
        width: 100%;
        text-align: center;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
        color: var(--primary);
    }

    /* Hero Section */
    .hero {
        padding-top: 120px;
        /* Tighter hero */
        padding-bottom: 4rem;
        text-align: center;
        display: flex;
        flex-direction: column;
        justify-content: center;
        min-height: 70vh;
        background-attachment: scroll !important;
        background-position: center center !important;
    }

    .hero-title {
        font-size: 2.2rem;
        /* Slightly smaller for better fit */
        line-height: 1.2;
        margin-bottom: 0.8rem;
    }

    .hero-description {
        font-size: 0.95rem;
        padding: 0 1rem;
        margin-bottom: 1.5rem;
    }

    .hero-buttons {
        flex-direction: column;
        gap: 0.8rem;
        /* Reduced gap */
        padding: 0 1.5rem;
        width: 100%;
        max-width: 400px;
        margin: 0 auto;
    }

    .btn {
        width: 100%;
    }

    /* Grids to Single/Dual Column with reduced gaps */
    .services-grid {
        grid-template-columns: 1fr;
        gap: 1.2rem;
        /* Tighter gap between cards */
        padding: 0 0.5rem;
        /* Prevent card edge touching */
    }

    /* Compact Service Cards */
    .service-card {
        padding: 1.5rem;
        /* Reduced from default */
        text-align: center;
        /* Ensure centered on mobile */
        border-radius: 16px;
    }

    .service-icon {
        width: 60px;
        /* Smaller icon container */
        height: 60px;
        font-size: 1.5rem;
        /* Smaller icon */
        margin-bottom: 1rem;
        margin-left: auto;
        margin-right: auto;
    }

    .service-card h3 {
        font-size: 1.3rem;
        margin-bottom: 0.8rem;
    }

    .service-description {
        font-size: 0.95rem;
        margin-bottom: 1rem;
        line-height: 1.5;
    }

    .service-feature-item {
        font-size: 0.95rem;
        margin-bottom: 0.8rem;
        justify-content: center;
    }

    .service-action {
        margin-top: 0.8rem;
        padding: 0.7rem 1.5rem;
        font-size: 0.85rem;
    }

    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
        /* Reduced gap */
    }

    /* Mobile Filter: Switch to Dropdown */
    .product-filters {
        display: none !important;
    }

    .mobile-filter-container {
        display: block !important;
        width: 100%;
        margin-bottom: 0.5rem;
        padding: 0 1rem;
    }

    .mobile-category-select {
        width: 100%;
        padding: 0.8rem 1rem;
        font-size: 0.95rem;
        border: 2px solid var(--border);
        border-radius: 12px;
        background-color: #fff;
        color: var(--text-main);
        outline: none;
        appearance: none;
        background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23007CB2%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
        background-repeat: no-repeat;
        background-position: right .7rem top 50%;
        background-size: .65em auto;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    }

    /* Tighter Mobile Header Spacing */
    .product-header {
        gap: 0.5rem !important;
        margin-bottom: 1.2rem !important;
    }

    /* Limit visible items */
    .product-grid:not(.expanded) .product-card:nth-child(n+7) {
        display: none;
    }

    .view-all-container {
        display: flex !important;
        width: 100%;
        margin-top: 2rem;
        justify-content: center;
    }

    .about-content {
        grid-template-columns: 1fr;
        display: flex;
        flex-direction: column;
        gap: 2rem;
        /* Reduced from 2.5rem */
    }

    .about-image-column {
        order: -1;
        width: 100%;
        margin-bottom: 1rem;
    }

    .about-text-column {
        padding: 0 1rem;
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .about-text-column p {
        text-align: center;
        margin-bottom: 1.2rem;
    }

    .about-stats-grid {
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 1rem;
        /* Tighter stats */
        margin-top: 0.5rem;
    }

    .stat-item {
        text-align: center;
        padding: 0.8rem;
        background: var(--bg-light);
        border-radius: 12px;
        width: 100%;
    }

    .about-experience-badge {
        position: absolute;
        bottom: -15px;
        right: 50%;
        transform: translateX(50%);
        width: max-content;
        padding: 0.6rem 1.2rem;
        z-index: 10;
        min-width: unset;
    }

    .badge-number {
        font-size: 1.4rem;
        display: block;
    }

    /* Ultra Compact Premium Mobile Footer */
    .footer-content {
        display: grid;
        grid-template-columns: 1fr 1.3fr;
        /* Links Left | Contact Right */
        gap: 1.5rem 0.5rem;
        /* Gap between rows / cols */
        text-align: left;
        padding-bottom: 0.5rem;
    }

    /* Top Row: Brand & Socials */
    .footer-about {
        grid-column: 1 / -1;
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding-bottom: 0.8rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        /* Subtle Divider */
        margin-bottom: 0.5rem;
    }

    .footer-logo {
        margin-bottom: 0;
        font-size: 0.95rem;
        font-weight: 700;
        color: #fff;
        display: flex;
        align-items: center;
        letter-spacing: 0.5px;
    }

    .footer-logo img {
        height: 24px !important;
        /* Compact Logo */
        margin-right: 8px;
    }

    .footer-description {
        display: none;
    }

    /* Elegant Social Icons */
    .social-links {
        margin: 0;
        display: flex;
        gap: 0.8rem;
    }

    .social-link {
        width: 28px;
        height: 28px;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 50%;
        /* Circle looks more premium */
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .social-link i {
        font-size: 0.9rem;
        color: #fff;
    }

    /* Links Columns */
    .footer-links h3 {
        font-size: 0.75rem;
        /* Micro Heading */
        text-transform: uppercase;
        letter-spacing: 1px;
        margin-bottom: 0.8rem;
        color: rgba(255, 255, 255, 0.6);
        /* Muted Heading */
        font-weight: 600;
        display: block;
    }

    .footer-links h3::after {
        display: none;
    }

    .footer-links ul {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    .footer-links a {
        font-size: 0.85rem;
        color: rgba(255, 255, 255, 0.9);
        /* Bright Links */
        text-decoration: none;
        padding: 0;
        transition: color 0.2s;
        display: inline-flex;
        align-items: center;
    }

    .footer-links a:active {
        color: var(--accent);
    }

    .footer-links a i {
        margin-right: 6px;
        color: var(--accent);
        font-size: 0.8rem;
        width: 14px;
        text-align: center;
    }

    /* Copyright */
    .copyright {
        margin-top: 1rem;
        padding-top: 0;
        border: none;
        font-size: 0.7rem;
        color: rgba(255, 255, 255, 0.3);
        text-align: center;
        letter-spacing: 0.5px;
    }

    #testimonials {
        padding: 3rem 0 !important;
    }

    #testimonials .section-subtitle {
        margin-bottom: 2rem !important;
    }

    /* Testimonials Mobile Compact */
    .testimonial-card {
        padding: 2rem 1.5rem !important;
        margin: 0 10px !important;
        border-radius: 20px !important;
        flex: 0 0 calc(90% - 20px) !important;
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.05) !important;
        text-align: center !important;
        background: #fff !important;
        border: 1px solid rgba(0, 0, 0, 0.03) !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }

    .testimonial-quote-icon {
        font-size: 1.25rem !important;
        margin-bottom: 0.8rem !important;
    }

    .testimonial-text {
        font-size: 0.95rem !important;
        line-height: 1.6 !important;
        margin-bottom: 1.2rem !important;
        color: #475569 !important;
    }

    .testimonial-author {
        gap: 0.8rem !important;
    }

    .author-avatar-img {
        width: 45px !important;
        height: 45px !important;
        border: 2px solid #f1f5f9 !important;
    }

    .testimonial-author h4 {
        font-size: 0.95rem !important;
        margin-bottom: 0 !important;
    }

    .testimonial-author p {
        font-size: 0.8rem !important;
    }

    .testimonial-nav {
        margin-top: 1.5rem !important;
        gap: 0.8rem !important;
    }

    /* Hide Modal Details (Example Projects/Key Features) on Mobile */
    .modal-details-grid {
        display: none !important;
    }

    /* Better Modal Header on Mobile */
    .modal-content {
        padding: 2rem 1.5rem !important;
    }

    .modal-header-container {
        padding-right: 2rem;
        /* Avoid overlap with Close Button */
        justify-content: flex-start !important;
        /* Left Align */
    }

    .modal-header-container h2 {
        font-size: 1.6rem !important;
        /* Smaller on mobile */
        text-align: left !important;
    }

    .testimonial-nav {
        margin-top: 1.5rem;
        /* Reduced from 3rem */
        gap: 0.8rem;
    }

    .testimonial-arrow {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }

    /* Modal Buttons stacked on mobile for better touch targets */
    .modal-buttons {
        flex-direction: column !important;
        gap: 1rem;
        margin-top: 1.5rem;
    }

    .modal-buttons .btn {
        width: 100%;
        padding: 14px;
        font-size: 1rem;
        border-radius: 50px;
        /* Consistent Pill Shape */
    }

    /* Product Controls */
    .product-controls {
        flex-direction: column;
        gap: 0.8rem;
    }

    .product-search-container {
        width: 100%;
    }
}

/* Small Mobile (Max Width: 480px) */
@media screen and (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .hero-title {
        font-size: 2rem;
    }

    .section-title {
        font-size: 1.75rem;
    }

    .about-stats-grid {
        flex-direction: column;
        gap: 1.5rem;
    }

    .testimonial-card {
        padding: 1.5rem;
    }

}