/* 
 * Footer Bootstrap Grid Layout Fix
 * 修复页脚Bootstrap网格布局问题
 */

/* 确保容器和行的基本样式 */
.footer .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.footer .row {
    display: flex;
    flex-wrap: wrap;
    margin-left: -15px;
    margin-right: -15px;
    width: 100%;
}

/* 确保所有列都有正确的内边距 */
.footer .row > [class*="col-"] {
    padding-left: 15px;
    padding-right: 15px;
    box-sizing: border-box;
}

/* 修复列的基本布局 */
.footer .col-lg-4 {
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
}

.footer .col-lg-2 {
    flex: 0 0 16.666667%;
    max-width: 16.666667%;
}

/* 中等屏幕 (768px 及以上) */
@media (min-width: 768px) and (max-width: 991.98px) {
    .footer .col-md-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
    
    /* 确保第三和第四列在md屏幕上换行 */
    .footer .row > .col-lg-2:nth-child(3) {
        margin-top: 2rem;
    }
    
    .footer .row > .col-lg-4:last-child {
        margin-top: 2rem;
    }
}

/* 小屏幕 (576px 及以上) */
@media (min-width: 576px) and (max-width: 767.98px) {
    .footer .col-sm-12 {
        flex: 0 0 100%;
        max-width: 100%;
        margin-bottom: 2rem;
    }
    
    .footer .col-sm-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
    
    .footer .col-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

/* 超小屏幕 (小于576px) */
@media (max-width: 575.98px) {
    .footer .row > [class*="col-"] {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    /* 在小屏幕上，服务项目和关于我们并排显示 */
    .footer .col-6 {
        flex: 0 0 50%;
        max-width: 50%;
        margin-bottom: 1.5rem;
    }
}

/* 页脚内容对齐修复 */
.footer-brand,
.footer-links,
.footer-contact {
    text-align: left; /* 确保内容左对齐，而不是居中 */
}

/* 微信二维码网格布局修复 */
.wechat-qr-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 1.5rem;
}

.qr-item {
    text-align: center;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.qr-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.qr-image-container {
    position: relative;
    margin-bottom: 0.5rem;
}

.qr-image {
    border-radius: 6px;
    object-fit: cover;
}

.qr-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.qr-item:hover .qr-overlay {
    opacity: 1;
}

.qr-overlay i {
    color: #fff;
    font-size: 1.2rem;
}

.qr-title {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    font-weight: 500;
}

/* 响应式二维码布局 */
@media (max-width: 768px) {
    .wechat-qr-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.75rem;
    }
    
    
    .qr-title {
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    .wechat-qr-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }
    
    .qr-item {
        padding: 0.5rem;
    }
    

    
    .qr-title {
        font-size: 0.65rem;
    }
}

/* 页脚链接样式优化 */
.footer-links h6,
.footer-contact h6 {
    color: #fff;
    font-weight: 600;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.footer-links ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.footer-links a:hover {
    color: #fff;
    padding-left: 0.25rem;
}

/* 联系信息样式 */
.contact-info > div {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
}

.contact-info i {
    color: var(--color-primary, #d4af37);
    width: 20px;
    text-align: center;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

/* 确保页脚在所有设备上都能正确显示 */
.footer {
    background-color: #1a1a1a;
    color: #fff;
    padding: 3rem 0 1rem;
}

/* 法律信息和版权信息的样式 */
.footer__legal,
.footer__bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
}

.footer__legal p,
.footer__bottom p {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.footer__bottom a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer__bottom a:hover {
    color: #fff;
}

/* 调试样式 - 可以临时启用来检查布局 */
/*
.footer .row {
    border: 2px solid red;
}

.footer .row > [class*="col-"] {
    border: 1px solid yellow;
    min-height: 100px;
}
*/
