/**
 * Custom WooCommerce Product Filters - Frontend Styles
 * 精致优化版本 - 轻薄设计风格
 * 版本 4.1.0 - 彻底修复打勾符号重叠问题
 * !important 用于确保样式优先级
 */

/* 强制清除可能的缓存 - 版本 4.1.0 - 时间戳: 2024-12-19 */

/* 过滤器和排序按钮容器 */
.cwpf-filters-buttons-container {
    display: flex !important;
    align-items: flex-start !important;
    gap: 12px !important;
    margin-bottom: 20px !important;
    width: 100% !important;
    position: relative !important;
    z-index: 10 !important;
    clear: both !important;
}

/* 过滤器容器 */
.cwpf-filters-container {
    margin-bottom: 20px !important;
    width: 100% !important;
    position: relative !important;
    z-index: 10 !important;
    clear: both !important;
}

/* 过滤器按钮样式 - 精致轻薄设计 */
.cwpf-mobile-filters {
    position: relative !important;
    display: inline-block !important;
}

.cwpf-mobile-filters summary {
    list-style: none !important;
    cursor: pointer !important;
    outline: none !important;
}

.cwpf-mobile-filters summary::-webkit-details-marker {
    display: none !important;
}

/* 过滤器按钮 - 精致轻薄版本 */
.mobile-facets__open.button.filter-button,
.mobile-facets__open.filter-button,
.filter-button {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 8px 16px !important;
    background: #ffffff !important;
    border: 1px solid #d1d5db !important;
    border-radius: 4px !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    color: #374151 !important;
    text-decoration: none !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    min-width: auto !important;
    width: auto !important;
    max-width: 120px !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05) !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    line-height: 1.5 !important;
    font-family: inherit !important;
}

.mobile-facets__open.button.filter-button:hover,
.mobile-facets__open.filter-button:hover,
.filter-button:hover {
    background: #f9fafb !important;
    color: #111827 !important;
    border-color: #9ca3af !important;
    transform: none !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1) !important;
}

.filter-button svg {
    width: 16px !important;
    height: 15px !important;
    fill: #999999 !important;
    flex-shrink: 0 !important;
}

.filter-button-text {
    white-space: nowrap !important;
    font-weight: 400 !important;
    font-size: 14px !important;
}

/* 过滤器数量显示 */
.filter-items_amount {
    color: #6b7280 !important;
    font-weight: 400 !important;
    font-size: 12px !important;
    margin-left: 4px !important;
}

/* 关闭按钮 - 精致设计 */
.mobile-facets__close {
    position: absolute !important;
    top: 20px !important;
    right: 16px !important;
    cursor: pointer !important;
    padding: 6px !important;
    z-index: 10000000 !important;
    background: rgba(255, 255, 255, 0.95) !important;
    border-radius: 50% !important;
    width: 36px !important;
    height: 36px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: 1px solid #e5e7eb !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1) !important;
    transition: all 0.2s ease !important;
}

.mobile-facets__close:hover {
    background: #f3f4f6 !important;
    border-color: #d1d5db !important;
    transform: scale(1.05) !important;
}

.mobile-facets__close svg {
    width: 14px !important;
    height: 14px !important;
    stroke: #6b7280 !important;
    stroke-width: 2 !important;
}

/* 过滤器面板 - 精致右侧滑出效果 */
.mobile-facets {
    display: none !important;
    position: fixed !important;
    top: 0 !important;
    right: -100% !important;
    width: 90% !important;
    max-width: 380px !important;
    height: 100vh !important;
    background: white !important;
    z-index: 9999999 !important;
    box-shadow: -2px 0 15px rgba(0, 0, 0, 0.1) !important;
    transition: right 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
    overflow: hidden !important;
    padding-top: 80px !important;
}

.cwpf-mobile-filters[open] .mobile-facets {
    display: block !important;
    right: 0 !important;
}

