/**
 * PinkAngel Product Filters - Compact Horizontal Design
 */

/* Main Wrapper */
.papf-filters-wrapper {
    margin-bottom: 20px;
}

/* Mobile Filter Button (FAB) */
.papf-mobile-filter-btn {
    display: none; /* Hidden on desktop */
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999;
    background: linear-gradient(135deg, #e91e63 0%, #d81b60 100%);
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 14px 24px;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 6px 24px rgba(233, 30, 99, 0.4);
    cursor: pointer;
    transition: all 0.3s;
    align-items: center;
    gap: 8px;
}

.papf-mobile-filter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(233, 30, 99, 0.5);
}

.papf-mobile-badge {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 700;
}

/* Horizontal Filter Bar */
.papf-filters-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border-radius: 12px;
    flex-wrap: wrap;
}

/* Drawer Header (hidden on desktop, shown on mobile) */
.papf-drawer-header {
    display: none;
}

/* Filter Dropdown */
.papf-filter-dropdown {
    position: relative;
}

.papf-filter-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 8px 14px;
    background: #fafafa;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.papf-trigger-end {
    display: flex;
    align-items: center;
    gap: 6px;
}

.papf-filter-trigger:hover {
    background: #f5f5f5;
    border-color: #e91e63;
}

.papf-filter-trigger i:first-child {
    color: #e91e63;
    font-size: 14px;
}

.papf-chevron {
    font-size: 10px !important;
    color: #999 !important;
    transition: transform 0.2s;
}

.papf-filter-dropdown.open .papf-chevron {
    transform: rotate(180deg);
}

.papf-filter-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: linear-gradient(135deg, #e91e63 0%, #d81b60 100%);
    color: #fff;
    border-radius: 9px;
    font-size: 10px;
    font-weight: 700;
}

/* Filter Panel (Dropdown Content) */
.papf-filter-panel {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 220px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    border: 1px solid #e8e8e8;
    padding: 12px;
    z-index: 2700;
    display: none;
    animation: slideDown 0.2s ease-out;
}

.papf-filter-dropdown.open .papf-filter-panel {
    display: block;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Price Inputs */
.papf-price-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.papf-price-input {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    width: 80px;
}

.papf-price-input:focus {
    outline: none;
    border-color: #e91e63;
    box-shadow: 0 0 0 3px rgba(233, 30, 99, 0.1);
}

.papf-price-sep {
    color: #ccc;
    font-weight: 700;
}

.papf-price-range {
    text-align: center;
    color: #999;
    font-size: 11px;
}

/* Radio Options */
.papf-radio-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 4px;
}

.papf-radio-option:last-child {
    margin-bottom: 0;
}

.papf-radio-option:hover {
    background: #f8f8f8;
}

.papf-radio-option.active {
    background: linear-gradient(135deg, #fff5f8 0%, #ffe8f0 100%);
    color: #e91e63;
    font-weight: 600;
}

.papf-radio-option input {
    display: none;
}

.papf-radio-option span {
    font-size: 13px;
}

/* Checkbox Options */
.papf-checkbox-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 4px;
}

.papf-checkbox-option:last-child {
    margin-bottom: 0;
}

.papf-checkbox-option:hover {
    background: #f8f8f8;
}

.papf-checkbox-option.active {
    background: linear-gradient(135deg, #fff5f8 0%, #ffe8f0 100%);
}

.papf-checkbox-option input {
    display: none;
}

.papf-check {
    width: 16px;
    height: 16px;
    border: 2px solid #ddd;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
}

.papf-checkbox-option:hover .papf-check {
    border-color: #e91e63;
}

.papf-checkbox-option.active .papf-check {
    background: linear-gradient(135deg, #e91e63 0%, #d81b60 100%);
    border-color: #e91e63;
}

.papf-checkbox-option.active .papf-check::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: #fff;
    font-size: 9px;
}

.papf-label {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
}

.papf-count {
    font-size: 10px;
    color: #999;
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 8px;
    font-weight: 600;
}

.papf-checkbox-option.active .papf-count {
    background: #e91e63;
    color: #fff;
}

/* Sale Toggle Wrapper */
.papf-filter-toggle-wrapper {
    display: inline-block;
}

/* Sale Toggle */
.papf-filter-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 7px 14px;
    background: #fafafa;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    line-height: 1.2;
    box-sizing: border-box;
}

.papf-filter-toggle:hover {
    background: #f5f5f5;
    border-color: #e91e63;
}

