/* Ravielson Product Filter - Frontend Styles */

:root {
    --rpf-primary: #1e1e1e;
    --rpf-primary-light: #3a3a3a;
    --rpf-accent: #1E1E1E;
    --rpf-border: rgba(30, 30, 30, 0.12);
    --rpf-bg: #ffffff;
    --rpf-bg-hover: rgba(30, 30, 30, 0.04);
    --rpf-radius: 12px;
    --rpf-shadow: 0 4px 24px -8px rgba(0, 0, 0, 0.12);
}

/* Sidebar Container */
.rpf-sidebar {
    background: var(--rpf-bg);
    border: 1px solid var(--rpf-border);
    border-radius: var(--rpf-radius);
    box-shadow: var(--rpf-shadow);
    overflow: hidden;
}

.rpf-sidebar-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--rpf-primary);
    padding: 20px 20px 0;
    margin: 0 0 8px;
}

/* Filter Form */
.rpf-filter-form {
    display: flex;
    flex-direction: column;
}

/* Filter Sections */
.rpf-filter-section {
    border-top: 1px solid var(--rpf-border);
}

.rpf-filter-section:first-child {
    border-top: none;
}

.rpf-section-toggle {
    width: 100%;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 15px;
    font-weight: 600;
    color: var(--rpf-primary);
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: background 0.2s ease;
}

.rpf-section-toggle:hover {
    background: var(--rpf-bg-hover);
}

.rpf-section-toggle::after {
    content: '';
    width: 10px;
    height: 10px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.rpf-filter-section.is-open .rpf-section-toggle::after {
    transform: rotate(-135deg);
}

.rpf-section-content {
    display: none;
    padding: 0 20px 16px;
}

.rpf-filter-section.is-open .rpf-section-content {
    display: block;
}

/* Category List */
.rpf-category-list,
.rpf-category-children {
    list-style: none;
    margin: 0;
    padding: 0;
}

.rpf-category-children {
    padding-left: 20px;
    margin-top: 4px;
}

.rpf-category-item {
    margin-bottom: 2px;
}

/* Checkbox Styles */
.rpf-checkbox-label,
.rpf-radio-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    cursor: pointer;
    transition: color 0.15s ease;
}

.rpf-checkbox-label:hover,
.rpf-radio-label:hover {
    color: var(--rpf-accent);
}

.rpf-checkbox-label input,
.rpf-radio-label input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.rpf-checkbox-custom,
.rpf-radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid var(--rpf-border);
    border-radius: 4px;
    background: var(--rpf-bg);
    transition: all 0.15s ease;
    flex-shrink: 0;
    position: relative;
}

.rpf-radio-custom {
    border-radius: 50%;
}

.rpf-checkbox-label input:checked + .rpf-checkbox-custom,
.rpf-radio-label input:checked + .rpf-radio-custom {
    background: var(--rpf-accent);
    border-color: var(--rpf-accent);
}

.rpf-checkbox-custom::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 6px;
    width: 5px;
    height: 10px;
    border: 2px solid #fff;
    border-top: none;
    border-left: none;
    transform: rotate(45deg) scale(0);
    transition: transform 0.15s ease;
}

.rpf-checkbox-label input:checked + .rpf-checkbox-custom::after {
    transform: rotate(45deg) scale(1);
}

.rpf-radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    background: #fff;
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.15s ease;
}

.rpf-radio-label input:checked + .rpf-radio-custom::after {
    transform: translate(-50%, -50%) scale(1);
}

.rpf-checkbox-text {
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.rpf-count {
    color: #888;
    font-size: 12px;
}

/* Price Filter */
.rpf-price-inputs {
    display: flex;
    align-items: flex-end;
    gap: 10px;
}

.rpf-price-field {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.rpf-price-field label {
    font-size: 12px;
    color: #666;
}

.rpf-price-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--rpf-border);
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.15s ease;
}

.rpf-price-input:focus {
    outline: none;
    border-color: var(--rpf-accent);
}

.rpf-price-separator {
    padding-bottom: 10px;
    color: #888;
}

.rpf-currency {
    display: none;
}

/* Tags */
.rpf-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.rpf-tag-item {
    display: flex;
}

.rpf-tag-item input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.rpf-tag-text {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--rpf-bg-hover);
    border: 1px solid var(--rpf-border);
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.rpf-tag-item input:checked + .rpf-tag-text,
.rpf-tag-item.active .rpf-tag-text {
    background: var(--rpf-accent);
    border-color: var(--rpf-accent);
    color: #fff;
}

.rpf-tag-item input:checked + .rpf-tag-text .rpf-count {
    color: rgba(255, 255, 255, 0.7);
}

/* Rating */
.rpf-rating-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.rpf-rating-item {
    margin-bottom: 4px;
}

.rpf-stars {
    display: flex;
    gap: 2px;
}

.rpf-star {
    color: #ddd;
    font-size: 16px;
}

.rpf-star.filled {
    color: #ffc107;
}

.rpf-rating-text {
    font-size: 12px;
    color: #888;
    margin-left: 4px;
}

/* Search Input */
.rpf-search-input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--rpf-border);
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.15s ease;
}

.rpf-search-input:focus {
    outline: none;
    border-color: var(--rpf-accent);
}

/* Action Buttons */
.rpf-actions {
    display: flex;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid var(--rpf-border);
}

.rpf-apply-btn,
.rpf-reset-btn {
    flex: 1;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.rpf-apply-btn {
    background: var(--rpf-accent);
    color: #fff;
}

.rpf-apply-btn:hover {
    background: #0052a3;
}

.rpf-reset-btn {
    background: var(--rpf-bg-hover);
    color: var(--rpf-primary);
    border: 1px solid var(--rpf-border);
}

.rpf-reset-btn:hover {
    background: #e8e8e8;
}

/* Responsive */
@media (max-width: 768px) {
    .rpf-sidebar {
        margin-bottom: 20px;
    }
}
