/* ============================================
   Professional Mobile Optimization Styles
   For CasaNegra Network, Store & Docs
   ============================================ */

/* Mobile-First Enhancements */
@media (max-width: 768px) {
    
    /* ============================================
       IMPROVED MOBILE NAVIGATION
       ============================================ */
    
    /* Professional Hamburger Menu Animation */
    .menu-toggle {
        position: relative;
        width: 48px;
        height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(59, 130, 246, 0.1);
        border: 2px solid rgba(59, 130, 246, 0.3);
        border-radius: 12px;
        cursor: pointer;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1001;
        -webkit-tap-highlight-color: transparent;
    }
    
    .menu-toggle:active {
        transform: scale(0.95);
    }
    
    .menu-toggle i {
        font-size: 1.5rem;
        color: var(--text-color);
        transition: transform 0.3s ease;
    }
    
    .menu-toggle.active i.fa-bars {
        transform: rotate(90deg);
        opacity: 0;
    }
    
    .menu-toggle.active i.fa-times {
        transform: rotate(0deg);
        opacity: 1;
    }
    
    /* Enhanced Mobile Menu */
    .nav-links {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        max-width: 100vw;
        height: calc(100vh - 70px);
        background: linear-gradient(135deg, rgba(10, 14, 39, 0.98) 0%, rgba(5, 8, 18, 0.98) 100%);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 2rem 0;
        transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1000;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    }
    
    .nav-links.active {
        left: 0;
    }
    
    .nav-links::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 3px;
        background: var(--gradient-primary);
    }
    
    .nav-links li {
        width: 100%;
        margin: 0;
        opacity: 0;
        transform: translateX(-20px);
        animation: slideInLeft 0.4s ease forwards;
    }
    
    .nav-links.active li:nth-child(1) { animation-delay: 0.1s; }
    .nav-links.active li:nth-child(2) { animation-delay: 0.15s; }
    .nav-links.active li:nth-child(3) { animation-delay: 0.2s; }
    .nav-links.active li:nth-child(4) { animation-delay: 0.25s; }
    .nav-links.active li:nth-child(5) { animation-delay: 0.3s; }
    .nav-links.active li:nth-child(6) { animation-delay: 0.35s; }
    
    @keyframes slideInLeft {
        to {
            opacity: 1;
            transform: translateX(0);
        }
    }
    
    .nav-links li a {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        padding: 1.25rem 1.5rem;
        font-size: 1.1rem;
        font-weight: 500;
        color: var(--text-color);
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        transition: all 0.3s ease;
        -webkit-tap-highlight-color: rgba(59, 130, 246, 0.2);
        position: relative;
    }
    
    .nav-links li a::before {
        content: '';
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 4px;
        background: var(--gradient-primary);
        transform: scaleY(0);
        transition: transform 0.3s ease;
    }
    
    .nav-links li a:hover,
    .nav-links li a:active {
        background: rgba(59, 130, 246, 0.1);
        padding-left: 2rem;
        color: var(--accent-color);
    }
    
    .nav-links li a:hover::before,
    .nav-links li a:active::before {
        transform: scaleY(1);
    }
    
    /* Language Selector Mobile */
    .nav-links .language-selector-wrapper {
        padding: 1.25rem 1.5rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }
    
    .nav-links .language-selector {
        width: 100%;
        padding: 1rem 1.25rem;
        font-size: 1.1rem;
        background: rgba(59, 130, 246, 0.1);
        border: 2px solid rgba(59, 130, 246, 0.3);
        border-radius: 10px;
    }
    
    /* ============================================
       OPTIMIZED TYPOGRAPHY FOR MOBILE
       ============================================ */
    
    /* Base font size adjustments */
    html {
        font-size: 16px;
    }
    
    body {
        font-size: 1rem;
        line-height: 1.6;
    }
    
    /* Heading sizes for mobile */
    h1 {
        font-size: 2rem !important;
        line-height: 1.2;
        margin-bottom: 1rem;
    }
    
    h2 {
        font-size: 1.75rem !important;
        line-height: 1.3;
        margin-bottom: 0.875rem;
    }
    
    h3 {
        font-size: 1.5rem !important;
        line-height: 1.4;
        margin-bottom: 0.75rem;
    }
    
    h4 {
        font-size: 1.25rem !important;
        line-height: 1.4;
        margin-bottom: 0.625rem;
    }
    
    /* Hero sections */
    .hero h1,
    .hero-rp h1,
    .hero-pvp h1,
    .hero-store h1 {
        font-size: 2.25rem !important;
        line-height: 1.2;
        letter-spacing: -0.02em;
    }
    
    .hero-subtitle,
    .hero-description {
        font-size: 1rem !important;
        line-height: 1.6;
        margin-top: 1rem;
    }
    
    /* Section titles */
    .section-title {
        font-size: 1.875rem !important;
        line-height: 1.3;
    }
    
    /* ============================================
       IMPROVED SPACING & LAYOUT
       ============================================ */
    
    .container {
        padding: 0 1.25rem !important;
    }
    
    section {
        padding: 3rem 0 !important;
    }
    
    /* Cards and containers */
    .card,
    .feature-card,
    .product-card,
    .server-card {
        padding: 1.5rem !important;
        margin-bottom: 1.5rem;
        border-radius: 16px;
    }
    
    /* Grid layouts */
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }
    
    /* ============================================
       ENHANCED BUTTONS FOR MOBILE
       ============================================ */
    
    .btn {
        padding: 1rem 1.5rem !important;
        font-size: 1rem !important;
        font-weight: 600;
        min-height: 48px; /* Minimum touch target size */
        border-radius: 12px;
        transition: all 0.2s ease;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
    
    .btn:active {
        transform: scale(0.98);
    }
    
    .btn-large {
        padding: 1.25rem 2rem !important;
        font-size: 1.1rem !important;
        min-height: 52px;
    }
    
    .btn-group {
        flex-direction: column;
        gap: 1rem;
        width: 100%;
    }
    
    .btn-group .btn {
        width: 100%;
    }
    
    /* ============================================
       IMPROVED FORM ELEMENTS
       ============================================ */
    
    input,
    textarea,
    select {
        font-size: 1rem !important;
        padding: 1rem 1.25rem !important;
        min-height: 48px;
        border-radius: 12px;
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
    }
    
    input:focus,
    textarea:focus,
    select:focus {
        outline: none;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    }
    
    /* ============================================
       FOOTER MOBILE OPTIMIZATION
       ============================================ */
    
    .footer {
        padding: 3rem 0 2rem !important;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 2.5rem;
        text-align: center;
    }
    
    .footer-links {
        text-align: center;
    }
    
    .footer-social {
        justify-content: center;
        gap: 1rem;
    }
    
    .footer-social a {
        width: 48px;
        height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 12px;
    }
    
    /* ============================================
       STATS & STATISTICS MOBILE
       ============================================ */
    
    .stats-grid,
    .hero-stats {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }
    
    .stat-item,
    .stat-card {
        padding: 1.5rem;
        text-align: center;
    }
    
    .stat-number {
        font-size: 2.25rem !important;
        font-weight: 700;
    }
    
    .stat-label {
        font-size: 0.95rem;
        margin-top: 0.5rem;
    }
    
    /* ============================================
       PRODUCT CARDS MOBILE
       ============================================ */
    
    .products-grid,
    .products-grid-new {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }
    
    .product-card,
    .product-card-new {
        padding: 1.5rem !important;
    }
    
    .product-image {
        height: 220px !important;
        border-radius: 12px;
    }
    
    .product-title {
        font-size: 1.25rem !important;
        margin: 1rem 0 0.5rem;
    }
    
    .product-price .price {
        font-size: 1.75rem !important;
        font-weight: 700;
    }
    
    /* ============================================
       IMPROVED NAVBAR FOR MOBILE
       ============================================ */
    
    .navbar {
        padding: 1rem 0 !important;
        height: auto;
        min-height: 70px;
    }
    
    .navbar .container {
        padding: 0 1.25rem;
    }
    
    .logo {
        flex: 1;
    }
    
    .logo h1 {
        font-size: 1.1rem !important;
    }
    
    .logo img {
        height: 40px !important;
        width: auto;
    }
    
    /* ============================================
       OVERLAY WHEN MENU IS OPEN
       ============================================ */
    
    body.menu-open {
        overflow: hidden;
        position: fixed;
        width: 100%;
    }
    
    body.menu-open::before {
        content: '';
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
    }
}

