/*
Theme Name: Astra Child
Theme URI: http://localhost/wordpress
Description: Astra子主题，用于自定义页脚
Author: Admin
Author URI: http://localhost
Template: astra
Version: 1.0.0
License: GPL v2 or later
Text Domain: astra-child
*/

/* ========================================
   Dynamic Theme Based on Astra Child
   ======================================== */

/* ===== 强制覆盖Astra父主题样式 - 固定白色背景 ===== */
html body,
html body.home,
html body.blog,
html body.archive,
html body.single,
html body.page,
html body.post-type-archive,
html body.woocommerce,
html body.woocommerce-page,
html body.woocommerce-shop,
html body.tax-product_cat {
    background-color: #ffffff !important;
    background-image: none !important;
    color: #333333 !important;
}

/* 清除所有Astra容器的背景 */
.site,
#page,
.ast-container,
#content,
.site-content,
.content-area,
#primary,
#main,
.site-main,
.ast-separate-container,
.ast-article-post,
.ast-article-single,
.ast-woocommerce-container,
.ast-single-post,
.ast-archive-description {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
}

/* 确保文章和页面内容区域透明 */
article,
.page .entry-content,
.single .entry-content {
    background: transparent !important;
}

/* ========== Global Styles ========== */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    color: #333333;
    line-height: 1.6;
}

a {
    color: #003366;
    transition: color 0.3s ease;
}

a:hover {
    color: #333333;
}

/* 移除多余的边距 */
article {
    margin-top: 100px;
}

.woocommerce-products-header {
    display: none;
}

.entry-header {
    text-align: center;
}

/* 确保全宽布局 */
@media (min-width: 922px) {
    #primary {
        width: 100% !important;
    }
}

/* ========== Custom Header Styles ========== */
#custom-header {
    background: #f8f9fa !important;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 999;
    border-bottom: 2px solid #003366;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

/* Logo Styles - Enhanced Text Logo System */
.site-logo {
    margin: 0;
    font-size: 56px;
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 400;
    letter-spacing: 2px;
    text-transform: capitalize;
}

.site-logo a {
    color: #003366 !important;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    display: inline-block;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2), 4px 4px 8px rgba(0,0,0,0.1);
}

/* Logo Hover Effects */
.site-logo a:hover { text-shadow: 0 0 20px #003366, 0 0 30px #003366; }

/* Navigation Menu */
.nav-menu {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 45px;
}

.menu-item a {
    color: #666666 !important;
    text-decoration: none;
    font-size: 18px;
    font-family: 'Playfair Display', Georgia, serif;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    transition: all 0.3s ease;
    padding-bottom: 5px;
    border-bottom: 2px solid transparent;
}

.menu-item a:hover {
    color: #333333 !important;
    border-bottom-color: #003366;
}

/* Shopping Cart */
.cart-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #003366 !important;
    position: relative;
    transition: transform 0.3s ease;
}

.cart-link:hover {
    transform: scale(1.1);
    color: #003366 !important;
}

.cart-icon {
    font-size: 26px;
}

.cart-count {
    position: absolute;
    top: -10px;
    right: -10px;
    background: #003366;
    color: #000000 !important;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
}

/* ========== Homepage Styles ========== */
/* Banner Section - 修正为白色背景 */
.home-banner {
    margin-top: 30px;
    padding: 0;
    background: #ffffff !important;
    position: relative;
    overflow: hidden;
}

.home-banner .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
}

.banner-image {
    width: 100%;
    height: 400px;
    max-height: 400px;
    object-fit: cover;
    display: block;
    filter: brightness(0.9);
    transition: transform 0.5s ease;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.home-banner:hover .banner-image {
    transform: scale(1.02);
}

/* Product Categories Section - 产品区统一白色背景 */
.product-categories-section {
    padding: 80px 0;
    background: #ffffff !important;
}

.product-categories-section .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.category-section {
    margin-bottom: 100px;
}

.category-title {
    margin-bottom: 50px;
    font-size: 36px;
    text-align: center;
    position: relative;
    padding-bottom: 20px;
}

.category-title::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: #003366;
}

