/* ===============================
   MOBILE HEADER
   =============================== */

@media (max-width: 768px) {
    .logo-image {
        position: fixed;
        top: -5px;
        left: -15px;
        width: 230px;
        max-height: 80px;
        box-sizing: border-box;
        z-index: 4;
    }

    .Logonewnew {
        display: inline-block;
        position: relative;
        z-index: 999;
    }
    /* Mobile menu logo inside the dropdown */
    .mobile-menu .logo-image {
        display: block;
        margin: 0 auto 20px; /* center horizontally + spacing below */
        max-width: 250px; /* optional: control size */
        height: auto;
        border-radius: 12px; /* optional: soft rounded corners */
        background: color white;
    }
}

/* ===============================
   MOBILE NAV (LIGHT THEME)
   =============================== */
@media screen and (max-width: 768px) {
    /* Kill desktop nav */
    .desktop-menu,
    .desktop-nav,
    .menu-content,
    .header-text {
        display: none !important;
    }

    /* Hamburger */
    .hamburger {
        display: block;
        position: fixed;
        top: 10px;
        right: 20px;
        justify-content: flex-end; /* RIGHT */
        font-size: 32px;
        cursor: pointer;
        z-index: 1000000; /* higher than the menu's 999999 */
        color: black;
        align-items: center;
    }
    /* ===============================
   MOBILE SLIDE MENU - FUTURISTIC WHITE
   =============================== */
    .mobile-menu {
        display: block;
        width: 90vw;
        height: 100vh;
        position: fixed;
        top: 0;
        right: -90vw;

        /* Main gradient + neon top-right glow */
        background: radial-gradient(
                circle at top right,
                rgba(95, 170, 236, 0.6) 0%,
                rgba(95, 170, 236, 0) 35%
            ),
            linear-gradient(
                to bottom,
                #ffffff 0%,
                /* top: pure white */ #f0f4fb 75%,
                /* white/ice tone for top 75% */ #5faaec 90%,
                /* blue starts at 75% */ #5ea4f3 100% /* neon blue at bottom */
            );

        backdrop-filter: blur(18px); /* stronger glassy effect */
        -webkit-backdrop-filter: blur(18px);

        color: #000000;
        overflow-y: auto;
        padding-top: 90px;
        transition: right 0.35s ease, box-shadow 0.35s ease;
        z-index: 999999; /* higher than everything */

        /* Soft shadows for depth and neon glow */
        box-shadow: -6px 0 20px rgba(0, 0, 0, 0.12),
            inset 0 0 50px rgba(255, 255, 255, 0.2),
            0 0 25px rgba(95, 170, 236, 0.4); /* subtle neon halo */

        border-left: 2px solid rgba(95, 170, 236, 0.2); /* subtle neon outline */
        border-radius: 0 0 0 12px; /* rounded bottom-left corner */
    }

    .mobile-menu.open {
        right: 0;
    }

    .mobile-menu ul {
        list-style: none;
        padding: 0 20px;
        margin: 0;
    }

    .mobile-menu li {
        margin-bottom: 12px;
    }

    /* Top-level dropdown buttons */
    .mobile-menu .has-submenu > a {
        display: block;
        padding: 12px;
        color: #000000;
        font-weight: 600;
        border-radius: 8px;
        cursor: pointer;
        border: 1px solid #e2e5e9;
        transition: background-color 0.2s ease;
    }

    .mobile-menu .has-submenu > a:hover {
        background-color: #e9edf2;
    }

    /* Submenu container */
    .mobile-menu .submenu {
        display: none;
        margin-top: 6px;
        padding-left: 12px;
        border-left: 2px solid #007bff;
    }

    .mobile-menu li.active > .submenu {
        display: block;
    }

    /* Submenu links */
    .mobile-menu .submenu li a {
        display: block;
        padding: 8px 10px;
        font-size: 14px;
        color: #000000;
        border-radius: 6px;
        transition: background-color 0.2s ease;
    }

    /* Dot for leaf submenu items */
    .mobile-menu .submenu li:not(.has-submenu) > a::before {
        content: "●";
        color: #007bff;
        margin-right: 8px;
        font-size: 12px;
    }

    .mobile-menu .submenu li a:hover {
        background-color: #f1f5f9;
    }

    /* Mobile logo */
    .mobile-logo {
        text-align: center;
        padding: 15px 0;
        border-bottom: 1px solid #eee;
    }

    .mobile-logo .logo-image {
        width: 120px;
        height: auto;
    }

    /* Remove background/border on Products section submenu links */
    .mobile-menu > ul > li.has-submenu:nth-child(3) .submenu li a {
        background: none !important;
        border: none !important;
        border-radius: 0 !important;
        padding: 0 6px !important; /* optional: adjust spacing */
    }

    /* Surgical dropdown Link */
    .card-link {
        display: block;
        padding: 12px;
        border: 1px solid #e2e5e9;
        border-radius: 8px;

        color: #000;
        font-weight: 600;
        text-align: left;
        text-decoration: none;
        transition: background 0.2s;
    }

    .card-link:hover {
        background-color: #e9edf2;
    }

    /* Move the last links a bit to the right and make text black */
    .mobile-menu ul li:last-child,
    .mobile-menu ul li:nth-last-child(2) {
        margin-left: 10px; /* adjust how far right */
        font-weight: bold;
    }

    .mobile-menu ul li:last-child a,
    .mobile-menu ul li:nth-last-child(2) a {
        color: #000000; /* black text */
        text-decoration: none; /* optional: remove underline */
        font-weight: bold;
    }
    /* ===============================
   ROTATE ARROW ON SUBMENU OPEN
   =============================== */
    .mobile-menu .has-submenu > a .arrow {
        display: inline-block;
        margin-left: 5px; /* spacing from text */
        transition: transform 0.3s ease;
        vertical-align: middle; /* align with text */
    }

    .mobile-menu .has-submenu.active > a .arrow {
        transform: rotate(180deg);
    }
}
