/**
 * Voltride Off-Canvas Filters
 * Sidebar and overlay styles for custom filter sidebar
 * 
 * @package VoltRide Off-Canvas Filters
 * @since 1.0.0
 */

/* ==========================================================================
   Overlay (Dark Backdrop)
   ========================================================================== */

.voltride-offcanvas-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.7);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    z-index: 400;
}

.voltride-offcanvas-overlay.voltride-overlay-opened {
    opacity: 1;
    pointer-events: auto;
}

/* ==========================================================================
   Off-Canvas Sidebar
   ========================================================================== */

.voltride-offcanvas-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 360px;
    max-width: 100vw;
    /* Height with fallback for older browsers */
    height: 100vh; /* Fallback for browsers without svh support */
    height: 100svh; /* Small viewport height - accounts for mobile browser UI */
    background: linear-gradient(180deg, #D8FFB4 0%, #ffffff 100%);
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
    z-index: 500;
    overflow: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    transform: translate3d(100%, 0, 0);
    transition: transform 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

.voltride-offcanvas-sidebar.voltride-opened {
    transform: none;
}

/* ==========================================================================
   Sidebar Header
   ========================================================================== */

.voltride-offcanvas-header {
    padding: 20px 24px;
    border-bottom: none;
    background: transparent;
    flex-shrink: 0;
}

/* Desktop only - extra top padding */
@media (min-width: 1025px) {
    .voltride-offcanvas-header {
        padding-top: 60px;
    }
}

/* Inner wrapper for perfect centering */
.voltride-offcanvas-header-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    min-height: 36px;
}

.voltride-offcanvas-title {
    margin: 0;
    padding: 0;
    font-size: 14px;
    font-weight: 700;
    font-style: normal;
    line-height: 120%;
    letter-spacing: 0;
    color: var(--new-green);
    text-align: center;
}

.voltride-offcanvas-sidebar .voltride-offcanvas-header .voltride-offcanvas-close {
    position: absolute !important;
    left: 0 !important;
    top: 50% !important;
    right: auto !important;
    bottom: auto !important;
    transform: translateY(-50%) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    width: 36px !important;
    height: 36px !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    border: none !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    color: #FF6082 !important;
    transition: all 0.2s ease !important;
}

.voltride-offcanvas-sidebar .voltride-offcanvas-header .voltride-offcanvas-close:hover {
    background-color: rgba(255, 96, 130, 0.1) !important;
    color: #FF6082 !important;
}

.voltride-offcanvas-sidebar .voltride-offcanvas-header .voltride-offcanvas-close:active {
    transform: translateY(-50%) scale(0.95) !important;
}

.voltride-offcanvas-sidebar .voltride-offcanvas-header .voltride-offcanvas-close svg {
    width: 24px !important;
    height: 24px !important;
    display: block !important;
}

/* ==========================================================================
   Sidebar Content
   ========================================================================== */

.voltride-offcanvas-content {
    flex: 1 1 auto;
    padding: 24px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Woodmart filter styles integration */
.voltride-offcanvas-content .wd-pf-checkboxes {
    margin-bottom: 24px;
}

.voltride-offcanvas-content .wd-pf-title {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 12px;
}

/* Voltride filter sliders */
.voltride-offcanvas-content .voltride-filter-container {
    margin-bottom: 24px;
}

/* Price slider */
.voltride-offcanvas-content .widget_price_filter {
    margin-bottom: 24px;
}

/* ==========================================================================
   Body Scroll Lock
   ========================================================================== */

body.voltride-offcanvas-open {
    overflow: hidden;
}

/* ==========================================================================
   Responsive Styles
   ========================================================================== */

/* Tablet (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    .voltride-offcanvas-sidebar {
        width: min(80vw, 360px);
    }
}

/* Mobile (<768px) */
@media (max-width: 767.98px) {
    .voltride-offcanvas-sidebar {
        width: 90vw;
    }
    
    .voltride-offcanvas-header {
        padding: 16px 20px;
    }
    
    .voltride-offcanvas-title {
        font-size: 14px;
    }
    
    
    .voltride-offcanvas-content {
        padding: 20px;
    }
}

/* Very small mobile (<480px) */
@media (max-width: 479.98px) {
    .voltride-offcanvas-sidebar {
        width: 95vw;
    }
    
    .voltride-offcanvas-content {
        padding: 16px;
    }
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

.voltride-offcanvas-close:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Prevent flash of unstyled content */
.voltride-offcanvas-sidebar,
.voltride-offcanvas-overlay {
    visibility: visible;
}