.category-title a {
    color: #333333 !important;
    text-decoration: none;
    font-weight: 200;
    letter-spacing: 2px;
    text-transform: uppercase;
    transition: color 0.3s ease;
}

.category-title a:hover {
    color: #003366 !important;
}

/* Products Grid - 产品卡片白色背景 */
.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 35px;
}

.product-item {
    text-align: center;
    background: #ffffff !important;
    border: 1px solid #e0e0e0 !important;
    padding: 25px;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.product-item::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #003366;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}

.product-item:hover {
    border-color: #003366 !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    transform: translateY(-5px);
}

.product-item:hover::before {
    transform: translateY(0);
}

.product-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    margin-bottom: 20px;
    transition: transform 0.3s ease;
}

.product-item:hover img {
    transform: scale(1.05);
}

.product-title {
    font-size: 18px;
    font-family: 'Merriweather', Georgia, serif;
    margin: 15px 0;
    color: #333333 !important;
    font-weight: 300;
    letter-spacing: 0.5px;
}

.product-price {
    font-size: 22px;
    color: #003366 !important;
    font-weight: 600;
    display: block;
    margin: 15px 0;
}

.product-price ins {
    color: #003366 !important;
    text-decoration: none;
}

.product-price del {
    color: #999999 !important;
    margin-right: 10px;
}

.product-item a {
    text-decoration: none;
}

/* WooCommerce按钮样式 */
.button.product_type_simple,
.button.add_to_cart_button,
.added_to_cart,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button {
    background: #003366 !important;
    color: #ffffff !important;
    padding: 12px 30px;
    border: none;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 2px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    margin-top: 10px;
    text-decoration: none;
    border-radius: 0;
}

.button.product_type_simple:hover,
.button.add_to_cart_button:hover,
.added_to_cart:hover,
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover {
    background: #333333 !important;
    color: #ffffff !important;
    transform: translateY(-2px);
}

.no-products {
    text-align: center;
    color: #666666;
    grid-column: 1 / -1;
    font-size: 16px;
    padding: 40px;
}

/* ========== WooCommerce商店页面样式 ========== */
.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product {
    background: #ffffff !important;
    border: 1px solid #e0e0e0 !important;
    padding: 20px;
    transition: all 0.3s ease;
}

.woocommerce ul.products li.product:hover,
.woocommerce-page ul.products li.product:hover {
    border-color: #003366 !important;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transform: translateY(-3px);
}

.woocommerce ul.products li.product .woocommerce-loop-product__title,
.woocommerce ul.products li.product .woocommerce-loop-category__title,
.woocommerce ul.products li.product h2,
.woocommerce ul.products li.product h3 {
    color: #333333 !important;
    font-size: 16px;
    font-weight: 300;
}

.woocommerce ul.products li.product .price {
    color: #003366 !important;
    font-size: 18px;
    font-weight: 600;
}

.woocommerce ul.products li.product .price ins {
    color: #003366 !important;
}

.woocommerce ul.products li.product .price del {
    color: #999999 !important;
}

/* ========== Custom Footer Styles - 修复版 ========== */
#custom-footer {
    background: #f8f9fa !important;
    margin-top: 60px;
    border-top: 3px solid #003366;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

.footer-container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
}

/* 页脚容器 - 第一层居中：相对屏幕居中 */
.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 内容区 - 第二层：三列内容在容器内居中 */
.footer-main {
    position: relative;
    height: 450px;
    border-bottom: 1px solid #e0e0e0;
    overflow: hidden;
    padding-top: max(10px, calc((450px - 280px) / 2));
    padding-bottom: max(10px, calc((450px - 280px) / 2));
    box-sizing: border-box;
}

/* 文字边界精确定位 - 直接控制文字到文字的距离 */
.footer-section {
    position: absolute;
    top: max(10px, calc((450px - 280px) / 2));
}

.footer-section:nth-child(1) {
    left: 160px; /* 第一列居中位置 */
}

.footer-section:nth-child(2) {
    left: 520px; /* 第二列居中位置 */
}

.footer-section:nth-child(3) {
    left: 820px; /* 第三列居中位置 */
}

/* 页脚列顺序控制 */
.footer-policies {
    grid-column: 1;
    order: 1;
}

