/**
 * HDM Premium Filters v2.1
 * 
 * Upload to: /wp-content/themes/flatsome-child/assets/css/hdm-premium-filters.css
 */

/* ============================================
   MOBILE FILTER BAR - TOP BUTTONS
   ============================================ */

.hdm-mobile-bar {
    display: none;
    gap: 10px;
    margin-bottom: 10px;
}

.hdm-bar-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s;
}

.hdm-bar-btn:active {
    background: #f9fafb;
}

.hdm-arrow {
    font-size: 10px;
    color: #9ca3af;
}

.hdm-badge {
    background: #6A4532;
    color: #fff;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 4px;
}

.hdm-count {
    display: none;
    text-align: center;
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 15px;
}

/* ============================================
   SLIDE-UP PANELS
   ============================================ */

.hdm-panel {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
    max-height: 75vh;
    z-index: 9999;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.hdm-panel.open {
    display: flex;
    transform: translateY(0);
}

.hdm-panel-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
}

.hdm-close {
    width: 32px;
    height: 32px;
    background: #f3f4f6;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    color: #6b7280;
    cursor: pointer;
}

.hdm-panel-list {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    -webkit-overflow-scrolling: touch;
}

/* Sort Options */
.hdm-panel-list > a {
    display: flex;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid #f3f4f6;
    text-decoration: none;
    color: #374151;
    font-size: 15px;
}

.hdm-panel-list > a:hover {
    background: #f9fafb;
}

.hdm-panel-list > a.active {
    color: #6A4532;
    font-weight: 600;
    background: #FDF9F6;
}

/* Panel Footer */
.hdm-panel-bottom {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid #e5e7eb;
}

.hdm-clear {
    flex: 1;
    padding: 12px;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    text-align: center;
    text-decoration: none;
    color: #6b7280;
    font-size: 14px;
    font-weight: 500;
}

.hdm-apply {
    flex: 2;
    padding: 12px;
    background: #6A4532;
    border: none;
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

/* Overlay */
.hdm-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9998;
}

.hdm-overlay.open {
    display: block;
}

/* ============================================
   ACCORDION SECTIONS
   ============================================ */

.hdm-section {
    border-bottom: 1px solid #e5e7eb;
}

.hdm-acc-btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 14px 20px;
    background: none;
    border: none;
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
    cursor: pointer;
    text-align: left;
}

.hdm-acc-btn span {
    font-size: 10px;
    color: #9ca3af;
    transition: transform 0.2s;
}

.hdm-acc-content {
    display: none;
    padding: 0 20px 16px;
}

.hdm-acc-content.open {
    display: block;
}

/* Filter Items */
.hdm-acc-content > a {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f3f4f6;
    text-decoration: none;
    color: #374151;
    font-size: 14px;
}

.hdm-acc-content > a:last-child {
    border-bottom: none;
}

.hdm-acc-content > a.active {
    color: #6A4532;
    font-weight: 600;
}

.hdm-acc-content > a span {
    margin-left: auto;
    color: #9ca3af;
    font-size: 13px;
}

/* Checkbox Style */
.hdm-check-item {
    gap: 10px;
}

.hdm-check {
    width: 18px;
    height: 18px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    flex-shrink: 0;
    position: relative;
    margin-right: 10px;
}

.hdm-check-item.checked .hdm-check {
    background: #6A4532;
    border-color: #6A4532;
}

.hdm-check-item.checked .hdm-check::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 1px;
    width: 4px;
    height: 8px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.hdm-term-count {
    margin-left: auto !important;
}

/* ============================================
   PRICE FILTER
   ============================================ */

.hdm-price-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.hdm-price-input {
    flex: 1;
    display: flex;
    align-items: center;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    overflow: hidden;
}

.hdm-price-input span {
    padding: 10px 12px;
    background: #f9fafb;
    color: #6b7280;
    font-weight: 500;
}

.hdm-price-input input {
    flex: 1;
    padding: 10px;
    border: none;
    font-size: 14px;
    width: 100%;
    -moz-appearance: textfield;
}

.hdm-price-input input::-webkit-outer-spin-button,
.hdm-price-input input::-webkit-inner-spin-button {
    -webkit-appearance: none;
}

.hdm-price-btn {
    width: 100%;
    padding: 12px;
    background: #C89737;
    border: none;
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

/* ============================================
   DESKTOP SIDEBAR
   ============================================ */

#hdm-shop-sidebar .hdm-sidebar-widget,
#hdm-shop-sidebar .hdm-widget {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 16px;
    overflow: hidden;
}

#hdm-shop-sidebar .hdm-widget-title,
#hdm-shop-sidebar .widget-title {
    padding: 14px 16px;
    margin: 0;
    background: #6A4532;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#hdm-shop-sidebar .hdm-widget-content,
#hdm-shop-sidebar > .hdm-sidebar-widget > ul,
#hdm-shop-sidebar .widget > ul {
    padding: 12px 16px;
    background: #FDF9F6;
}

#hdm-shop-sidebar ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

#hdm-shop-sidebar ul li a {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    margin-bottom: 4px;
    background: #fff;
    border: 1px solid transparent;
    border-radius: 6px;
    text-decoration: none;
    color: #374151;
    font-size: 13px;
    transition: all 0.2s;
}

#hdm-shop-sidebar ul li a:hover {
    border-color: #C89737;
    color: #6A4532;
}

#hdm-shop-sidebar ul li.current-cat > a,
#hdm-shop-sidebar ul li.chosen a {
    background: #6A4532;
    color: #fff;
    border-color: #6A4532;
}

/* Price Slider Desktop */
#hdm-shop-sidebar .hdm-widget-price .price_slider_wrapper {
    padding: 12px 16px;
    background: #FDF9F6;
}

#hdm-shop-sidebar .ui-slider {
    background: #e5e7eb;
    border: none;
    border-radius: 3px;
    height: 6px;
    margin: 16px 0;
}

#hdm-shop-sidebar .ui-slider .ui-slider-range {
    background: #C89737;
}

#hdm-shop-sidebar .ui-slider .ui-slider-handle {
    width: 18px;
    height: 18px;
    background: #fff;
    border: 3px solid #C89737;
    border-radius: 50%;
    top: -6px;
    cursor: grab;
}

#hdm-shop-sidebar .price_slider_amount .button {
    width: 100%;
    padding: 10px;
    background: #C89737;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 12px;
}

/* ============================================
   RESPONSIVE
   ============================================ */

/* Mobile: Show bar, hide sidebar */
@media (max-width: 991px) {
    .hdm-mobile-bar {
        display: flex;
    }
    
    .hdm-count {
        display: block;
    }
    
    #hdm-shop-sidebar,
    .hdm-shop-sidebar,
    .shop-sidebar {
        display: none !important;
    }
}

/* Desktop: Hide bar, show sidebar */
@media (min-width: 992px) {
    .hdm-mobile-bar,
    .hdm-count,
    .hdm-panel,
    .hdm-overlay {
        display: none !important;
    }
}
