/**
 * Attribute Filter Widget Styles
 */

.attribute-filter-widget {
    background: #fff;
    padding: 20px 0;
    border-radius: 4px;
}

.attribute-filter-widget .widget-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #333;
}

.attribute-filter-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-group label {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.filter-group select.attribute-select {
    width: 100%;
    padding: 10px;
    border: none;
    border-bottom: 1px solid #ddd;
    border-radius: 0;
    font-size: 14px;
    color: #333;
    background-color: transparent;
    transition: border-color 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right center;
    background-size: 20px;
    padding-right: 30px;
}

.filter-group select.attribute-select:focus {
    outline: none;
    border-bottom-color: #2c974b;
    border-bottom-width: 2px;
}

.filter-group select.attribute-select:disabled {
    background-color: #f5f5f5;
    color: #999;
    cursor: not-allowed;
    opacity: 0.6;
}

.filter-submit-button {
    background-color: #004e98;
    color: #fff;
    padding: 12px 30px;
    border: none;
    border-radius: 3px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.filter-submit-button:hover {
    background-color: #003d7a;
}

.filter-submit-button:active {
    transform: translateY(1px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .attribute-filter-widget {
        padding: 15px 0;
    }

    .filter-group select.attribute-select {
        font-size: 16px; /* Prevent iOS auto-zoom */
    }

    .filter-submit-button {
        width: 100%;
    }
}

/* Sidebar style optimization */
.widget.attribute_filter_widget {
    margin-bottom: 30px;
}

.widget.attribute_filter_widget .widget-title {
    margin-bottom: 15px;
}

/* Loading animation */
@keyframes loading {
    0% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0.6;
    }
}

.filter-group select.attribute-select:disabled {
    animation: loading 1.5s ease-in-out infinite;
}

/* Form validation styles */
.filter-group select.attribute-select.error {
    border-color: #e74c3c;
}

.filter-group .error-message {
    color: #e74c3c;
    font-size: 12px;
    margin-top: 5px;
}

/* Elementor Widget Specific Styles */
.elementor-attribute-filter {
    background: #fff;
    padding: 40px 30px 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: relative;
}

.elementor-attribute-filter .filter-widget-title {
    font-size: 32px;
    font-weight: 700;
    color: #ff8c00;
    text-align: center;
    margin-bottom: 10px;
    line-height: 1.2;
}

.elementor-attribute-filter .filter-widget-subtitle {
    text-align: center;
    color: #333;
    font-size: 16px;
    margin-bottom: 30px;
    line-height: 1.5;
}

.elementor-attribute-filter .attribute-filter-form {
    display: flex;
    flex-direction: column;
}

/* 筛选器容器 - 使用grid布局 */
.elementor-attribute-filter .filter-groups-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* 按钮位置 - 居中显示在下方 */
.elementor-attribute-filter .filter-submit-button {
    width: auto;
    min-width: 150px;
    min-height: 50px;
    margin: 0 auto;
    padding: 14px 45px;
    border-radius: 4px;
    border: none;
    display: block;
    transition: all 0.3s ease;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Elementor Editor Specific */
.elementor-editor-active .elementor-attribute-filter {
    pointer-events: none;
}

.elementor-editor-active .elementor-attribute-filter .filter-submit-button {
    pointer-events: auto;
    cursor: not-allowed;
}

/* Responsive for Elementor Widget */
@media (max-width: 1024px) {
    .elementor-attribute-filter .filter-groups-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .elementor-attribute-filter {
        padding: 30px 20px 25px;
    }
    
    .elementor-attribute-filter .filter-widget-title {
        font-size: 28px;
    }
    
    .elementor-attribute-filter .filter-widget-subtitle {
        font-size: 14px;
    }
    
    .elementor-attribute-filter .filter-groups-container {
        margin-bottom: 25px;
    }
    
    .elementor-attribute-filter .filter-submit-button {
        width: auto;
        min-width: 140px;
        margin: 0 auto;
        padding: 12px 35px;
    }
}
