/* ========================================
   RESPONSIVE CSS - Mobile First Approach
   ======================================== */

/* Base styles are already mobile-friendly in main.css */
/* This file contains mobile-specific overrides and enhancements */

/* ========================================
   GLOBAL CONTAINER FIX
   ======================================== */

/* Prevent horizontal overflow */
* {
    box-sizing: border-box;
}

body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

/* CRITICAL FIX: Container should be limited width on desktop, not 100% */
.container {
    width: 90%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 15px;
    padding-right: 15px;
    overflow-x: hidden;
}

/* ========================================
   MOBILE NAVIGATION
   ======================================== */

/* CRITICAL: Hide mobile menu button on DESKTOP ONLY */
@media (min-width: 992px) {
    .mobile-menu-btn {
        display: none !important;
    }
}

@media (max-width: 991px) {

    /* Show Hamburger Menu Button - Compact Style */
    .mobile-menu-btn {
        display: flex;
        flex-direction: column;
        justify-content: space-around;
        width: 20px;
        height: 20px;
        background: var(--primary-color, #FF5E14);
        border: none;
        border-radius: 4px;
        cursor: pointer;
        padding: 4px;
        z-index: 1001;
        position: relative;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    }

    .mobile-menu-btn .bar {
        width: 100%;
        height: 2px;
        background-color: #fff;
        transition: all 0.3s ease;
        border-radius: 2px;
    }

    .mobile-menu-btn.active .bar:nth-child(1) {
        transform: rotate(45deg) translate(3px, 3px);
    }

    .mobile-menu-btn.active .bar:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-btn.active .bar:nth-child(3) {
        transform: rotate(-45deg) translate(3px, -3px);
    }

    /* Mobile Navigation Menu - Compact Style */
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 250px;
        height: 100vh;
        background: #ffffff;
        flex-direction: column;
        align-items: flex-start;
        padding: 70px 20px 30px;
        transition: right 0.3s ease;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.3);
        border-left: 4px solid #FF5E14;
        z-index: 1000;
        overflow-y: auto;
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links a {
        margin: 0 0 6px 0;
        padding: 8px 0;
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
        font-size: 14px;
        text-align: left;
        width: 100%;
        background: transparent !important;
        color: #333 !important;
    }

    .nav-links a:hover,
    .nav-links a.active {
        color: #FF5E14 !important;
    }

    /* Mobile Overlay */
    .nav-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.7);
        z-index: 999;
    }

    .nav-overlay.active {
        display: block;
    }
}


/* ========================================
   HERO SECTION
   ======================================== */

@media (max-width: 768px) {
    .hero {
        min-height: 500px;
        padding: 100px 0 60px;
        background-size: cover !important;
        background-position: center !important;
        background-attachment: scroll !important;
    }

    .hero-content {
        text-align: center;
        max-width: 100%;
        padding: 0 20px;
    }

    .hero h1 {
        font-size: 28px;
        line-height: 1.3;
        margin-bottom: 16px;
    }

    .hero p {
        font-size: 15px;
        margin: 16px 0;
        line-height: 1.6;
    }

    .hero-tagline {
        font-size: 11px;
        margin-bottom: 12px;
    }

    .hero-btns {
        flex-direction: column;
        gap: 12px;
        width: 100%;
    }

    .hero-btns .btn-primary,
    .hero-btns .btn-secondary {
        width: 100%;
        padding: 14px 24px;
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 24px;
    }

    .hero p {
        font-size: 14px;
    }
}


/* ========================================
   STATS/COUNTER SECTION
   ======================================== */

@media (max-width: 768px) {
    .stats-bar {
        padding: 2rem 0;
        margin-top: -30px;
        overflow-x: hidden;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 1rem;
    }

    .stat-item {
        padding: 12px 8px;
        min-width: 0;
    }

    .stat-item:not(:last-child)::after {
        display: none;
    }

    .counter {
        font-size: 1.5rem !important;
        margin-bottom: 4px;
    }

    .stat-item h3 {
        font-size: 1.5rem;
        margin-bottom: 4px;
    }

    .stat-item p {
        font-size: 11px;
        line-height: 1.3;
    }

    .stat-item i,
    .stat-item img {
        font-size: 24px;
        width: 24px;
        height: 24px;
        margin-bottom: 8px;
    }
}