/* 背景遮罩 - 轻薄设计 */
.cwpf-mobile-filters[open]::before {
    content: '' !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(0, 0, 0, 0.4) !important;
    z-index: 9999998 !important;
    animation: fadeIn 0.25s ease-out !important;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 过滤器内部结构 */
.mobile-facets__inner {
    height: calc(100vh - 80px) !important;
    display: flex !important;
    flex-direction: column !important;
    background: white !important;
    padding-top: 0 !important;
}

/* 过滤器头部 - 精致设计 */
.mobile-facets__header {
    padding: 20px 60px 16px 16px !important;
    border-bottom: 1px solid #e5e7eb !important;
    background: #fafbfc !important;
    position: relative !important;
    flex-shrink: 0 !important;
    min-height: auto !important;
    height: auto !important;
}

.mobile-facets__header-inner {
    position: relative !important;
    width: 100% !important;
}

.active-facets-mobile {
    position: relative !important;
    margin-top: 8px !important;
}

.mobile-facets__heading.h2,
.mobile-facets__heading {
    font-size: 18px !important;
    font-weight: 600 !important;
    margin: 0 !important;
    color: #111827 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    line-height: 1.4 !important;
    padding-right: 50px !important;
    word-wrap: break-word !important;
    font-family: inherit !important;
}

/* 活动过滤器标签 - 精致设计 */
.active-facets-in-menu {
    margin-top: 8px !important;
}

.active-facets-in-menu.hidden {
    display: none !important;
}

.active-filter-tags {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    margin-top: 8px !important;
    line-height: 1.4 !important;
}

.active-filter-tag {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    background: #f3f4f6 !important;
    color: #374151 !important;
    padding: 6px 8px 6px 12px !important;
    border-radius: 20px !important;
    font-size: 12px !important;
    font-weight: 400 !important;
    border: 1px solid #e5e7eb !important;
    transition: all 0.2s ease !important;
    max-width: 200px !important;
    font-family: inherit !important;
}

.active-filter-tag:hover {
    background: #e5e7eb !important;
    border-color: #d1d5db !important;
}

.active-filter-text {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 150px !important;
    font-size: 12px !important;
    font-weight: 400 !important;
    color: #374151 !important;
}

/* 活动过滤器关闭按钮 */
.active-filter-tag-close {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 16px !important;
    height: 16px !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    border: none !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    color: #6b7280 !important;
    transition: all 0.2s ease !important;
    flex-shrink: 0 !important;
    outline: none !important;
}

.active-filter-tag-close:hover {
    background: rgba(107, 114, 128, 0.1) !important;
    color: #374151 !important;
    transform: scale(1.1) !important;
}

.active-filter-tag-close:active {
    transform: scale(0.95) !important;
}

.active-filter-tag-close svg {
    width: 10px !important;
    height: 10px !important;
    stroke: currentColor !important;
    stroke-width: 1.5 !important;
    pointer-events: none !important;
}

/* 当没有活动过滤器时隐藏容器 */
.active-facets-in-menu:empty {
    display: none !important;
}

/* 确保活动过滤器在头部区域正确显示 */
.mobile-facets__header .active-facets-mobile {
    margin-top: 8px !important;
}

.mobile-facets__header .active-facets-in-menu {
    margin-top: 8px !important;
    max-height: none !important;
    overflow-y: visible !important;
    -webkit-overflow-scrolling: touch !important;
}

/* 移除滚动条样式，因为不再需要滚动 */
.mobile-facets__header .active-facets-in-menu::-webkit-scrollbar {
    display: none !important;
}

.mobile-facets__header .active-facets-in-menu::-webkit-scrollbar-track {
    display: none !important;
}

.mobile-facets__header .active-facets-in-menu::-webkit-scrollbar-thumb {
    display: none !important;
}

.mobile-facets__header .active-facets-in-menu::-webkit-scrollbar-thumb:hover {
    display: none !important;
}

/* 响应式优化 - 移动端 */
@media (max-width: 768px) {
    .active-filter-tags {
        gap: 6px !important;
        line-height: 1.3 !important;
    }
    
    .active-filter-tag {
        padding: 5px 6px 5px 10px !important;
        font-size: 11px !important;
        max-width: 160px !important;
    }
    
    .active-filter-text {
        max-width: 120px !important;
        font-size: 11px !important;
    }
    
    .active-filter-tag-close {
        width: 14px !important;
        height: 14px !important;
    }
    
    .active-filter-tag-close svg {
        width: 8px !important;
        height: 8px !important;
    }
    
    /* 移动端移除高度限制 */
    .mobile-facets__header .active-facets-in-menu {
        max-height: none !important;
        overflow-y: visible !important;
    }
    
    /* 移动端头部高度自适应 */
    .mobile-facets__header {
        padding: 20px 60px 16px 20px !important;
        min-height: auto !important;
        height: auto !important;
    }
}

/* 桌面端也确保自适应高度 */
@media (min-width: 769px) {
    .mobile-facets__header {
        padding: 24px 60px 20px 20px !important;
        min-height: auto !important;
        height: auto !important;
    }
    
    .mobile-facets__header .active-facets-in-menu {
        max-height: none !important;
        overflow-y: visible !important;
    }
}

/* 过滤器主内容区域 */
.mobile-facets__main {
    flex: 1 !important;
    overflow-y: auto !important;
    background: white !important;
    padding: 0 !important;
    -webkit-overflow-scrolling: touch !important;
    min-height: 0 !important; /* 确保flex子元素可以收缩 */
}

/* 过滤器组 - 精致设计 */
.mobile-facets__details {
    border-bottom: 1px solid #f3f4f6 !important;
    background: white !important;
}

.mobile-facets__details:last-child {
    border-bottom: none !important;
}

.mobile-facets__summary {
    padding: 16px !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    list-style: none !important;
    user-select: none !important;
    background: white !important;
    transition: background-color 0.2s ease !important;
    border: none !important;
    outline: none !important;
}

.mobile-facets__summary::-webkit-details-marker {
    display: none !important;
}

.mobile-facets__summary:hover {
    background: #fafbfc !important;
}

.filter-menu-label {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    font-weight: 500 !important;
    font-size: 15px !important;
    color: #111827 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    font-family: inherit !important;
}

.filter-menu-state-icon {
    position: relative !important;
    width: 20px !important;
    height: 20px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.filter-menu-state-icon::after {
    content: '+' !important;
    font-size: 18px !important;
    color: #6b7280 !important;
    line-height: 1 !important;
    font-weight: 300 !important;
    transition: transform 0.2s ease !important;
}

.mobile-facets__details[open] .filter-menu-state-icon::after {
    content: '−' !important;
    transform: rotate(0deg) !important;
}

/* 过滤器子菜单 - 精致设计 */
.mobile-facets__submenu {
    padding: 0 16px 16px 16px !important;
    background: #fafbfc !important;
}

.mobile-facets__list {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.mobile-facets__item {
    margin-bottom: 0 !important;
    border-bottom: 1px solid #f9fafb !important;
}

.mobile-facets__item:last-child {
    border-bottom: none !important;
}

/* 过滤器选项标签 - 精致轻薄设计 */
.mobile-facets__label {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 12px 0 !important;
    cursor: pointer !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
    user-select: none !important;
    color: #374151 !important;
    transition: color 0.2s ease !important;
    font-weight: 400 !important;
    font-family: inherit !important;
}

.mobile-facets__label:hover {
    color: #111827 !important;
}

/* 复选框样式 - 精致自定义设计 */
.mobile-facets__checkbox {
    width: 16px !important;
    height: 16px !important;
    margin: 0 !important;
    cursor: pointer !important;
    accent-color: #374151 !important;
    transform: scale(1) !important;
}

.mobile-facets__checkbox:checked {
    accent-color: #111827 !important;
}

/* 图标占位符 */
.mobile-facets__label .icon {
    display: none !important;
}

/* 数量显示 - 精致设计 */
.caption-with-letter-spacing {
    color: #9ca3af !important;
    font-size: 12px !important;
    font-weight: 400 !important;
    margin-left: auto !important;
    background: #f3f4f6 !important;
    padding: 2px 6px !important;
    border-radius: 8px !important;
    line-height: 1.2 !important;
}

/* 过滤器底部按钮区域 - 精致设计 */
.mobile-facets__footer {
    padding: 16px !important;
    border-top: 1px solid #e5e7eb !important;
    background: white !important;
    display: flex !important;
    gap: 10px !important;
    flex-shrink: 0 !important;
    box-shadow: 0 -1px 3px rgba(0,0,0,0.05) !important;
}

.mobile-facets__footer .button,
.mobile-facets__footer button {
    flex: 1 !important;
    padding: 10px 16px !important;
    border-radius: 4px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    text-align: center !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    text-decoration: none !important;
    border: 1px solid !important;
    display: inline-block !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    min-height: 40px !important;
    line-height: 1.4 !important;
    font-family: inherit !important;
}

.mobile-facets__footer .clear-filters-button {
    background: white !important;
    color: #374151 !important;
    border-color: #d1d5db !important;
}

.mobile-facets__footer .clear-filters-button:hover {
    background: #f9fafb !important;
    color: #111827 !important;
    border-color: #9ca3af !important;
    transform: none !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1) !important;
}

.mobile-facets__footer .cwpf-apply-filters,
.mobile-facets__footer button[type="button"]:not(.clear-filters-button) {
    background: #111827 !important;
    color: white !important;
    border-color: #111827 !important;
}

.mobile-facets__footer .cwpf-apply-filters:hover,
.mobile-facets__footer button[type="button"]:not(.clear-filters-button):hover {
    background: #1f2937 !important;
    border-color: #1f2937 !important;
    transform: none !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2) !important;
}

/* 隐藏元素 */
.hidden {
    display: none !important;
}

.no-js-hidden {
    display: block !important;
}

/* 加载状态 - 精致设计 */
.cwpf-loading {
    position: relative !important;
    opacity: 0.7 !important;
    pointer-events: none !important;
}

.cwpf-loading-overlay {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(255, 255, 255, 0.95) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 100 !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    color: #6b7280 !important;
    font-family: inherit !important;
}

/* 防止页面滚动 */
body.cwpf-filters-open {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
    top: 0 !important;
}

/* 响应式设计 - 精致版本 */
@media (max-width: 768px) {
    .mobile-facets {
        width: 100% !important;
        max-width: none !important;
        padding-top: 80px !important;
    }
    
    .mobile-facets__inner {
        height: calc(100vh - 80px) !important;
    }
    
    .mobile-facets__header {
        padding: 20px 60px 16px 20px !important;
        min-height: 70px !important;
    }
    
    .mobile-facets__close {
        top: 22px !important;
        right: 20px !important;
    }
    
    .mobile-facets__footer {
        padding: 16px !important;
    }
    
    .mobile-facets__footer .button,
    .mobile-facets__footer button {
        padding: 12px 16px !important;
        font-size: 14px !important;
        min-height: 44px !important;
    }
    
    .filter-button {
        padding: 10px 16px !important;
        font-size: 14px !important;
    }
}

@media (min-width: 769px) {
    .mobile-facets {
        width: 380px !important;
        max-width: 380px !important;
        padding-top: 100px !important;
    }
    
    .mobile-facets__inner {
        height: calc(100vh - 100px) !important;
    }
    
    .mobile-facets__header {
        padding: 24px 60px 20px 20px !important;
        min-height: 80px !important;
    }
    
    .mobile-facets__close {
        top: 24px !important;
        right: 20px !important;
    }
}

/* 针对有固定头部的主题的额外调整 */
body.admin-bar .mobile-facets {
    padding-top: 120px !important;
}

body.admin-bar .mobile-facets__inner {
    height: calc(100vh - 120px) !important;
}

@media screen and (max-width: 782px) {
    body.admin-bar .mobile-facets {
        padding-top: 106px !important;
    }
    
    body.admin-bar .mobile-facets__inner {
        height: calc(100vh - 106px) !important;
    }
}

/* 针对可能的主题头部高度调整 */
.mobile-facets.has-header-offset {
    padding-top: 120px !important;
}

.mobile-facets.has-header-offset .mobile-facets__inner {
    height: calc(100vh - 120px) !important;
}

/* 调试样式 - 精致版本 */
.cwpf-debug {
    background: #fef3c7 !important;
    border: 1px solid #f59e0b !important;
    padding: 8px 12px !important;
    margin: 8px 0 !important;
    border-radius: 4px !important;
    font-size: 12px !important;
    color: #92400e !important;
    font-family: inherit !important;
}

/* 强制覆盖主题样式 */
.cwpf-filters-container * {
    box-sizing: border-box !important;
}

/* 确保按钮在所有主题中都能正确显示 - 精致版本 */
.cwpf-filters-container .filter-button,
.cwpf-filters-container .mobile-facets__open {
    all: unset !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 8px 16px !important;
    background: #ffffff !important;
    border: 1px solid #d1d5db !important;
    border-radius: 4px !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    color: #374151 !important;
    text-decoration: none !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05) !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    line-height: 1.5 !important;
    font-family: inherit !important;
}

