/* 导入基础样式变量 */
:root {
    --primary-color: #c09578 !important;
    --secondary-color: #0a0a0a;
    --text-primary: #333333;
    --text-secondary: #666666;
    --border-color: #c09578!important;
    --background-color: #f8f8f8;
}

/* 基础响应式设置 */
* {
    box-sizing: border-box;
    transition: all 0.3s ease;
}

/* 导航栏响应式调整 */
.navbar {
    padding: 1.5rem 1rem;
}

/* 移动端导航菜单 */
@media (max-width: 991.98px) {
    .navbar-collapse {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: var(--background-color);
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        z-index: 1050;
        padding: 1rem;
    }
    
    .navbar-nav {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .nav-item {
        padding: 0.25rem 0;
    }
}

/* 响应式字体大小系统 */
html {
    font-size: 16px;
}

@media (max-width: 1400px) { html { font-size: 15px; } }
@media (max-width: 1200px) { html { font-size: 14px; } }
@media (max-width: 992px) { html { font-size: 13px; } }
@media (max-width: 768px) { html { font-size: 12px; } }
@media (max-width: 576px) { html { font-size: 11px; } }

/* 响应式容器 */
.container {
    width: 100%;
    padding-right: var(--bs-gutter-x, 0.75rem);
    padding-left: var(--bs-gutter-x, 0.75rem);
    margin-right: auto;
    margin-left: auto;
}

@media (min-width: 576px) { .container { max-width: 540px; } }
@media (min-width: 768px) { .container { max-width: 720px; } }
@media (min-width: 992px) { .container { max-width: 960px; } }
@media (min-width: 1200px) { .container { max-width: 1140px; } }
@media (min-width: 1400px) { .container { max-width: 1320px; } }
@media (min-width: 1920px) { .container { max-width: 1600px; } }

/* 响应式间距调整 */
.section-padding {
    padding: 3rem 0;
}

@media (max-width: 992px) { .section-padding { padding: 2.5rem 0; } }
@media (max-width: 768px) { .section-padding { padding: 2rem 0; } }
@media (max-width: 576px) { .section-padding { padding: 1.5rem 0; } }

/* 产品列表响应式布局 */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

@media (max-width: 992px) { .product-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1.25rem; } }
@media (max-width: 768px) { .product-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1rem; } }
@media (max-width: 576px) { .product-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.75rem; } }

/* 导航项响应式显示 */
.nav-desktop-only {
    display: flex;
}

.nav-mobile-only {
    display: none;
}

@media (max-width: 991.98px) {
    .nav-desktop-only { display: none; }
    .nav-mobile-only { display: flex; }
}

/* 按钮响应式调整 */
.btn {
    padding: 0.5rem 1rem;
    font-size: 1rem;
}

@media (max-width: 576px) {
    .btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }
    
    .btn-lg {
        padding: 0.5rem 1rem;
        font-size: 1rem;
    }
}