@media (max-width: 480px) {
    .stats-bar {
        padding: 1.5rem 0;
        margin-top: -20px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        padding: 0.75rem;
    }

    .stat-item {
        padding: 10px 6px;
    }

    .counter {
        font-size: 1.2rem !important;
        margin-bottom: 2px;
    }

    .stat-item h3 {
        font-size: 1.2rem;
        margin-bottom: 2px;
    }

    .stat-item p {
        font-size: 10px;
        line-height: 1.2;
    }

    .stat-item i,
    .stat-item img {
        font-size: 20px;
        width: 20px;
        height: 20px;
        margin-bottom: 6px;
    }
}

/* ========================================
   ABOUT SECTION
   ======================================== */

@media (max-width: 768px) {
    .about-content {
        flex-direction: column;
        text-align: center;
    }

    .about-image {
        margin: 0 0 30px 0;
        max-width: 100%;
    }

    .about-text {
        padding: 0;
    }

    .about-text h2 {
        font-size: 28px;
    }
}

/* ========================================
   CAPABILITIES/SERVICES GRID
   ======================================== */

@media (max-width: 992px) {

    .capabilities-grid,
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 576px) {

    .capabilities-grid,
    .services-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .capability-card,
    .service-card {
        padding: 24px;
    }

    .capability-card h3,
    .service-card h3 {
        font-size: 18px;
    }
}

/* ========================================
   PRODUCTS GRID
   ======================================== */

