/* ===== RESPONSIVE STYLESHEET ===== */

/*
 * This file contains mobile-first responsive styles.
 * Default styles are for mobile (<768px).
 * Media queries are used to add styles for larger screens.
 */

/* ===== MOBILE (< 768px) ===== */
.container {
    padding-left: 1rem;
    padding-right: 1rem;
}

.section {
    padding: 3rem 0;
}

.section-title {
    font-size: 2rem;
}
.section-subtitle {
    font-size: 1rem;
}

/* --- Header & Mobile Navigation --- */
.nav-toggle {
    display: flex;
    z-index: 1001; /* Above menu */
    color: var(--text-light);
}

.nav-toggle i {
    transition: transform 0.4s;
}

.nav-toggle.active i {
    transform: rotate(90deg);
}

#nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 320px;
    height: 100vh;
    background: var(--bg-darker);
    padding: 6rem 2rem 2rem;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -10px 0 30px rgba(0,0,0,0.5);
}

#nav-menu.active {
    right: 0;
}

.nav-list {
    flex-direction: column;
    align-items: flex-start;
    gap: 2rem;
}

.nav-link {
    font-size: 1.2rem;
}

/* --- Navigation Overlay --- */
.nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.4s;
    pointer-events: none;
}

.nav-overlay.active {
    opacity: 1;
    pointer-events: all;
}


/* --- Hero --- */
.hero-title {
    font-size: clamp(2.5rem, 10vw, 3.5rem);
}
.hero-subtitle {
    font-size: clamp(1rem, 4vw, 1.2rem);
}

.hero-buttons {
    flex-direction: column;
    width: 100%;
    max-width: 350px;
    margin: 0 auto;
}
.btn {
    width: 100%;
}

/* --- Grids --- */
#statistics-grid, 
#services-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

/* --- Cards --- */
.glassmorphism-card {
    padding: 1.5rem;
}

/* --- Form --- */
.contact-form {
    grid-template-columns: 1fr;
    padding: 1rem;
}

/* --- Footer --- */
.footer-container {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
}
.footer-contact li, .footer-socials {
    justify-content: center;
}

/* --- Fixed Elements --- */
.whatsapp-float {
    width: 50px;
    height: 50px;
    bottom: 1rem;
    right: 1rem;
}
.back-to-top {
    width: 45px;
    height: 45px;
    bottom: 5rem;
    right: 1rem;
}

/* --- Performance --- */
/* Reduce particle count on mobile */
.particle:nth-child(n+16) {
    display: none;
}

/* ===== TABLET (>= 768px) ===== */
@media (min-width: 768px) {
    .container {
        padding-left: 2rem;
        padding-right: 2rem;
    }
    
    .section {
        padding: 4rem 0;
    }
    
    /* --- Header & Navigation --- */
    .nav-toggle {
        display: none;
    }
    
    #nav-menu {
        position: static;
        flex-direction: row;
        width: auto;
        height: auto;
        background: transparent;
        padding: 0;
        box-shadow: none;
    }
    
    .nav-list {
        flex-direction: row;
        align-items: center;
        gap: 2.5rem;
    }
    
    .nav-link {
        font-size: 1rem;
    }
    
    /* --- Hero --- */
    .hero-buttons {
        flex-direction: row;
        max-width: none;
    }
    .btn {
        width: auto;
    }
    
    /* --- Grids --- */
    #statistics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    #services-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* --- Form --- */
    .contact-form {
        grid-template-columns: 1fr 1fr;
        padding: 2rem;
    }
    .form-group-full {
        grid-column: 1 / -1;
    }
    
    /* --- Footer --- */
    .footer-container {
        grid-template-columns: repeat(2, 1fr);
        text-align: left;
    }
    .footer-contact li, .footer-socials {
        justify-content: flex-start;
    }
}

/* ===== DESKTOP (>= 1024px) ===== */
@media (min-width: 1024px) {
    .section {
        padding: 6rem 0;
    }
    
    /* --- Grids --- */
    #statistics-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    #services-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* --- Footer --- */
    .footer-container {
        grid-template-columns: repeat(3, 1fr);
    }

    /* --- Performance --- */
    /* Restore all particles */
    .particle:nth-child(n+16) {
        display: block;
    }
}

/* ===== RTL SUPPORT ===== */
[dir="rtl"] #nav-menu {
    right: auto;
    left: -100%;
    transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

[dir="rtl"] #nav-menu.active {
    left: 0;
}

[dir="rtl"] .whatsapp-float {
    right: auto;
    left: 1rem;
}

[dir="rtl"] .back-to-top {
    right: auto;
    left: 1rem;
}

[dir="rtl"] .footer-links a:hover {
    padding-left: 0;
    padding-right: 5px;
}

[dir="rtl"] .btn i {
    transform: scaleX(-1);
}

@media (min-width: 768px) {
    [dir="rtl"] .whatsapp-float {
        left: 2rem;
    }

    [dir="rtl"] .back-to-top {
        left: 2rem;
    }
}