/* ==================== W-CREATORS UNIFIED MOBILE STYLES ==================== */
/* Version 1.0 - Optimized for all devices */

/* ==================== CSS VARIABLES ==================== */
:root {
    --mobile-nav-bg: rgba(3, 7, 18, 0.98);
    --mobile-nav-border: rgba(255, 255, 255, 0.1);
    --mobile-link-color: #ffffff;
    --mobile-link-hover: #22a559;
    --mobile-submenu-bg: rgba(255, 255, 255, 0.03);
    --mobile-toggle-bg: rgba(255, 255, 255, 0.05);
    --mobile-toggle-border: rgba(255, 255, 255, 0.1);
    --primary: #22a559;
    --primary-light: #2ecc71;
    --gradient-primary: linear-gradient(135deg, #22a559 0%, #06b6d4 100%);
}

/* ==================== MOBILE MENU TOGGLE BUTTON ==================== */
.mobile-menu-toggle {
    display: none;
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    background: var(--mobile-toggle-bg);
    border: 1px solid var(--mobile-toggle-border);
    border-radius: 12px;
    cursor: pointer;
    position: relative;
    z-index: 1001;
    align-items: center;
    justify-content: center;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.mobile-menu-toggle span {
    position: absolute;
    width: 22px;
    height: 2px;
    background: #ffffff;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
    border-radius: 2px;
}

.mobile-menu-toggle span::before,
.mobile-menu-toggle span::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 2px;
    background: #ffffff;
    left: 0;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.mobile-menu-toggle span::before { top: -7px; }
.mobile-menu-toggle span::after { bottom: -7px; }

/* Active state - X icon */
.mobile-menu-toggle.active span {
    background: transparent;
}
.mobile-menu-toggle.active span::before {
    top: 0;
    transform: rotate(45deg);
}
.mobile-menu-toggle.active span::after {
    bottom: 0;
    transform: rotate(-45deg);
}

/* ==================== MOBILE NAVIGATION OVERLAY ==================== */
.mobile-nav {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--mobile-nav-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 999;
    padding: 100px 24px 40px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.mobile-nav.active {
    opacity: 1;
    visibility: visible;
}

/* Prevent body scroll when menu is open */
body.menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* ==================== MOBILE NAVIGATION LIST ==================== */
.mobile-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-nav-item {
    border-bottom: 1px solid var(--mobile-nav-border);
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 0;
    font-size: 18px;
    font-weight: 500;
    color: var(--mobile-link-color);
    text-decoration: none;
    transition: color 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

.mobile-nav-link:hover,
.mobile-nav-link:active {
    color: var(--mobile-link-hover);
}

.mobile-nav-link svg {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

/* Submenu toggle state */
.mobile-nav-item.open > .mobile-nav-link svg,
.mobile-nav-item.submenu-open > .mobile-nav-link svg {
    transform: rotate(180deg);
}

/* ==================== MOBILE SUBMENU ==================== */
.mobile-submenu {
    display: none;
    padding: 0 0 16px 0;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mobile-nav-item.open .mobile-submenu,
.mobile-nav-item.submenu-open .mobile-submenu {
    display: block;
}

.mobile-submenu-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-submenu-link {
    display: block;
    padding: 14px 20px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 16px;
    border-radius: 12px;
    transition: all 0.3s ease;
    margin: 4px 0;
}

.mobile-submenu-link:hover,
.mobile-submenu-link:active {
    background: var(--mobile-submenu-bg);
    color: #ffffff;
}

/* ==================== MOBILE CTA BUTTON ==================== */
.mobile-nav-cta {
    margin-top: 32px;
    padding: 0;
}

.mobile-nav-cta .btn,
.mobile-nav-cta a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 16px 24px;
    background: var(--gradient-primary);
    color: #ffffff;
    text-decoration: none;
    border-radius: 14px;
    font-weight: 600;
    font-size: 16px;
    border: none;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    min-height: 56px;
}

.mobile-nav-cta .btn:hover,
.mobile-nav-cta a:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(34, 165, 89, 0.4);
}

/* ==================== UTILITY CLASSES ==================== */
.w-full { width: 100%; }
.hide-mobile { display: block; }
.show-mobile { display: none; }

/* ==================== RESPONSIVE BREAKPOINTS ==================== */

/* Tablet and smaller */
@media (max-width: 968px) {
    /* Show mobile menu toggle */
    .mobile-menu-toggle {
        display: flex !important;
    }

    /* Enable mobile nav */
    .mobile-nav {
        display: block !important;
    }

    /* Hide desktop navigation */
    .nav-links {
        display: none !important;
    }

    .nav-cta.hide-mobile,
    .hide-mobile {
        display: none !important;
    }

    .show-mobile {
        display: block !important;
    }

    /* Adjust nav padding for mobile */
    .nav {
        padding: 15px 20px !important;
    }

    .nav.scrolled {
        padding: 12px 20px !important;
    }

    /* Ensure logo fits */
    .nav-logo-text {
        font-size: 1.2rem !important;
    }

    .nav-logo-icon {
        width: 44px !important;
        height: 44px !important;
        font-size: 1.3rem !important;
    }
}

/* Mobile phones */
@media (max-width: 600px) {
    .nav {
        padding: 12px 16px !important;
    }

    .nav.scrolled {
        padding: 10px 16px !important;
    }

    .nav-logo-text {
        font-size: 1.1rem !important;
    }

    .nav-logo-icon {
        width: 40px !important;
        height: 40px !important;
        font-size: 1.2rem !important;
        border-radius: 10px !important;
    }

    .mobile-nav {
        padding: 90px 20px 30px;
    }

    .mobile-nav-link {
        font-size: 17px;
        padding: 16px 0;
    }

    .mobile-submenu-link {
        font-size: 15px;
        padding: 12px 16px;
    }
}

/* Small phones */
@media (max-width: 380px) {
    .nav-logo-text {
        font-size: 1rem !important;
    }

    .nav-logo-icon {
        width: 36px !important;
        height: 36px !important;
        font-size: 1.1rem !important;
    }

    .mobile-menu-toggle {
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
    }
}

/* ==================== HEADER FIXES FOR MOBILE ==================== */
@media (max-width: 968px) {
    /* Ensure nav container is properly aligned */
    .nav-container {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100%;
        gap: 12px;
    }

    /* Fix z-index stacking */
    .nav {
        z-index: 1000 !important;
    }

    .mobile-menu-toggle {
        z-index: 1001 !important;
    }

    .mobile-nav {
        z-index: 999 !important;
    }

    /* Mega menu should be hidden on mobile */
    .mega-menu {
        display: none !important;
    }
}

/* ==================== TOUCH-FRIENDLY IMPROVEMENTS ==================== */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    .mobile-nav-link {
        min-height: 56px;
        padding: 18px 0;
    }

    .mobile-submenu-link {
        min-height: 48px;
        padding: 14px 20px;
    }

    .mobile-menu-toggle {
        min-width: 48px;
        min-height: 48px;
    }

    /* Remove hover effects on touch devices */
    .mobile-nav-link:hover,
    .mobile-submenu-link:hover {
        background: transparent;
    }

    .mobile-nav-link:active,
    .mobile-submenu-link:active {
        background: rgba(255, 255, 255, 0.05);
    }
}

/* ==================== LANDSCAPE MODE FIX ==================== */
@media (max-height: 500px) and (orientation: landscape) {
    .mobile-nav {
        padding-top: 70px;
    }

    .mobile-nav-link {
        padding: 12px 0;
        font-size: 16px;
    }

    .mobile-submenu-link {
        padding: 10px 16px;
        font-size: 14px;
    }

    .mobile-nav-cta {
        margin-top: 20px;
    }
}

/* ==================== PRINT STYLES ==================== */
@media print {
    .mobile-menu-toggle,
    .mobile-nav {
        display: none !important;
    }
}