@media (max-width: 992px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   WHY TRUST SECTION
   ======================================== */

@media (max-width: 768px) {
    .trust-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .trust-item {
        text-align: center;
        padding: 24px;
    }
}

/* ========================================
   FOOTER - ULTRA COMPACT HORIZONTAL LAYOUT
   ======================================== */

/* Newsletter Section - Compact */
@media (max-width: 768px) {
    .newsletter-section {
        padding: 1.5rem 0 !important;
    }

    .newsletter-section h3 {
        font-size: 1.2rem !important;
    }

    .newsletter-section p {
        font-size: 0.8rem !important;
    }
}

@media (max-width: 480px) {
    .newsletter-section {
        padding: 1rem 0 !important;
    }

    .newsletter-section h3 {
        font-size: 1rem !important;
    }

    .newsletter-section p {
        font-size: 0.75rem !important;
    }
}

/* Footer - Mobile Responsive */
@media (max-width: 768px) {
    .main-footer {
        padding: 1rem 0 0.5rem !important;
    }

    /* Hide separators on mobile */
    .main-footer span[style*="color: rgba(255,255,255,0.3)"] {
        display: none !important;
    }

    /* Stack items vertically on mobile */
    .main-footer div[style*="display: flex"] {
        flex-direction: column !important;
        gap: 0.4rem !important;
    }

    .main-footer .social-links {
        flex-direction: row !important;
        gap: 0.4rem !important;
    }
}

@media (max-width: 480px) {
    .main-footer {
        padding: 0.75rem 0 0.5rem !important;
    }

    .main-footer p {
        font-size: 0.7rem !important;
    }

    .main-footer a {
        font-size: 0.75rem !important;
    }

    .main-footer .social-links a {
        padding: 0.3rem 0.5rem !important;
        font-size: 0.7rem !important;
    }
}

/* ========================================
   FORMS & MODALS
   ======================================== */

@media (max-width: 768px) {
    .modal-dialog {
        margin: 20px;
        max-width: calc(100% - 40px);
    }

    .form-row {
        flex-direction: column;
    }

    .form-group {
        width: 100%;
        margin-bottom: 16px;
    }

    input[type="text"],
    input[type="email"],
    input[type="tel"],
    textarea,
    select {
        font-size: 16px;
        /* Prevents zoom on iOS */
    }

    .btn {
        width: 100%;
        padding: 14px 24px;
    }
}


/* ========================================
   UTILITY CLASSES
   ======================================== */

@media (max-width: 768px) {
    .container {
        padding: 0 16px;
        max-width: 100%;
    }

    .section {
        padding: 50px 0;
        overflow-x: hidden;
    }

    .section-title {
        font-size: 26px;
        margin-bottom: 12px;
        line-height: 1.3;
    }

    .section-subtitle {
        font-size: 14px;
        margin-bottom: 30px;
        line-height: 1.5;
    }

    /* Hide on mobile */
    .hide-mobile {
        display: none !important;
    }

    /* Show only on mobile */
    .show-mobile {
        display: block !important;
    }

    /* Full width on mobile */
    .full-width-mobile {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Text alignment */
    .text-center-mobile {
        text-align: center !important;
    }

    /* Spacing adjustments */
    .mb-mobile-20 {
        margin-bottom: 20px !important;
    }

    .mt-mobile-20 {
        margin-top: 20px !important;
    }
}

@media (max-width: 480px) {
    .section {
        padding: 40px 0;
    }

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

    .section-subtitle {
        font-size: 13px;
    }
}

/* ========================================
   TOUCH TARGETS (Minimum 44x44px)
   ======================================== */

@media (max-width: 768px) {

    a,
    button,
    .btn,
    input[type="submit"] {
        min-height: 44px;
        min-width: 44px;
    }
}

/* ========================================
   IMAGES & MEDIA
   ======================================== */

@media (max-width: 768px) {
    img {
        max-width: 100%;
        height: auto;
    }

    /* Lazy loading placeholder */
    img[loading="lazy"] {
        background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
        background-size: 200% 100%;
        animation: loading 1.5s infinite;
    }
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ========================================
   PERFORMANCE OPTIMIZATIONS
   ======================================== */

/* Reduce animations on mobile for better performance */
@media (max-width: 768px) and (prefers-reduced-motion: no-preference) {
    * {
        animation-duration: 0.3s !important;
        transition-duration: 0.3s !important;
    }
}

/* ========================================
   LANDSCAPE ORIENTATION
   ======================================== */

@media (max-width: 768px) and (orientation: landscape) {
    .hero {
        min-height: 400px;
    }

    .modal-dialog {
        max-height: 90vh;
        overflow-y: auto;
    }
}

/* ========================================
   ABOUT PAGE - TESTIMONIALS RESPONSIVE
   ======================================== */

@media (max-width: 768px) {

    /* Testimonials Section - Fix Width Issues */
    #testimonialCarousel .carousel-item .row {
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding: 1.5rem !important;
    }

    #testimonialCarousel .carousel-control-prev,
    #testimonialCarousel .carousel-control-next {
        width: 10% !important;
    }

    #testimonialCarousel .carousel-control-prev {
        left: -5% !important;
    }

    #testimonialCarousel .carousel-control-next {
        right: -5% !important;
    }

    #testimonialCarousel .carousel-indicators {
        bottom: -40px !important;
    }

    /* Testimonial Image - Smaller on Mobile */
    #testimonialCarousel img {
        width: 100px !important;
        height: 100px !important;
    }

    /* Testimonial Text - Smaller Font */
    #testimonialCarousel .lead {
        font-size: 0.95rem !important;
    }

    #testimonialCarousel h5 {
        font-size: 1rem !important;
    }

    #testimonialCarousel small {
        font-size: 0.75rem !important;
    }
}

@media (max-width: 480px) {

    /* Extra Small Devices - Even More Compact */
    #testimonialCarousel .carousel-item .row {
        padding: 1rem !important;
    }

    #testimonialCarousel img {
        width: 80px !important;
        height: 80px !important;
    }

    #testimonialCarousel .lead {
        font-size: 0.85rem !important;
    }

    /* Hide carousel controls on very small screens */
    #testimonialCarousel .carousel-control-prev,
    #testimonialCarousel .carousel-control-next {
        display: none !important;
    }
}