/* 强制WooCommerce按钮显示英文文本 */
.woocommerce .button.add_to_cart_button::after {
    content: 'Add to Cart' !important;
}

.woocommerce .button.product_type_variable::after {
    content: 'Select Options' !important;
}

.woocommerce .button.product_type_external::after {
    content: 'Buy Product' !important;
}

.woocommerce .button.product_type_grouped::after {
    content: 'View Products' !important;
}

/* 隐藏中文文本，显示英文替代 */
.woocommerce .add_to_cart_button,
.woocommerce .product_type_variable,
.woocommerce .product_type_external,
.woocommerce .product_type_grouped {
    font-size: 0 !important;
    position: relative !important;
}

.woocommerce .add_to_cart_button::after {
    content: 'Add to Cart' !important;
    font-size: 13px !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    white-space: nowrap !important;
    font-weight: 400 !important;
    font-family: inherit !important;
}

.woocommerce .product_type_variable::after {
    content: 'Select Options' !important;
    font-size: 13px !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    white-space: nowrap !important;
    font-weight: 400 !important;
    font-family: inherit !important;
}

.woocommerce .product_type_external::after {
    content: 'Buy Product' !important;
    font-size: 13px !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    white-space: nowrap !important;
    font-weight: 400 !important;
    font-family: inherit !important;
}

