/* Wrapper */
.off-canvas-wrapper {
    position: relative; /* Ensure it's in the flow */
    z-index: 10000;
}

.off-canvas-toggle {
    position: fixed; /* Must be fixed or absolute to respect z-index */
    z-index: 11000;  /* Higher than wrapper AND theme elements */
}

/* Toggle button (hamburger) */
.off-canvas-toggle button {
    background: #444;
    color: white;
    padding: 10px 15px 15px 15px;
    font-size: 24px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    z-index: 11000;
}

/* Off-canvas menu base styles */
.off-canvas-menu {
    position: fixed;
    z-index: 12000;
    width: 300px;
    height: 100%;
    background-color: #fff;
    box-shadow: 2px 0 5px rgba(0,0,0,0.2);
    overflow-y: auto;
    transition: transform 0.3s ease; /* This is the fallback for the transition */
}

/* Close button inside the menu */
#off-canvas-close-btn {
    background: transparent;
    border: none;
    font-size: 2rem;
    float: right;
    margin: 10px;
    cursor: pointer;
}

/* Positioning anchors */
.off-canvas-wrapper.left .off-canvas-menu {
    top: 0;
    left: 0;
    height: 100%;
}
.off-canvas-wrapper.right .off-canvas-menu {
    top: 0;
    right: 0;
    height: 100%;
}
.off-canvas-wrapper.top .off-canvas-menu {
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
}
.off-canvas-wrapper.bottom .off-canvas-menu {
    bottom: 0;
    left: 0;
    width: 100%;
    height: auto;
}

/* For right-to-left slide-in */
.off-canvas-menu.slide-from-right {
    transform: translateX(calc(100vw + 100%));
}

/* For left-to-right slide-in */
.off-canvas-menu.slide-from-left {
    transform: translateX(calc(-100vw - 100%));
}

/* For bottom-to-top slide-in */
.off-canvas-menu.slide-from-top {
    transform: translateY(calc(-100vh - 100%));
}

/* For top-to-bottom slide-in */
.off-canvas-menu.slide-from-bottom {
    transform: translateY(calc(100vh + 100%));
}

/* When menu is open: reset to visible */
.off-canvas-menu.open {
    transform: translate(0, 0);
}


/* Optional: style menu items */
.off-canvas-menu ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}
.off-canvas-menu li {
    padding: 15px;
    border-bottom: 1px solid #ddd;
}
/* Remove ::marker pseudo-elements added by themes like Olivero */
.off-canvas-menu ul.menu li::marker {
    content: none;
    display: none;
}
.off-canvas-menu a {
    text-decoration: none;
    color: #333;
    font-weight: bold;
}
