/* Menu toggle button, in the spot the account-menu button used to occupy */
#side-nav-toggle {
    position: absolute;
    left: 0.75rem;
    top: 0.75rem;
    height: 2.5rem;
    width: 2.5rem;
    padding: 0.65rem 0.6rem;
    border: none;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.15);
    cursor: pointer;
    z-index: 20;

    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
#side-nav-toggle:hover {
    background-color: rgba(255, 255, 255, 0.3);
}
.side-nav-toggle-bar {
    display: block;
    width: 100%;
    height: 0.15rem;
    background-color: white;
    border-radius: 1px;
}

/* Account menu moves to the right side of the header, just left of the
   cart button on pages that have one */
#header-content #account-menu {
    left: auto;
    right: 0.75rem;
}
#header-content:has(#cart-button) #account-menu {
    right: 3.75rem;
}
#header-content #account-menu-panel {
    left: auto;
    right: 0;
}

/* Off-canvas side nav */
#side-nav {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 16rem;
    max-width: 80vw;
    box-sizing: border-box;
    padding: 1rem;
    z-index: 102;

    display: flex;
    flex-direction: column;
    gap: 0.25rem;

    background: white;
    color: black;
    box-shadow: 4px 0 10px rgba(0, 0, 0, 0.2);

    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
}
#side-nav.side-nav-open {
    transform: translateX(0);
}

#side-nav-close {
    align-self: flex-end;
    height: 1.75rem;
    width: 1.75rem;
    margin-block-end: 0.5rem;
    border: none;
    border-radius: 50%;
    background: none;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
}
#side-nav-close:hover {
    background-color: lightgrey;
}

.side-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.5rem;
    border-bottom: 1px solid lightgrey;
    color: black;
    text-decoration: none;
    font-size: 1.1rem;
}
.side-nav-link:hover {
    background-color: var(--secondary-color-light);
}
.side-nav-link img {
    height: 1.25rem;
    width: 1.25rem;
    flex-shrink: 0;
}

#side-nav-overlay {
    position: fixed;
    inset: 0;
    z-index: 101;
    background-color: rgba(0, 0, 0, 0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease-in-out;
}
#side-nav-overlay.side-nav-overlay-visible {
    opacity: 1;
    pointer-events: auto;
}
