/**
 * 地理位置产品筛选样式
 *
 * @package Geo_Location_Product_Filter
 */

/* 市场信息栏样式 */
#glpf-market-info-bar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 0;
    text-align: center;
    font-size: 14px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
    z-index: 1000;
}

#glpf-market-info-bar .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
}

#market-info-text {
    font-weight: 500;
    margin: 0;
    color:#000;
}

#change-market-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

#change-market-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* 市场选择器模态框样式 */
#market-selector-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

#market-selector-modal > div {
    background: white;
    padding: 30px;
    border-radius: 12px;
    max-width: 450px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

#market-selector-modal h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
    font-size: 20px;
    font-weight: 600;
    text-align: center;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 15px;
}

#market-options {
    margin-bottom: 25px;
}

#market-options label {
    display: block;
    margin: 12px 0;
    cursor: pointer;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.3s ease;
    background: #fafafa;
    position: relative;
}

#market-options label:hover {
    border-color: #667eea;
    background: #f8f9ff;
    transform: translateX(5px);
}

#market-options input[type="radio"] {
    margin-right: 12px;
    transform: scale(1.2);
    accent-color: #667eea;
}

#market-options input[type="radio"]:checked + span,
#market-options label:has(input[type="radio"]:checked) {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 500;
}

/* 按钮样式 */
#market-selector-modal .modal-buttons {
    text-align: right;
    margin-top: 25px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

#cancel-market-change,
#confirm-market-change {
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    min-width: 80px;
}

#cancel-market-change {
    background: #6c757d;
    color: white;
}

#cancel-market-change:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

#confirm-market-change {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

#confirm-market-change:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* 响应式设计 */
@media (max-width: 768px) {
    #glpf-market-info-bar {
        padding: 10px 0;
        font-size: 13px;
    }
    
    #glpf-market-info-bar .container {
        flex-direction: column;
        gap: 10px;
    }
    
    #change-market-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    #market-selector-modal > div {
        padding: 20px;
        margin: 20px;
        width: calc(100% - 40px);
    }
    
    #market-selector-modal h3 {
        font-size: 18px;
    }
    
    #market-options label {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    #market-selector-modal .modal-buttons {
        flex-direction: column;
    }
    
    #cancel-market-change,
    #confirm-market-change {
        width: 100%;
        margin: 5px 0;
    }
}

@media (max-width: 480px) {
    #glpf-market-info-bar {
        font-size: 12px;
        padding: 8px 0;
    }
    
    #market-info-text {
        font-size: 12px;
    }
    
    #change-market-btn {
        font-size: 11px;
        padding: 5px 10px;
    }
}

/* 加载动画 */
.glpf-loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    margin-right: 8px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 主题兼容性 */
.theme-twentytwentyone #glpf-market-info-bar,
.theme-twentytwentytwo #glpf-market-info-bar,
.theme-twentytwentythree #glpf-market-info-bar {
    font-family: inherit;
}

/* WooCommerce兼容性 */
.woocommerce #glpf-market-info-bar {
    margin-bottom: 0;
}

.woocommerce-page #glpf-market-info-bar {
    margin-bottom: 0;
}