.footer-info {
    grid-column: 3;
    order: 2;
}

.footer-contact {
    grid-column: 5;
    order: 3;
}

/* 页脚标题样式 - 确保对齐 */
.footer-section h4 {
    margin-bottom: 30px;
    color: #003366 !important;
    font-size: 14px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
    padding-bottom: 15px;
    line-height: 1.2;
}

.footer-section h4::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background: #003366;
}

/* 确保所有列从相同基线开始 */
.footer-section {
    align-self: start;
}

.footer-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-section li {
    margin-bottom: 15px;
}

.footer-section li:last-child {
    margin-bottom: 0;
}

.footer-section a {
    color: #808080 !important;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 400;
    position: relative;
}

.footer-section a:hover {
    color: #333333 !important;
    padding-left: 10px;
}

/* 联系信息样式 - 统一灰色 */
.contact-info p {
    margin-bottom: 15px;
    color: #808080 !important;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.8;
}

.contact-info p:last-child {
    margin-bottom: 0;
}

/* 版权区域 - 虚拟容器居中布局 */
.footer-bottom {
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

/* 版权内容虚拟容器 - 内容决定宽度，整体居中 */
.footer-bottom-inner {
    display: flex;
    align-items: center;
    gap: 80px;
}

.copyright p {
    margin: 0;
    color: #606060 !important;
    font-size: 14px;
    font-family: Georgia, 'Times New Roman', serif;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.payment-icons {
    display: flex;
    gap: 20px;
    align-items: center;
}

.payment-icons img {
    height: 32px;
    width: auto;
    opacity: 0.9;
    transition: all 0.3s ease;
}

.payment-icons img:hover {
    opacity: 1;
    transform: translateY(-3px) scale(1.1);
}

/* ========== 其他页面样式覆盖 ========== */
.woocommerce-products-header__title,
.page-title,
.entry-title {
    color: #333333 !important;
}

.woocommerce-breadcrumb {
    color: #808080 !important;
    margin-bottom: 30px;
}

.woocommerce-breadcrumb a {
    color: #003366 !important;
}

.woocommerce-pagination ul li a,
.pagination a {
    background: #f5f5f5 !important;
    color: #666666 !important;
    border: 1px solid #e0e0e0 !important;
}

.woocommerce-pagination ul li a:hover,
.pagination a:hover {
    background: #003366 !important;
    color: #ffffff !important;
    border-color: #003366 !important;
}

.woocommerce-pagination ul li span.current,
.pagination .current {
    background: #003366 !important;
    color: #ffffff !important;
    border: 1px solid #003366 !important;
}

.woocommerce-ordering select {
    background: #ffffff !important;
    color: #333333 !important;
    border: 1px solid #e0e0e0 !important;
    padding: 8px 15px;
}

.woocommerce-result-count {
    color: #666666 !important;
}

/* ========== Responsive Design ========== */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        height: auto;
        padding: 20px;
    }
    
    .site-logo {
        font-size: 24px;
        margin-bottom: 20px;
    }
    
    .nav-menu {
        flex-direction: column;
        gap: 15px;
        text-align: center;
        margin: 20px 0;
    }
    
    .banner-image {
        height: 250px;
        max-height: 250px;
    }
    
    .category-title {
        font-size: 28px;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .product-item {
        padding: 20px;
    }
    
    .footer-main {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .footer-policies,
    .footer-info,
    .footer-contact {
        padding-right: 0;
    }
    
    .footer-bottom {
        text-align: center;
    }
    
    .footer-bottom-inner {
        flex-direction: column;
        gap: 25px;
    }
    
    .payment-icons {
        justify-content: center;
    }
    
    .woocommerce ul.products li.product,
    .woocommerce-page ul.products li.product {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .site-logo {
        font-size: 20px;
    }
    
    .category-title {
        font-size: 24px;
    }
    
    .product-item img {
        height: 200px;
    }
    
    .woocommerce ul.products[class*=columns-] li.product,
    .woocommerce-page ul.products[class*=columns-] li.product {
        width: 100% !important;
        margin: 0 0 20px 0 !important;
    }
}