/*
Theme Name: Astra Child
Template: astra
Version: 3.0.0
Text Domain: astra-child
Description: Child theme for Astra with custom header and footer
*/

/* ==================== 1. 基本重置 ==================== */
* {
    box-sizing: border-box;
}

/* ==================== 2. 自定义顶部栏 ==================== */
#topBar.custom-top-bar {
    background-color: #000000 !important;
    color: #ffffff !important;
    padding: 15px 0 !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    z-index: 10001 !important;
    transition: all 0.3s ease-in-out !important;
    display: flex !important;
    align-items: center !important;
}

#topBar.custom-top-bar.shrink {
    padding: 8px 0 !important;
    background-color: rgba(0, 0, 0, 0.95) !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3) !important;
}

#topBar.custom-top-bar .top-bar-inner {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    max-width: 1400px !important;
    margin: 0 auto !important;
    padding: 0 20px !important;
    width: 100% !important;
}

.tb-section {
    display: flex !important;
    align-items: center !important;
    gap: 20px !important;
}

/* 顶部栏链接样式 */
#topBar.custom-top-bar a {
    color: #ffffff !important;
    text-decoration: none !important;
    text-transform: uppercase !important;
    transition: opacity 0.3s !important;
    font-size: 13px !important;
    font-weight: 400 !important;
    letter-spacing: 0.5px !important;
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
    font-family: 'Inter', sans-serif !important;
}

#topBar.custom-top-bar a:hover {
    opacity: 0.7 !important;
}

/* 社交图标区域 */
#topBar.custom-top-bar .social-icons {
    display: flex !important;
    gap: 15px !important;
    padding-right: 20px !important;
    border-right: 1px solid #333 !important;
    margin-right: 5px !important;
    height: 20px !important;
    align-items: center !important;
}

/* 图标样式 */
#topBar.custom-top-bar i.fa-solid,
#topBar.custom-top-bar i.fa-brands {
    display: inline-block !important;
    font-style: normal !important;
    font-variant: normal !important;
    text-rendering: auto !important;
    -webkit-font-smoothing: antialiased !important;
}

#topBar.custom-top-bar .fa-chevron-down {
    font-size: 12px !important;
}

#topBar.custom-top-bar .social-icons i {
    font-size: 14px !important;
}

/* ==================== 3. 主体布局调整 ==================== */
body {
    padding-top: 60px !important;
    font-family: 'Inter', sans-serif;
    min-height: 100vh !important;
    display: flex !important;
    flex-direction: column !important;
}

body.scrolled {
    padding-top: 46px !important;
}

/* Astra主题主导航菜单调整 */
.main-header-bar,
.ast-desktop .main-header-bar {
    position: fixed !important;
    top: 60px !important;
    width: 100% !important;
    z-index: 10000 !important;
    transition: top 0.3s ease-in-out !important;
}

body.scrolled .main-header-bar,
body.scrolled .ast-desktop .main-header-bar {
    top: 38px !important;
}

/* 内容区域 */
#page {
    flex: 1 0 auto !important;
}

/* ==================== 4. 自定义页脚 ==================== */
.site-footer {
    background-color: #f5f5f5;
    color: #333;
    padding: 40px 0 20px;
    font-family: 'Inter', sans-serif;
    border-top: 3px solid #e0e0e0;
    margin-top: 50px;
    position: relative;
    z-index: 9999;
    flex-shrink: 0 !important;
}