/* ============================================
   EXTRA SMALL DEVICES (phones < 480px)
   ============================================ */
@media (max-width: 480px) {
    
    .container {
        padding: 0 1rem !important;
    }
    
    h1 {
        font-size: 1.75rem !important;
    }
    
    h2 {
        font-size: 1.5rem !important;
    }
    
    h3 {
        font-size: 1.25rem !important;
    }
    
    .hero h1,
    .hero-rp h1,
    .hero-pvp h1,
    .hero-store h1 {
        font-size: 2rem !important;
    }
    
    .section-title {
        font-size: 1.625rem !important;
    }
    
    .btn {
        padding: 0.875rem 1.25rem !important;
        font-size: 0.95rem !important;
    }
    
    .card,
    .feature-card,
    .product-card {
        padding: 1.25rem !important;
    }
    
    .stat-number {
        font-size: 2rem !important;
    }
    
    .product-image {
        height: 200px !important;
    }
    
    .logo h1 {
        font-size: 1rem !important;
    }
    
    .logo img {
        height: 36px !important;
    }
}

/* ============================================
   TOUCH DEVICE OPTIMIZATIONS
   ============================================ */
@media (hover: none) and (pointer: coarse) {
    /* Remove hover effects on touch devices */
    a:hover,
    button:hover,
    .btn:hover {
        transform: none;
    }
    
    /* Larger touch targets */
    a,
    button,
    .btn,
    input[type="checkbox"],
    input[type="radio"] {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Better focus states for keyboard navigation */
    a:focus-visible,
    button:focus-visible,
    .btn:focus-visible {
        outline: 3px solid rgba(59, 130, 246, 0.5);
        outline-offset: 2px;
    }
}

/* ============================================
   PERFORMANCE OPTIMIZATIONS
   ============================================ */
@media (max-width: 768px) {
    /* Reduce animations on low-end devices */
    @media (prefers-reduced-motion: reduce) {
        *,
        *::before,
        *::after {
            animation-duration: 0.01ms !important;
            animation-iteration-count: 1 !important;
            transition-duration: 0.01ms !important;
        }
    }
    
    /* Optimize rendering */
    .card,
    .product-card,
    .feature-card {
        will-change: transform;
        transform: translateZ(0);
    }
}

