/* Offcanvas */
.offcanvas-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 10000;
    animation: offcanvas-fade-in 0.2s ease;
}

@keyframes offcanvas-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.offcanvas {
    position: fixed;
    background: #fff;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation-duration: 0.25s;
    animation-fill-mode: both;
    animation-timing-function: ease;
}

/* Posiciones */
.offcanvas--derecha {
    top: 0;
    right: 0;
    bottom: 0;
    width: 420px;
    max-width: 90vw;
    animation-name: offcanvas-slide-right;
}

.offcanvas--izquierda {
    top: 0;
    left: 0;
    bottom: 0;
    width: 420px;
    max-width: 90vw;
    animation-name: offcanvas-slide-left;
}

.offcanvas--arriba {
    top: 0;
    left: 0;
    right: 0;
    height: 50vh;
    max-height: 80vh;
    animation-name: offcanvas-slide-top;
}

.offcanvas--abajo {
    bottom: 0;
    left: 0;
    right: 0;
    height: 50vh;
    max-height: 80vh;
    animation-name: offcanvas-slide-bottom;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.2);
}

@keyframes offcanvas-slide-right {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

@keyframes offcanvas-slide-left {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

@keyframes offcanvas-slide-top {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

@keyframes offcanvas-slide-bottom {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

/* Header */
.offcanvas__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e0e0e0;
    flex-shrink: 0;
}

.offcanvas__header h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

/* Body */
.offcanvas__body {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
}

/* Footer */
.offcanvas__footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-top: 1px solid #e0e0e0;
    flex-shrink: 0;
}

/* Dark mode */
.layout--oscuro .offcanvas {
    background: #2a2a4a;
    color: #e0e0e0;
}

.layout--oscuro .offcanvas__header {
    border-color: #3a3a5a;
}

.layout--oscuro .offcanvas__footer {
    border-color: #3a3a5a;
}
