/* Mobile sidebar menu — only active at <=768px. Does not alter desktop menu styles. */

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    z-index: 60;
}

.mobile-menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: #1f2937;
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.mobile-menu-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.mobile-menu-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.mobile-sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    z-index: 70;
}

.mobile-sidebar-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

.mobile-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 280px;
    max-width: 80%;
    background: #ffffff;
    box-shadow: 2px 0 16px rgba(0, 0, 0, 0.15);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 80;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

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

.mobile-sidebar__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.mobile-sidebar__brand {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    min-width: 0;
}

.mobile-sidebar__brand-logo {
    display: block;
    height: 32px;
    width: auto;
    max-width: 120px;
    object-fit: contain;
}

.mobile-sidebar__brand-name {
    color: #0d9488;
    font-weight: 700;
    font-size: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-sidebar__close {
    border: none;
    background: transparent;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    color: #4b5563;
    padding: 4px 10px;
}

.mobile-sidebar__close:hover,
.mobile-sidebar__close:focus {
    color: #0d9488;
}

.mobile-sidebar__nav {
    display: flex;
    flex-direction: column;
    padding: 8px 0;
}

.mobile-sidebar__nav a {
    padding: 14px 20px;
    color: #374151;
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    border-bottom: 1px solid #f3f4f6;
}

.mobile-sidebar__nav a:hover,
.mobile-sidebar__nav a:focus {
    background: #f0fdfa;
    color: #0d9488;
}

body.mobile-sidebar-open {
    overflow: hidden;
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: inline-flex;
    }

    /* Hides the existing desktop nav only within the mobile breakpoint.
       Its own class/markup in the layout file is left untouched. */
    header nav.hidden.sm\:flex {
        display: none !important;
    }
}

@media (min-width: 769px) {
    /* Extra safety net: sidebar/overlay can never appear on desktop widths. */
    .mobile-sidebar,
    .mobile-sidebar-overlay {
        display: none !important;
    }
}
