/* =============================================
   Responsive Design - Mobile & Tablet
   ============================================= */

/* Tablet (max-width: 992px) */
@media (max-width: 992px) {
    /* Typography */
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
    
    .section-title { font-size: 2rem; }
    
    /* Grid */
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    
    /* Footer */
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Hero */
    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile (max-width: 768px) */
@media (max-width: 768px) {
    /* Container */
    .container {
        padding: 0 15px;
    }
    
    /* Top Bar */
    .top-bar {
        display: none;
    }
    
    /* ===== MOBILE MENU SYSTEM - FINAL FIX ===== */
    
    /* Hamburger Toggle Button */
    .mobile-menu-toggle {
        display: flex !important;
        position: relative;
        z-index: 12000 !important;
    }
    
    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -7px);
    }
    
    /* Mobile Navigation Panel */
    .main-nav {
        position: fixed !important;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: var(--white);
        box-shadow: -5px 0 30px rgba(0, 0, 0, 0.5);
        flex-direction: column;
        align-items: flex-start;
        padding: var(--spacing-lg) var(--spacing-md);
        transition: right 0.3s ease;
        overflow-y: auto;
        overflow-x: hidden;
        z-index: 11990 !important;
    }
    
    .main-nav.active {
        right: 0 !important;
    }
    
    /* Mobile Overlay - MUST BE BEHIND MENU */
    .mobile-overlay {
        position: fixed !important;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.6);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
        pointer-events: none;
        z-index: 10900 !important;
    }
    
    .mobile-overlay.active {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }
    
    /* Menu Items */
    .nav-menu {
        flex-direction: column;
        width: 100%;
        gap: 0;
        position: relative;
        z-index: 10;
    }
    
    .nav-menu > li {
        width: 100%;
        border-bottom: 1px solid var(--gray-light);
        position: relative;
        z-index: 10;
    }
    
    .nav-menu > li > a {
        padding: 15px 0;
        width: 100%;
        display: block;
        position: relative;
        z-index: 10;
        cursor: pointer;
    }
    
    /* Dropdown Menu */
    .dropdown-menu {
        position: static !important;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background: var(--light-color);
        border-radius: var(--radius-md);
        margin: 8px 0;
        padding: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        z-index: 10;
    }
    
    .has-dropdown.active .dropdown-menu {
        max-height: 500px;
        padding: 8px 0;
    }
    
    .dropdown-menu li {
        list-style: none;
        position: relative;
        z-index: 10;
    }
    
    .dropdown-menu li a {
        padding: 12px 20px;
        display: block;
        font-size: 0.95rem;
        position: relative;
        z-index: 10;
        cursor: pointer;
    }
    
    .header-cta {
        margin: var(--spacing-md) 0 0 0;
        width: 100%;
        text-align: center;
        position: relative;
        z-index: 10;
    }
    
    /* Typography */
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    
    .section-title { font-size: 1.75rem; }
    .section-subtitle { font-size: 1rem; }
    
    /* Sections */
    .section {
        padding: var(--spacing-md) 0;
    }
    
    /* Grid */
    .grid-4,
    .grid-3,
    .grid-2 {
        grid-template-columns: 1fr;
    }
    
    /* Buttons */
    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    /* Float Buttons - Hide when menu open */
    body:has(.main-nav.active) .whatsapp-float,
    body:has(.main-nav.active) .call-float {
        display: none;
    }
    
    .whatsapp-float,
    .call-float {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
        bottom: 20px;
        z-index: 900;
    }
    
    .whatsapp-float {
        right: 20px;
    }
    
    .call-float {
        right: 85px;
    }
    
    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .footer-bottom-content {
        flex-direction: column;
        gap: var(--spacing-xs);
        text-align: center;
    }
    
    /* Hero */
    .hero {
        min-height: 400px;
    }
    
    .hero-content h1 {
        font-size: 1.75rem;
    }
    
    .hero-content p {
        font-size: 0.9rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
    
    .hero-buttons .btn {
        width: 100%;
    }
    
    /* Services */
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    .service-card {
        padding: var(--spacing-md);
    }
    
    /* Stats */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-sm);
    }
    
    /* Features */
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    /* Contact Form */
    .contact-grid {
        grid-template-columns: 1fr;
    }
    
    /* About Page */
    .about-grid {
        grid-template-columns: 1fr;
    }
    
    .about-image {
        margin-bottom: var(--spacing-md);
    }
    
    /* Service Detail */
    .service-detail-grid {
        grid-template-columns: 1fr;
    }
    
    .service-sidebar {
        order: -1;
        margin-bottom: var(--spacing-md);
    }
}

/* Small Mobile (max-width: 480px) */
@media (max-width: 480px) {
    html {
        font-size: 14px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .whatsapp-float,
    .call-float {
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
        bottom: 15px;
    }
    
    .whatsapp-float {
        right: 15px;
    }
    
    .call-float {
        right: 75px;
    }
}

/* Print Styles */
@media print {
    .top-bar,
    .header,
    .footer,
    .whatsapp-float,
    .call-float,
    .mobile-menu-toggle {
        display: none;
    }
    
    body {
        font-size: 12pt;
    }
    
    a {
        text-decoration: underline;
    }
}
