@media (max-width: 767.98px) {

    .desktop-nav {
        display: none !important;
    }

    body {
        top: 44px !important;
        margin-bottom: 0 !important;
        padding-bottom: 30px;
    }

    .mobile-br-spacer {
        display: none !important;
    }

    .mobile-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 44px;
        background: #fff;
        border-bottom: 1px solid #e0e0e0;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 12px;
        z-index: 1040;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    }

    .mobile-hamburger {
        background: none;
        border: none;
        font-size: 20px;
        color: #003366;
        cursor: pointer;
        padding: 4px 8px;
        line-height: 1;
    }

    .mobile-header-logo img {
        height: 28px;
        max-height: 28px;
        width: auto;
    }

    .mobile-header-right {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .mobile-avatar {
        width: 30px;
        height: 30px;
        border-radius: 50%;
        background: #003366;
        color: #fff;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 11px;
        font-weight: 600;
        text-transform: uppercase;
    }

    .drawer-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1045;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

    .drawer-overlay.active {
        opacity: 1;
        pointer-events: auto;
    }

    .mobile-drawer {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 280px;
        max-width: 85vw;
        background: #fff;
        z-index: 1050;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        display: flex;
        flex-direction: column;
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
    }

    .mobile-drawer.open {
        transform: translateX(0);
    }

    body.drawer-open {
        overflow: hidden;
    }

    .drawer-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 12px 16px;
        background: #003366;
        color: #fff;
        min-height: 54px;
    }

    .drawer-header-logo {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .drawer-header-logo span {
        font-size: 18px;
        font-weight: 700;
        letter-spacing: 1px;
    }

    .drawer-header-logo img {
        height: 26px;
        width: auto;
        filter: brightness(0) invert(1);
    }

    .drawer-close {
        background: none;
        border: none;
        color: #fff;
        font-size: 20px;
        cursor: pointer;
        padding: 4px;
        line-height: 1;
    }

    .drawer-user {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 12px 16px;
        border-bottom: 1px solid #eee;
        background: #f8f9fa;
    }

    .drawer-user-avatar {
        width: 36px;
        height: 36px;
        border-radius: 50%;
        background: #003366;
        color: #fff;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 14px;
        font-weight: 600;
    }

    .drawer-user-info {
        flex: 1;
        min-width: 0;
    }

    .drawer-user-name {
        font-weight: 600;
        font-size: 14px;
        color: #333;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .drawer-user-email {
        font-size: 11px;
        color: #777;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .drawer-nav {
        flex: 1;
        overflow-y: auto;
        padding: 8px 0;
    }

    .drawer-nav-section {
        padding: 8px 16px 4px;
        font-size: 10px;
        text-transform: uppercase;
        letter-spacing: 1px;
        color: #999;
        font-weight: 600;
    }

    .drawer-nav-item {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 10px 16px;
        color: #333;
        text-decoration: none;
        font-size: 14px;
        font-weight: 500;
        border-left: 3px solid transparent;
        transition: background 0.15s, border-color 0.15s;
    }

    .drawer-nav-item:hover,
    .drawer-nav-item:active {
        background: #f0f4f8;
        text-decoration: none;
        color: #333;
    }

    .drawer-nav-item.active-ruta {
        border-left-color: #003366;
        background: #f0f4f8;
    }

    .drawer-nav-item.active-preparate {
        border-left-color: #007bff;
        background: #f0f7ff;
    }

    .drawer-nav-item.active-recursos {
        border-left-color: #28a745;
        background: #f0fff4;
    }

    .drawer-nav-item.active-conocete {
        border-left-color: #ffc107;
        background: #fffdf0;
    }

    .drawer-nav-item.active-datos {
        border-left-color: #17a2b8;
        background: #f0ffff;
    }

    .drawer-nav-item.active-control {
        border-left-color: #6c757d;
        background: #f8f9fa;
    }

    .drawer-nav-icon {
        width: 24px;
        text-align: center;
        font-size: 16px;
    }

    .drawer-nav-icon.icon-ruta { color: #003366; }
    .drawer-nav-icon.icon-preparate { color: #007bff; }
    .drawer-nav-icon.icon-recursos { color: #28a745; }
    .drawer-nav-icon.icon-conocete { color: #ffc107; }
    .drawer-nav-icon.icon-datos { color: #17a2b8; }
    .drawer-nav-icon.icon-control { color: #6c757d; }

    .drawer-footer {
        border-top: 1px solid #eee;
        padding: 8px 0;
    }

    .drawer-footer-item {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 9px 16px;
        color: #555;
        text-decoration: none;
        font-size: 13px;
    }

    .drawer-footer-item:hover {
        background: #f8f9fa;
        text-decoration: none;
        color: #333;
    }

    .drawer-footer-item.logout {
        color: #dc3545;
    }

    .drawer-footer-item.logout:hover {
        background: #fff5f5;
        color: #dc3545;
    }

    .drawer-footer-icon {
        width: 24px;
        text-align: center;
        font-size: 14px;
    }

    .mobile-footer {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 30px;
        background: #fff;
        border-top: 1px solid #e0e0e0;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 10px;
        z-index: 1030;
    }

    .mobile-footer-logo {
        height: 20px;
        width: auto;
    }

    .mobile-footer-links {
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .mobile-footer-links a {
        color: #777;
        font-size: 14px;
    }

    .mobile-footer-links a:hover {
        color: #003366;
    }

    .w2p_flash {
        top: 44px !important;
    }
}
