/**
 * Catalog & WooFilters Styles
 */

/* Main wrapper - flex layout for filters on one line */
.wpfMainWrapper {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
}

/* Search filter - takes 80% of space */
.wpfFilterWrapper[data-filter-type="wpfSearchText"] {
    flex: 0 0 80%;
    min-width: 0;
}

/* Category filter - takes 15% of space when clear button visible, 20% otherwise */
.wpfFilterWrapper[data-filter-type="wpfCategory"] {
    flex: 0 0 20%;
    min-width: 0;
    transition: flex-basis 0.2s ease;
}

.wpfFilterWrapper[data-filter-type="wpfCategory"].has-selection {
    flex: 0 0 15%;
}

/* Clear button container - takes 5% when visible */
.wpf-clear-container {
    flex: 0 0 5%;
    min-width: 0;
    display: none;
    align-items: center;
    justify-content: center;
    height: 24px;
    padding-top: 2px;
}

.wpf-clear-container.visible {
    display: flex;
}

/* Hide filter titles */
.wpfFilterWrapper .wpfFilterTitle {
    display: none !important;
}

/* ========================================
   SEARCH INPUT - Match global.css styles
   ======================================== */

.wpfSingleInputSearch {
    position: relative;
    width: 100%;
}

.wpfSingleInputSearch input[type="text"] {
    /* Base styles from global.css */
    background: #111420;
    border: 1px solid #232838 !important;
    border-radius: 6px !important;
    padding: 16px 20px 16px 56px !important; /* Left padding 56px для иконки (20px отступ + 20px иконка + 16px зазор) */
    font-family: var(--font-primary);
    font-weight: 400;
    font-size: 16px;
    line-height: 20px;
    color: #E6EAF2;
    transition: all 0.3s ease;
    width: 100%;
    box-sizing: border-box;
}

.wpfSingleInputSearch input[type="text"]::placeholder {
    color: #6C738A;
}

.wpfSingleInputSearch input[type="text"]:focus {
    border-color: var(--color-accent-primary) !important;
    outline: none;
}

.wpfSingleInputSearch input[type="text"]:not(:placeholder-shown) {
    color: var(--color-text-secondary);
}

/* Search icon before input */
.wpfSingleInputSearch::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M9 17A8 8 0 1 0 9 1a8 8 0 0 0 0 16zM18 18l-4.35-4.35' stroke='%236C738A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    pointer-events: none;
    z-index: 2;
}

/* Hide default search button */
.wpfSingleInputSearch .js-wpfFilterButtonSearch {
    display: none !important;
}

/* ========================================
   CATEGORY DROPDOWN - Match currency switcher
   ======================================== */

/* Category filter wrapper */
.wpfFilterWrapper[data-filter-type="wpfCategory"] {
    position: relative;
    height: 24px;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.wpfFilterWrapper[data-filter-type="wpfCategory"] * {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.wpfFilterWrapper[data-filter-type="wpfCategory"] .wpfFilterContent {
    position: relative;
    height: 24px;
}

/* Main trigger container */
.wpfFilterWrapper[data-filter-type="wpfCategory"] .wpfCheckboxHier {
    position: relative;
    height: 24px;
    display: flex;
    align-items: center;
    cursor: pointer;
    width: 100%;
}

/* Trigger text "Categories" or selected category - using ::before */
.wpfFilterWrapper[data-filter-type="wpfCategory"] .wpfCheckboxHier::before {
    content: attr(data-display-text);
    flex: 1;
    color: #E6EAF2;
    font-size: 18px;
    font-weight: 400;
    font-family: 'Inter', sans-serif;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 24px;
    padding-right: 28px;
    min-width: 0;
}

/* Arrow icon - using ::after, always visible at far right */
.wpfFilterWrapper[data-filter-type="wpfCategory"] .wpfCheckboxHier::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 12px;
    background-image: url("data:image/svg+xml,%3Csvg width='16' height='12' viewBox='0 0 16 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2 2L8 8L14 2' stroke='%23E6EAF2' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-size: 16px 12px;
    background-repeat: no-repeat;
    background-position: center;
    transition: transform 0.2s ease;
    pointer-events: none;
    flex-shrink: 0;
}

.wpfFilterWrapper[data-filter-type="wpfCategory"].wpf-dropdown-open .wpfCheckboxHier::after {
    transform: translateY(-50%) rotate(180deg);
}

/* Clear button - in separate container */
.wpf-clear-btn {
    width: 14px;
    height: 14px;
    background-image: url("data:image/svg+xml,%3Csvg width='14' height='14' viewBox='0 0 14 14' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L13 13M13 1L1 13' stroke='%23E6EAF2' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-size: 14px 14px;
    background-repeat: no-repeat;
    background-position: center;
    cursor: pointer;
    transition: opacity 0.2s ease;
    flex-shrink: 0;
}

.wpf-clear-btn:hover {
    opacity: 0.7;
}

/* Dropdown list */
.wpfFilterWrapper[data-filter-type="wpfCategory"] .wpfTextFilter {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 200px;
    background: transparent;
    border: none;
    max-height: 200px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Show dropdown when active */
.wpfFilterWrapper[data-filter-type="wpfCategory"].wpf-dropdown-open .wpfTextFilter {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Category list items */
.wpfFilterWrapper[data-filter-type="wpfCategory"] .wpfTextFilter li {
    padding: 8px 0;
    cursor: pointer;
    color: #E6EAF2;
    font-size: 18px;
    font-weight: 400;
    font-family: 'Inter', sans-serif;
    transition: opacity 0.15s ease;
    margin: 0;
}

.wpfFilterWrapper[data-filter-type="wpfCategory"] .wpfTextFilter li:hover {
    opacity: 0.7;
}

/* Hide checkboxes */
.wpfFilterWrapper[data-filter-type="wpfCategory"] .wpfCheckbox {
    display: none !important;
}

/* Style the label */
.wpfFilterWrapper[data-filter-type="wpfCategory"] .wpfLiLabel {
    display: block;
    cursor: pointer;
    margin: 0;
}

/* Selected item styling - keep font-weight 400 */
.wpfFilterWrapper[data-filter-type="wpfCategory"] .wpfTermChecked {
    font-weight: 400;
}

/* Scrollbar styling */
.wpfFilterWrapper[data-filter-type="wpfCategory"] .wpfTextFilter::-webkit-scrollbar {
    width: 4px;
}

.wpfFilterWrapper[data-filter-type="wpfCategory"] .wpfTextFilter::-webkit-scrollbar-track {
    background: transparent;
}

.wpfFilterWrapper[data-filter-type="wpfCategory"] .wpfTextFilter::-webkit-scrollbar-thumb {
    background: rgba(230, 234, 242, 0.3);
    border-radius: 2px;
}

.wpfFilterWrapper[data-filter-type="wpfCategory"] .wpfTextFilter::-webkit-scrollbar-thumb:hover {
    background: rgba(230, 234, 242, 0.5);
}

/* Hide loader */
.wpfLoaderLayout {
    display: none !important;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .wpfMainWrapper {
        flex-direction: column;
        gap: 12px;
    }
    
    .wpfFilterWrapper[data-filter-type="wpfSearchText"],
    .wpfFilterWrapper[data-filter-type="wpfCategory"] {
        flex: 0 0 100%;
        width: 100%;
    }
}
