/* ==========================================================================
   Off-Canvas Panel Widget
   ========================================================================== */

.epp-off-canvas-wrapper {
    position: relative;
    display: inline-block;
}

/* ── Trigger Button ────────────────────────────────────────────────────── */

.epp-off-canvas-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--epp-primary, #7c3aed);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 15px;
    font-weight: 600;
}

.epp-off-canvas-trigger:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.epp-off-canvas-trigger--icon-only {
    padding: 12px;
    width: 48px;
    height: 48px;
    justify-content: center;
}

.epp-off-canvas-trigger i,
.epp-off-canvas-trigger svg {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* ── Overlay ───────────────────────────────────────────────────────────── */

.epp-off-canvas-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(2px);
}

.epp-off-canvas-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ── Panel Base ────────────────────────────────────────────────────────── */

.epp-off-canvas-panel {
    position: fixed;
    z-index: 9999;
    background: #fff;
    overflow-y: auto;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
                0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.epp-off-canvas-panel::-webkit-scrollbar {
    width: 8px;
}

.epp-off-canvas-panel::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.epp-off-canvas-panel::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.epp-off-canvas-panel::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* ── Panel Positions ───────────────────────────────────────────────────── */

.epp-off-canvas-panel--left {
    left: 0;
    top: 0;
    bottom: 0;
    height: 100vh;
    transform: translateX(-100%);
}

.epp-off-canvas-panel--left.active {
    transform: translateX(0);
}

.epp-off-canvas-panel--right {
    right: 0;
    top: 0;
    bottom: 0;
    height: 100vh;
    transform: translateX(100%);
}

.epp-off-canvas-panel--right.active {
    transform: translateX(0);
}

.epp-off-canvas-panel--top {
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    transform: translateY(-100%);
}

.epp-off-canvas-panel--top.active {
    transform: translateY(0);
}

.epp-off-canvas-panel--bottom {
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    transform: translateY(100%);
}

.epp-off-canvas-panel--bottom.active {
    transform: translateY(0);
}

/* ── Close Button ──────────────────────────────────────────────────────── */

.epp-off-canvas-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: #374151;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 6px;
    z-index: 10;
}

.epp-off-canvas-close:hover {
    background: #f3f4f6;
    color: #111827;
    transform: rotate(90deg);
}

.epp-off-canvas-close i,
.epp-off-canvas-close svg {
    width: 20px;
    height: 20px;
}

/* ── Content Area ──────────────────────────────────────────────────────── */

.epp-off-canvas-content {
    padding: 24px;
    min-height: 100%;
}

/* ── Body Scroll Lock ──────────────────────────────────────────────────── */

body.epp-off-canvas-lock {
    overflow: hidden;
}

/* ── Responsive ────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
    .epp-off-canvas-panel--left,
    .epp-off-canvas-panel--right {
        width: 90% !important;
        max-width: 400px;
    }
    
    .epp-off-canvas-panel--top,
    .epp-off-canvas-panel--bottom {
        height: 80% !important;
        max-height: 600px;
    }
    
    .epp-off-canvas-content {
        padding: 20px 16px;
    }
}

/* ── Animation Variants ────────────────────────────────────────────────── */

.epp-off-canvas-panel[data-animation="fade"] {
    opacity: 0;
    transform: none !important;
}

.epp-off-canvas-panel[data-animation="fade"].active {
    opacity: 1;
}

.epp-off-canvas-panel[data-animation="zoom"] {
    transform: scale(0.8);
}

.epp-off-canvas-panel[data-animation="zoom"].active {
    transform: scale(1);
}

/* ── Accessibility ─────────────────────────────────────────────────────── */

.epp-off-canvas-trigger:focus-visible,
.epp-off-canvas-close:focus-visible {
    outline: 2px solid var(--epp-primary, #7c3aed);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .epp-off-canvas-panel,
    .epp-off-canvas-overlay,
    .epp-off-canvas-trigger,
    .epp-off-canvas-close {
        transition: none !important;
    }
}
