/* Filter dropdown menus (Category, Dietary) */
.filter-menu {
    position: relative;
}
.filter-menu-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    color: #374151;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color 0.15s, background-color 0.15s;
}
.filter-menu-btn:hover {
    border-color: #fdba74;
    background: #fff7ed;
}
.filter-menu.open .filter-menu-btn {
    border-color: #f97316;
    box-shadow: 0 0 0 1px #f97316;
}
.filter-menu-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 200px;
    max-height: 320px;
    overflow-y: auto;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    z-index: 50;
}
.filter-menu.open .filter-menu-dropdown {
    display: block;
}
.filter-menu-item {
    display: flex;
    align-items: center;
    padding: 8px 14px;
    font-size: 0.8125rem;
    color: #374151;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.1s;
}
.filter-menu-item:hover {
    background: #fff7ed;
}
.filter-menu-item.active {
    background: #fff7ed;
    color: #ea580c;
    font-weight: 600;
}
.filter-menu-item:first-child {
    border-radius: 8px 8px 0 0;
}
.filter-menu-item:last-child {
    border-radius: 0 0 8px 8px;
}

/* Mobile option list (for Category/Dietary in drawer) */
.mobile-option-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.mobile-option {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.8125rem;
    color: #374151;
    cursor: pointer;
    transition: background-color 0.1s;
}
.mobile-option:hover {
    background: #f3f4f6;
}
.mobile-option.active {
    background: #fff7ed;
    color: #ea580c;
    font-weight: 600;
}

/* Servings button group */
.servings-btn-group {
    display: flex;
    gap: 8px;
}
.servings-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex: 1;
    padding: 10px 8px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: white;
    color: #6b7280;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
.servings-btn:hover {
    background: #fef3c7;
    border-color: #fbbf24;
    color: #92400e;
}
.servings-btn.active {
    background: #7c3aed;
    border-color: #7c3aed;
    color: white;
}
.servings-btn.active:hover {
    background: #6d28d9;
    border-color: #6d28d9;
}
.servings-btn.time-btn {
    flex-direction: row;
    padding: 8px 12px;
}

/* Difficulty buttons */
.difficulty-btn-group {
    display: flex;
    gap: 6px;
}
.difficulty-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    justify-content: center;
    padding: 7px 10px;
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid #e5e7eb;
    background: white;
    color: #6b7280;
    transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
.difficulty-btn.easy:hover {
    background: #dcfce7;
    border-color: #86efac;
    color: #166534;
}
.difficulty-btn.easy.active {
    background: #16a34a;
    border-color: #16a34a;
    color: white;
}
.difficulty-btn.medium:hover {
    background: #fef9c3;
    border-color: #fde047;
    color: #854d0e;
}
.difficulty-btn.medium.active {
    background: #ca8a04;
    border-color: #ca8a04;
    color: white;
}
.difficulty-btn.hard:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #991b1b;
}
.difficulty-btn.hard.active {
    background: #dc2626;
    border-color: #dc2626;
    color: white;
}

/* Cuisine typeahead */
.cuisine-typeahead {
    position: relative;
}
.cuisine-dropdown {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    z-index: 40;
    max-height: 200px;
    overflow-y: auto;
    background: white;
    border: 1px solid #d1d5db;
    border-top: none;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    display: none;
}
.cuisine-dropdown.open {
    display: block;
}
.cuisine-dropdown .item {
    padding: 6px 12px;
    cursor: pointer;
    font-size: 0.875rem;
}
.cuisine-dropdown .item:hover,
.cuisine-dropdown .item.highlighted {
    background: #fff7ed;
}

/* Dual-thumb range slider */
.range-slider {
    position: relative;
    height: 36px;
}
.range-slider input[type="range"] {
    position: absolute;
    width: 100%;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    height: 6px;
    margin: 0;
}
.range-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    pointer-events: all;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #f97316;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.25);
    cursor: pointer;
    position: relative;
    z-index: 1;
}
.range-slider input[type="range"]::-moz-range-thumb {
    pointer-events: all;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #f97316;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.25);
    cursor: pointer;
}
.range-slider .range-track {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 0;
    right: 0;
    height: 6px;
    border-radius: 3px;
    background: #e5e7eb;
}
.range-slider .range-fill {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    height: 6px;
    border-radius: 3px;
    background: #f97316;
}

/* Ingredient combobox */
.ingredient-combobox {
    position: relative;
}
.ingredient-dropdown {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    z-index: 40;
    max-height: 200px;
    overflow-y: auto;
    background: white;
    border: 1px solid #d1d5db;
    border-top: none;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    display: none;
}
.ingredient-dropdown.open {
    display: block;
}
.ingredient-dropdown .item {
    padding: 6px 12px;
    cursor: pointer;
    font-size: 0.875rem;
}
.ingredient-dropdown .item:hover,
.ingredient-dropdown .item.highlighted {
    background: #fff7ed;
}
.ingredient-dropdown .item .count {
    color: #9ca3af;
    font-size: 0.75rem;
}

/* Chips */
.chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    border-radius: 9999px;
    font-size: 0.8125rem;
    line-height: 1.5;
    white-space: nowrap;
}
.chip-remove {
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    opacity: 0.6;
}
.chip-remove:hover {
    opacity: 1;
}
.chip-include {
    background: #dcfce7;
    color: #166534;
}
.chip-exclude {
    background: #fee2e2;
    color: #991b1b;
}

/* Mobile drawer */
.filter-drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 60;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}
.filter-drawer-backdrop.open {
    opacity: 1;
    pointer-events: all;
}
.filter-drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 85vw;
    max-width: 380px;
    background: white;
    z-index: 70;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    overflow-y: auto;
    box-shadow: 4px 0 15px rgba(0,0,0,0.1);
}
.filter-drawer.open {
    transform: translateX(0);
}
.filter-drawer details summary {
    cursor: pointer;
    padding: 12px 16px;
    font-weight: 600;
    font-size: 0.875rem;
    border-bottom: 1px solid #f3f4f6;
    list-style: none;
}
.filter-drawer details summary::-webkit-details-marker {
    display: none;
}
.filter-drawer details summary::after {
    content: "+";
    float: right;
    font-weight: 400;
    color: #9ca3af;
}
.filter-drawer details[open] summary::after {
    content: "\2212";
}
.filter-drawer details .detail-content {
    padding: 8px 16px 16px;
}