.papf-filter-toggle.active {
    background: linear-gradient(135deg, #e91e63 0%, #d81b60 100%);
    border-color: #e91e63;
    color: #fff;
}

/* Remove filters text button (hidden on desktop) */
.papf-remove-filters-text {
    display: none;
}

.papf-filter-toggle input {
    display: none;
}

.papf-filter-toggle i {
    font-size: 14px;
}

/* Action Buttons */
.papf-filter-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.papf-apply-filters {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #e91e63 0%, #d81b60 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(233, 30, 99, 0.3);
}

/* Hide invisible balancing element on desktop */
.papf-apply-filters i[style*="opacity: 0"] {
    display: none;
}

.papf-apply-filters:hover {
    background: linear-gradient(135deg, #d81b60 0%, #c2185b 100%);
    box-shadow: 0 4px 12px rgba(233, 30, 99, 0.4);
    transform: translateY(-1px);
}

.papf-clear-filters {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: #f5f5f5;
    color: #666;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.papf-clear-filters:hover {
    background: #e8e8e8;
    color: #e91e63;
}

/* Active Filter Pills */
.papf-active-pills {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
    padding: 0 4px;
}

.papf-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: linear-gradient(135deg, #fff5f8 0%, #ffe8f0 100%);
    border: 1px solid #e91e63;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: #e91e63;
    animation: pillSlideIn 0.2s ease-out;
}

@keyframes pillSlideIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.papf-pill i {
    font-size: 11px;
}

.papf-pill-remove {
    background: none;
    border: none;
    color: #e91e63;
    cursor: pointer;
    padding: 0;
    margin-left: 2px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
}

.papf-pill-remove:hover {
    background: rgba(233, 30, 99, 0.2);
}

.papf-pill-remove i {
    font-size: 10px;
}

.papf-clear-all-pills {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #f5f5f5;
    border: 1px solid #e8e8e8;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
}

.papf-clear-all-pills:hover {
    background: #e8e8e8;
    color: #333;
}

/* Loading State */
.papf-filters-wrapper.loading {
    position: relative;
}

.papf-filters-wrapper.loading .papf-filters-bar {
    pointer-events: none;
    opacity: 0.6;
}

.papf-filters-wrapper.loading::after {
    content: '';
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border: 4px solid #f0f0f0;
    border-top-color: #e91e63;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .papf-mobile-filter-btn {
        display: flex;
    }

    .papf-filters-bar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 85%;
        max-width: 320px;
        height: 100vh;
        flex-direction: column;
        align-items: stretch;
        padding: 0;
        border-radius: 0;
        box-shadow: 4px 0 24px rgba(0,0,0,0.2);
        z-index: 5500;
        transition: left 0.3s;
        overflow-y: auto;
        overflow-x: hidden;
        display: flex;
    }

    .papf-filters-bar.open {
        left: 0;
    }

    /* Drawer Header */
    .papf-drawer-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 16px 20px;
        background: linear-gradient(135deg, #e91e63 0%, #d81b60 100%);
        color: #fff;
        position: sticky;
        top: 0;
        z-index: 10;
        border-bottom: 1px solid rgba(255,255,255,0.2);
    }

    .papf-drawer-header h3 {
        margin: 0;
        font-size: 18px;
        font-weight: 600;
        color: #fff;
    }

    .papf-drawer-close {
        background: transparent;
        border: none;
        color: #fff;
        font-size: 24px;
        cursor: pointer;
        padding: 0;
        width: 32px;
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        transition: background 0.2s;
    }

    .papf-drawer-close:hover {
        background: rgba(255,255,255,0.2);
    }

    /* Filter Container Padding */
    .papf-filters-bar > *:not(.papf-drawer-header) {
        padding: 0 20px;
    }

    .papf-filter-dropdown,
    .papf-filter-toggle-wrapper,
    .papf-filter-actions {
        width: 100%;
        box-sizing: border-box;
    }

    .papf-filter-trigger {
        width: 100%;
        justify-content: space-between;
        height: 40px;
        padding: 6px 14px;
        box-sizing: border-box;
    }

    .papf-filter-toggle {
        width: 100%;
        height: 40px;
        padding: 6px 14px;
        box-sizing: border-box;
    }

    .papf-filter-panel {
        position: static;
        box-shadow: none;
        border: none;
        padding: 12px 0;
        margin-top: 8px;
        max-height: 300px;
        overflow-y: auto;
        overflow-x: hidden;
    }

    .papf-filter-actions {
        margin-left: 0;
        margin-top: auto;
        padding: 16px 20px !important;
        border-top: 1px solid #f0f0f0;
        background: #fff;
        position: sticky;
        bottom: 0;
        z-index: 10;
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .papf-remove-filters-text {
        display: block;
        background: none;
        border: none;
        color: #666;
        font-size: 13px;
        font-weight: 500;
        text-align: center;
        cursor: pointer;
        padding: 0;
        text-decoration: underline;
        transition: color 0.2s;
    }

    .papf-remove-filters-text:hover {
        color: #e91e63;
    }

    .papf-apply-filters {
        flex: 1;
        height: 40px;
        border-radius: 50px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        padding: 15px 60px;
    }

    /* Show invisible balancing element on mobile */
    .papf-apply-filters i[style*="opacity: 0"] {
        display: inline-block;
    }

    .papf-active-pills {
        padding: 12px 16px;
    }

    .papf-count {
        min-width: 25px;
        text-align: center;
        padding: 0px 2px;
    }
}

/* Backdrop for mobile */
.papf-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 5450;
}

.papf-backdrop.show {
    display: block;
}