.woocommerce .product_type_grouped::after {
    content: 'View Products' !important;
    font-size: 13px !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    white-space: nowrap !important;
    font-weight: 400 !important;
    font-family: inherit !important;
}

/* 强制覆盖任何主题样式 */
.woocommerce-loop-product__link .button,
.woocommerce ul.products li.product .button,
.woocommerce-page ul.products li.product .button {
    font-size: 0 !important;
    position: relative !important;
}

.woocommerce-loop-product__link .button::after,
.woocommerce ul.products li.product .button::after,
.woocommerce-page ul.products li.product .button::after {
    content: 'Add to Cart' !important;
    font-size: 13px !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    white-space: nowrap !important;
    font-weight: 400 !important;
    font-family: inherit !important;
}

/* 排序下拉框样式 - 替换原来的侧边栏面板 */
.cwpf-sort-dropdown {
    position: relative !important;
    display: inline-block !important;
}

/* 排序按钮 - 与过滤器按钮保持一致 */
.sort-dropdown-button {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 8px 16px !important;
    background: #ffffff !important;
    border: 1px solid #d1d5db !important;
    border-radius: 4px !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    color: #374151 !important;
    text-decoration: none !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    min-width: auto !important;
    width: auto !important;
    max-width: 160px !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05) !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    line-height: 1.5 !important;
    font-family: inherit !important;
    outline: none !important;
}

