/*
Theme Name: CorpPro 企业主题
Version: 1.5.0 (Sticky 动态页头版)
*/

:root {
    --wp--custom--primary-color: #2563eb;
    --wp--custom--primary-dark: #1d4ed8;
    --wp--custom--text-color: #1e293b;
    --wp--custom--header-height: 80px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* ========================================
   1. 移动端菜单必要干预
   ======================================== */
@media (max-width: 768px) {
    /* 移动端显示汉堡菜单按钮 */
    header .wp-block-navigation__responsive-container-open {
        display: block !important;
    }
    
    /* 如果原生样式在移动端没隐藏菜单，这里强制隐藏 */
    header .wp-block-navigation__container {
        display: none; 
    }
}

/* ========================================
   2. 通用样式 (产品/表单/按钮)
   ======================================== */
.product-card {
    transition: all 0.3s ease;
    overflow: hidden;
    background: #fff;
}
.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

#contact-form input,
#contact-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 15px;
    box-sizing: border-box;
}
#contact-form button[type="submit"] {
    width: 100%;
    padding: 14px;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}
#form-message {
    padding: 10px;
    border-radius: 8px;
    margin-top: 10px;
    display: none;
}
#form-message.success { background: #d1fae5; color: #065f46; display: block; }
#form-message.error { background: #fee2e2; color: #991b1b; display: block; }

.wp-block-button__link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    transition: all 0.3s ease;
}

/* =========================================
   3. 动态页头效果 (Sticky 模式 - 核心功能)
   ========================================= */
.dynamic-header {
    /* 使用 Sticky：自然占据空间，不遮挡内容，无需 Spacer */
    position: -webkit-sticky; /* Safari 兼容 */
    position: sticky !important;
    top: 0;
    
    z-index: 9999;
    width: 100%;
    
    /* 初始状态：完全不透明 */
    background-color: rgba(255, 255, 255, 1) !important;
    transition: background-color 0.3s ease, backdrop-filter 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 0 0 transparent;
}

/* 滚动时的状态：半透明 + 毛玻璃 */
.dynamic-header.scrolled {
    background-color: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px); /* Safari 兼容 */
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

/* 鼠标悬停时的状态：恢复不透明 */
.dynamic-header:hover {
    background-color: rgba(255, 255, 255, 1) !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

/* 登录后台时自动下移，避免遮挡管理员条 */
body.admin-bar .dynamic-header {
    top: 32px; 
}

/* 移动端适配：如果手机上有 admin bar 高度不同 */
@media (max-width: 782px) {
    body.admin-bar .dynamic-header {
        top: 46px;
    }
}