.footer-container {
    max-width: 1400px !important;
    margin: 0 auto !important;
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: space-between !important;
    padding: 0 20px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* 页脚各部分样式 */
.footer-section {
    flex: 1 !important;
    min-width: 300px !important;
    margin-bottom: 30px !important;
    padding: 0 15px !important;
}

.footer-title {
    font-size: 18px !important;
    font-weight: bold !important;
    color: #2c3e50 !important;
    margin-bottom: 20px !important;
    padding-bottom: 10px !important;
    border-bottom: 2px solid #3498db !important;
}

.footer-content h4 {
    font-size: 16px !important;
    font-weight: bold !important;
    color: #34495e !important;
    margin: 15px 0 8px !important;
}

.footer-content p {
    font-size: 14px !important;
    line-height: 1.5 !important;
    margin: 8px 0 !important;
    color: #555 !important;
}

/* 信息区块 */
.hours-section,
.address-section,
.contact-section {
    margin-bottom: 15px !important;
}

.company-name {
    margin-top: 20px !important;
    padding-top: 15px !important;
    border-top: 1px dashed #ddd !important;
}

/* 底部版权信息 */
.footer-bottom {
    background-color: #2c3e50 !important;
    padding: 15px 0 !important;
    margin-top: 30px !important;
}

.copyright {
    max-width: 1400px !important;
    margin: 0 auto !important;
    text-align: center !important;
    padding: 0 20px !important;
}

.copyright p {
    color: #ecf0f1 !important;
    font-size: 14px !important;
    margin: 0 !important;
}

/* ==================== 5. 响应式设计 ==================== */
@media (max-width: 900px) {
    /* 顶部栏响应式 */
    #topBar.custom-top-bar .top-bar-inner {
        flex-direction: column !important;
        gap: 10px !important;
    }

    #topBar.custom-top-bar .social-icons {
        border-right: none !important;
        padding-right: 0 !important;
    }

    #topBar.custom-top-bar .tb-section:first-child {
        display: none !important;
    }

    #topBar.custom-top-bar .tb-section:last-child > a:not(.social-icon) {
        display: none !important;
    }

    #topBar.custom-top-bar .social-icons {
        justify-content: center !important;
        width: 100% !important;
    }
    
    /* 页脚响应式 */
    .site-footer {
        padding: 30px 0 15px !important;
    }
    
    .footer-container {
        flex-direction: column !important;
    }
    
    .footer-section {
        min-width: 100% !important;
        margin-bottom: 25px !important;
        padding: 0 10px !important;
    }
    
    .footer-title {
        font-size: 16px !important;
    }
    
    .footer-content p {
        font-size: 13px !important;
    }
}

/* ==================== 6. 跨浏览器兼容性 ==================== */
#topBar.custom-top-bar {
    transform: translateZ(0) !important;
    backface-visibility: hidden !important;
    -webkit-backface-visibility: hidden !important;
}

/* 确保所有页面样式一致 */
body.home #topBar.custom-top-bar,
body.blog #topBar.custom-top-bar,
body.single #topBar.custom-top-bar,
body.archive #topBar.custom-top-bar,
body.page #topBar.custom-top-bar,
body.woocommerce #topBar.custom-top-bar,
body.woocommerce-page #topBar.custom-top-bar,
body.search #topBar.custom-top-bar,
body.error404 #topBar.custom-top-bar {
    transition: all 0.3s ease-in-out !important;
    will-change: padding, background-color, box-shadow !important;
}

body.home .site-footer,
body.blog .site-footer,
body.single .site-footer,
body.archive .site-footer,
body.page .site-footer,
body.woocommerce .site-footer,
body.woocommerce-page .site-footer {
    background-color: #f5f5f5 !important;
}

/* 管理栏兼容 */
body.admin-bar #topBar.custom-top-bar {
    top: 32px !important;
}

@media (max-width: 782px) {
    body.admin-bar #topBar.custom-top-bar {
        top: 46px !important;
    }
}
/* ==================== 7. 辅助功能改进 ==================== */
/* 跳转到主要内容链接 - 屏幕阅读器专用 */
.skip-link.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute !important;
    width: 1px;
    word-wrap: normal !important;
}

.skip-link.screen-reader-text:focus {
    background-color: #fff;
    clip: auto !important;
    clip-path: none;
    color: #000;
    display: block;
    font-size: 14px;
    height: auto;
    left: 5px;
    line-height: normal;
    padding: 15px 23px 14px;
    text-decoration: none;
    top: 5px;
    width: auto;
    z-index: 100000;
    border-radius: 3px;
    box-shadow: 0 0 10px rgba(0,0,0,0.3);
}

/* 改进焦点状态 */
a:focus,
button:focus,
input:focus,
textarea:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* 改进地址标签样式 */
address {
    font-style: normal;
    margin-bottom: 15px;
}

/* 确保屏幕阅读器可以正确读取语义化元素 */
[role="contentinfo"] {
    display: block;
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .footer-title {
        border-bottom: 3px solid #000;
    }
    
    .site-footer {
        border-top: 4px solid #000;
    }
}