.sort-dropdown-button:hover {
    background: #f9fafb !important;
    color: #111827 !important;
    border-color: #9ca3af !important;
    transform: none !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1) !important;
}

.sort-dropdown-button[aria-expanded="true"] {
    background: #f9fafb !important;
    border-color: #9ca3af !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1) !important;
}

.sort-dropdown-button svg {
    width: 14px !important;
    height: 13px !important;
    fill: #999999 !important;
    flex-shrink: 0 !important;
    transition: transform 0.2s ease !important;
}

.sort-dropdown-button[aria-expanded="true"] svg {
    transform: rotate(180deg) !important;
}

.sort-button-text {
    white-space: nowrap !important;
    font-weight: 400 !important;
    font-size: 14px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 120px !important;
}

/* 下拉菜单 */
.sort-dropdown-menu {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    background: white !important;
    border: 1px solid #d1d5db !important;
    border-radius: 4px !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
    z-index: 1000 !important;
    margin-top: 2px !important;
    min-width: 200px !important;
    max-height: 300px !important;
    overflow-y: auto !important;
    animation: fadeInDown 0.15s ease-out !important;
    display: none !important;
}

/* 当下拉框打开时显示菜单 */
.cwpf-sort-dropdown.open .sort-dropdown-menu {
    display: block !important;
}

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

/* 下拉菜单列表 */
.sort-dropdown-list {
    list-style: none !important;
    margin: 0 !important;
    padding: 4px 0 !important;
}

.sort-dropdown-item {
    margin: 0 !important;
    padding: 0 !important;
}

/* 排序选项按钮 */
.sort-option {
    display: block !important;
    width: 100% !important;
    padding: 8px 16px !important;
    background: transparent !important;
    border: none !important;
    text-align: left !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    color: #374151 !important;
    cursor: pointer !important;
    transition: background-color 0.15s ease !important;
    font-family: inherit !important;
    outline: none !important;
    line-height: 1.4 !important;
}

