/* 
   Premium Mobile UX System v3.0 
   Redesigned for Crane Database 2026
*/

/* --- 1. FULL-SCREEN MEGA MENU OVERLAY (GLASSMORPHISM) --- */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 20000;
    display: none;
    flex-direction: column;
    overflow-y: auto;
    padding: 0;
    /* Handled by internal containers */
    box-sizing: border-box;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu-overlay.mobile-menu-open {
    display: flex;
    animation: slideInBottom 0.4s ease-out;
}

@keyframes slideInBottom {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 20px;
    background: #fff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 2;
}

.mobile-menu-header span {
    font-size: 18px;
    font-weight: 800;
    color: #111827;
    letter-spacing: -0.02em;
}

.close-menu-btn {
    background: #f3f4f6;
    border: none;
    font-size: 20px;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #4b5563;
    transition: all 0.2s;
}

.close-menu-btn:active {
    transform: scale(0.9);
    background: #e5e7eb;
}

/* --- 2. PREMIUM ACCORDION & LINKS --- */
.mobile-menu-content {
    padding: 10px 16px 40px;
}

.mobile-accordion-wrapper {
    margin-bottom: 8px;
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.mobile-accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 16px;
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s;
}

.mobile-accordion-header span {
    display: flex;
    align-items: center;
    gap: 14px;
}

.mobile-accordion-header span i {
    font-size: 18px;
    color: var(--primary-brand);
    opacity: 0.9;
}

.mobile-accordion-header .arrow {
    font-size: 12px;
    color: #9ca3af;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-accordion-header.active {
    background: #f9fafb;
    color: var(--primary-brand);
}

.mobile-accordion-header.active .arrow {
    transform: rotate(180deg);
}

.mobile-accordion-content {
    display: none;
    padding: 0 16px 16px 16px;
    flex-direction: column;
    gap: 0;
    border-top: 1px solid rgba(0, 0, 0, 0.02);
}

.mobile-accordion-content.active {
    display: flex;
    animation: fadeInDown 0.3s ease;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mobile-accordion-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    color: #4b5563;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.2s;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}

.mobile-accordion-link:last-child {
    border-bottom: none;
}

.mobile-accordion-link i {
    font-size: 16px;
    color: var(--primary-brand);
    width: 20px;
    text-align: center;
    opacity: 0.8;
}

.mobile-accordion-link:active {
    color: var(--primary-brand);
    transform: translateX(4px);
}

.mobile-menu-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 16px;
    border-radius: 16px;
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    text-decoration: none;
    transition: all 0.2s;
    margin-bottom: 8px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.mobile-menu-link i {
    font-size: 18px;
    color: var(--primary-brand);
}

.mobile-menu-link:active {
    background: #f9fafb;
    transform: translateX(4px);
}

/* --- 3. GLOBAL MOBILE POLISH (< 768px) --- */
@media (max-width: 768px) {
    .container {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    /* Fixed Bottom Safe Zones for iPhones */
    body {
        padding-bottom: env(safe-area-inset-bottom);
    }

    /* Full-Width Data Detail */
    .detail-layout {
        padding: 0 !important;
    }

    .detail-unified-card,
    .detail-specs-container {
        border-radius: 0 !important;
        border-left: none !important;
        border-right: none !important;
        box-shadow: none !important;
        width: 100% !important;
        border-bottom: 8px solid #f3f4f6;
    }

    .specs-table td,
    .specs-table th {
        padding: 14px 10px !important;
        border-bottom: 1px solid #f9fafb;
    }

    .spec-label {
        background: #f9fafb !important;
        font-weight: 600 !important;
        color: #4b5563 !important;
    }
}

/* --- 4. HEADER FIXES --- */
@media (max-width: 768px) {
    header {
        background: #fff;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    }

    .header-nav-links,
    .header-search-container,
    .auth-buttons-group {
        display: none !important;
    }

    .mobile-toggle-btn {
        display: flex !important;
        color: #111827;
        font-size: 22px;
    }

    .header-logo-text {
        font-weight: 900 !important;
        letter-spacing: -0.04em !important;
        color: var(--primary-brand) !important;
    }
}