/* Offcanvas Trigger (Hamburger Button) */
.offcanvas-trigger-wrapper {
    display: inline-block;
}

.offcanvas-trigger {
    background: transparent;
    border: 2px solid #333;
    border-radius: 4px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.offcanvas-trigger:hover,
.offcanvas-trigger:focus {
    background-color: rgba(0, 0, 0, 0.05);
    outline: 2px solid #0066cc;
    outline-offset: 2px;
}

.hamburger {
    width: 24px;
    height: 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
}

.hamburger-line {
    width: 100%;
    height: 2px;
    background-color: #333;
    transition: all 0.3s ease;
    display: block;
}

/* Hamburger Animation wenn aktiv */
.offcanvas-trigger.active .hamburger-line:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.offcanvas-trigger.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.offcanvas-trigger.active .hamburger-line:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* Overlay */
.offcanvas-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    z-index: 999;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.offcanvas-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Offcanvas Panel */
.offcanvas-panel {
    position: fixed;
    top: 0;
    height: 100%;
    z-index: 1000;
    overflow-y: auto;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}

/* Offcanvas Header */
.offcanvas-header {
    padding: 15px 20px;
    display: flex;
    justify-content: flex-end;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.offcanvas-close {
    background: transparent;
    border: none;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    padding: 5px 10px;
    color: #333;
    transition: all 0.2s ease;
    border-radius: 4px;
}

.offcanvas-close:hover,
.offcanvas-close:focus {
    background-color: rgba(0, 0, 0, 0.1);
    outline: 2px solid #0066cc;
    outline-offset: 2px;
}

.close-icon {
    display: block;
}

/* Offcanvas Content */
.offcanvas-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

/* Body Lock wenn Offcanvas offen */
body.offcanvas-open {
    overflow: hidden;
}

/* Barrierefreiheit: Focus Styles */
.offcanvas-trigger:focus-visible,
.offcanvas-close:focus-visible {
    outline: 3px solid #0066cc;
    outline-offset: 2px;
}

/* Skip Links für Screen Reader */
.offcanvas-panel:focus {
    outline: none;
}

/* Responsive Anpassungen */
@media (max-width: 767px) {
    .offcanvas-panel {
        max-width: 85%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .offcanvas-panel,
    .offcanvas-overlay,
    .hamburger-line,
    .offcanvas-trigger {
        transition: none;
    }
}