.sort-option:hover {
    background: #f3f4f6 !important;
    color: #111827 !important;
}

.sort-option[data-selected="true"] {
    background: #eff6ff !important;
    color: #1d4ed8 !important;
    font-weight: 500 !important;
    position: relative !important;
}

/* 彻底删除所有可能的伪元素和打勾符号 */
.sort-option::after,
.sort-option::before,
.sort-option[data-selected]::after,
.sort-option[data-selected]::before,
.sort-option[data-selected="true"]::after,
.sort-option[data-selected="true"]::before,
button.sort-option::after,
button.sort-option::before,
button.sort-option[data-selected]::after,
button.sort-option[data-selected]::before,
button.sort-option[data-selected="true"]::after,
button.sort-option[data-selected="true"]::before {
    display: none !important;
    content: "" !important;
    content: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    font-size: 0 !important;
    line-height: 0 !important;
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
}

/* 响应式设计 - 下拉框 */
@media (max-width: 768px) {
    .cwpf-filters-buttons-container {
        gap: 8px !important;
    }
    
    .sort-dropdown-button {
        padding: 10px 16px !important;
        font-size: 14px !important;
        max-width: 140px !important;
    }
    
    .sort-button-text {
        max-width: 100px !important;
    }
    
    .sort-dropdown-menu {
        min-width: 180px !important;
        left: 0 !important;
        right: auto !important;
    }
}

@media (min-width: 769px) {
    .sort-dropdown-menu {
        min-width: 200px !important;
    }
}

/* 移除原来的侧边栏排序面板样式 */
.cwpf-mobile-sort,
.mobile-sort,
.mobile-sort__open,
.mobile-sort__inner,
.mobile-sort__header,
.mobile-sort__heading,
.mobile-sort__close,
.mobile-sort__main,
.mobile-sort__list,
.mobile-sort__item,
.mobile-sort__label,
.mobile-sort__radio,
.mobile-sort__text {
    display: none !important;
}

/* 防止页面滚动 - 移除排序面板相关 */
body.cwpf-sort-open {
    overflow: auto !important;
    position: static !important;
    width: auto !important;
    top: auto !important;
}

/* 修复产品按钮样式 - 确保文字居中 v3.9.5 */
.cwpf-button-wrapper {
    text-align: center !important;
    margin-top: 10px !important;
    width: 100% !important;
    display: block !important;
}

.cwpf-add-to-cart,
.cwpf-select-options {
    display: inline-block !important;
    width: auto !important;
    min-width: 120px !important;
    padding: 8px 16px !important;
    text-align: center !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    line-height: 1.2 !important;
    border-radius: 4px !important;
    transition: all 0.2s ease !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    cursor: pointer !important;
    box-sizing: border-box !important;
    /* 统一使用灰底样式 */
    background: #f8f9fa !important;
    color: #495057 !important;
    border: 1px solid #dee2e6 !important;
}

.cwpf-add-to-cart:hover,
.cwpf-select-options:hover {
    background: #e9ecef !important;
    border-color: #adb5bd !important;
    color: #495057 !important;
    transform: translateY(-1px) !important;
}

/* 确保产品循环中的按钮样式不被主题覆盖 */
.products .product .cwpf-button-wrapper .button,
.woocommerce .products .product .cwpf-button-wrapper .button,
ul.products li.product .cwpf-button-wrapper .button,
.products .product .cwpf-button-wrapper a,
.woocommerce .products .product .cwpf-button-wrapper a,
ul.products li.product .cwpf-button-wrapper a {
    width: auto !important;
    min-width: 120px !important;
    text-align: center !important;
    display: inline-block !important;
    margin: 0 auto !important;
    justify-content: center !important;
    align-items: center !important;
}

/* 强制覆盖主题的按钮样式 */
.cwpf-add-to-cart,
.cwpf-select-options,
.button.cwpf-add-to-cart,
.button.cwpf-select-options,
a.button.cwpf-add-to-cart,
a.button.cwpf-select-options,
a.cwpf-add-to-cart,
a.cwpf-select-options {
    text-align: center !important;
    justify-content: center !important;
    align-items: center !important;
    display: inline-flex !important;
} 