/* 图片响应式处理 */
.responsive-img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* 页脚响应式调整 */
.footer-columns {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

@media (max-width: 992px) { .footer-columns { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 576px) { .footer-columns { grid-template-columns: 1fr; } }

/* 响应式表格 */
.responsive-table {
    width: 100%;
    overflow-x: auto;
}

/* 评价区域响应式调整 */
.comment-container {
    padding: 1.5rem;
}
.blog-list-img{
    height: 200px;
    object-fit: cover;
}

@media (max-width: 768px) {
    .comment-container {
        padding: 1rem;
    }
    
    .rating-stars {
        font-size: 1.2rem;
    }
}

/* 购物车预览响应式调整 */
@media (max-width: 576px) {
    .cart-preview-container {
        width: 100vw;
        left: 0;
        right: 0;
    }
}

/* 确保内容在小屏幕上不溢出 */
body {
    overflow-x: hidden;
}

/* 导航栏滚动效果 */
@media (min-width: 992px) {
    .navbar-scroll {
        transition: background-color 0.3s, padding 0.3s;
    }
    
    .navbar-scroll.scrolled {
        background-color: rgba(255, 255, 255, 0.95);
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    }
}

/* 搜索框响应式调整 */
.search-container {
    max-width: 500px;
}

@media (max-width: 768px) {
    .search-container {
        max-width: 100%;
        margin-bottom: 1rem;
    }
    .cart-hover-container{
        display: none;
    }
}





/* 移动端导航样式 */
@media (max-width: 991.98px) {
    #mobileNavbar {
        transition: all 0.3s ease;
    }

    .mobile-menu {
        position: fixed;
        top: 0;
        right: 0;
        height: 100vh;
        width: 85%;
        max-width: 300px;
        background-color: white;
        z-index: 1055;
        transform: translateX(100%);
        /* 添加 opacity 和 visibility */
        opacity: 0;
        visibility: hidden;
        transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out, visibility 0s ease-in-out 0.3s;
        box-shadow: -2px 0 10px rgba(0,0,0,0.1);
    }

    .mobile-menu.show {
        transform: translateX(0);
        /* 修改为显示状态 */
        opacity: 1;
        visibility: visible;
        transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
    }

    .mobile-menu .nav-link {
        color: var(--text-primary);
        border-bottom: 1px solid #f0f0f0;
    }

    .mobile-menu .nav-link:hover {
        background-color: #f8f8f8;
    }

    .mobile-cart-icon {
        position: fixed;
        bottom: 30px;
        right: 30px;
        width: 60px;
        height: 60px;
        background-color: var(--primary-color);
        color: white;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.5rem;
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
        z-index: 1000;
        text-decoration: none;
    }

    .mobile-cart-icon .badge {
        position: absolute;
        top: 11px;
        right: -5px;
        font-size: 0.8rem;
        padding: 3px 7px;
    }
}



@media (max-width: 768px) {
    .product-card .card-icons {
        display: none !important;
    }
    .product-list-filter{
        display: none !important;
    }
    .my-nav{
        display: none !important;
    }
    .my-order{
        display: none !important;
    }
    .product-card .card-img-top {
        height: 200px !important;
        object-fit: cover;
    }
    .product-zoom-btn{
        display: none !important;
    }
}



/* 订单页面移动端兼容样式 */
@media (max-width: 991.98px) {
    /* 中等屏幕和小屏幕 */
    .order-container {
        padding: 0 15px;
    }
    .order-header {
        padding: 12px 15px;
        /* 保持状态标签靠右显示 */
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
    }
    .order-item {
        padding: 12px;
    }
    .status-badge {
        font-size: 0.75rem;
        padding: 4px 10px;
    }
}

@media (max-width: 767.98px) {
    /* 小屏幕 */
    .my-order h2 {
        font-size: 1.5rem;
    }
    .order-header {
        /* 强制状态标签靠右显示 */
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        gap: 8px;
    }

    .product-img {
        width: 60px;
        height: 60px;
        flex-shrink: 0;
    }
    /* 文字超出显示省略号 */
    .product-title {
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        -webkit-line-clamp: 1 !important;
        display: block !important;
    }
    .captcha-image{
        height: 32px !important;
    }
}

@media (max-width: 575.98px) {
    /* 超小屏幕 */
    .my-order h2 {
        font-size: 1.3rem;
    }
    .order-card {
        margin-bottom: 15px;
        border-radius: 6px;
    }
    .order-header {
        padding: 10px;
        /* 强制状态标签靠右显示 */
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        flex-wrap: wrap;
    }
    .order-item {
        padding: 10px;
        border-left: 3px solid var(--primary-color);
    }
    .status-badge {
        font-size: 0.7rem;
        padding: 3px 8px;
    }
    .card-footer {
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }
    .card-footer > div {
        width: 100%;
        text-align: center;
    }
    .card-footer button {
        width: 100%;
        margin: 5px 0 !important;
    }
    .product-img {
        width: 50px;
        height: 50px;
        flex-shrink: 0;
    }

    
    /* 文字超出显示省略号 */
    .product-title {
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        -webkit-line-clamp: 1 !important;
        display: block !important;
    }
    .product-list .detail-btn{
        display: none !important;
    }

    /* 移动端购物车样式 */
    .mobile-cart-row {
        margin-bottom: 0.5rem;
    }
    
    .cart-item .input-group {
        justify-content: flex-end;
    }
    
    .cart-item .input-group .form-control {
        max-width: 60px;
    }

    .cart-item .row {
        align-items: center;
    }
    
    .cart-item .col-md-12 {
        margin-top: 0;
    }
    .pay-text{
        font-size: 12px;
    }
    .blog-right{
        display: none !important;
    }
    .blog-list-box{
        height: auto !important;
    }
    .comment-container .product-header h5{
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2; /* 限制为2行 */
        overflow: hidden;
        width:200px;
    }
    .mobile-order-text{
        padding-left:2.5rem;
    }
    .pc-recommend-products{
        display: none !important;
    }
    .mobile-recommend-products{
        display: block !important;
    }
    .blog-list-img{
        height: auto !important;
        weight:100% !important;
    }

}


    