/* Shopping Cart UI - Minimal Styles */

/* 购物车组件内字体 */
.nav-cart-sidebar * { font-weight: 300 !important; }

/* Font Awesome */
.fas, .far, .fab, .fa {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands", "FontAwesome" !important;
    font-weight: 900 !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
}
.far, .fab { font-weight: 400 !important; }

/* 字体文件 - 使用项目中的Font Awesome路径 */
@font-face {
    font-family: "Font Awesome 6 Free";
    font-style: normal;
    font-weight: 900;
    font-display: block;
    src: url("../fontawesome/6.7.2/webfonts/fa-solid-900.woff2") format("woff2"),
         url("../fontawesome/6.7.2/webfonts/fa-solid-900.ttf") format("truetype");
}
@font-face {
    font-family: "Font Awesome 6 Free";
    font-style: normal;
    font-weight: 400;
    font-display: block;
    src: url("../fontawesome/6.7.2/webfonts/fa-regular-400.woff2") format("woff2"),
         url("../fontawesome/6.7.2/webfonts/fa-regular-400.ttf") format("truetype");
}

/* 购物车组件基础布局 */
.nav-cart-sidebar { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }
.nav-main-content { background-color: #ffffff; min-height: 100vh; }

/* 购物车侧栏 */
.nav-cart-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 50vw;
    height: 100vh;
    background-color: #ffffff;
    box-shadow: -2px 0 20px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    z-index: 1050;
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
}
.nav-cart-sidebar.nav-cart-sidebar-show { transform: translateX(0); }
.nav-cart-sidebar-hidden { transform: translateX(100%); }

/* 遮罩层 */
.nav-cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-in-out;
}
.nav-cart-overlay.nav-cart-overlay-show { opacity: 1; visibility: visible; }
/* 购物车弹出时防止页面滚动 - 使用更精确的方法 */
body.nav-cart-open { 
    overflow: hidden; 
    /* 保持滚动条空间，防止布局变化 */
    padding-right: var(--scrollbar-width, 0px);
}

/* 导航栏购物车徽章 - 独立样式 */
.navbar-cart-badge {
    width: 14px;
    height: 14px;
    background-color: #be7454;
    color: white;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 300; /* 纤细体：300 或 lighter */
    line-height: 14px;
    text-align: center;
    top: 10px;
    right: -1px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 14px;
    padding: 0;
}

/* 购物车内容 */
.nav-cart-content {
    background-color: #ffffff;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}
.nav-cart-items {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1rem;
}

/* 购物车头部 */
.nav-cart-header { border-bottom: 1px solid #f5f5f5; }
.nav-cart-header-content { display: flex; align-items: center; }
.nav-cart-title { font-size: 1.75rem; font-weight: 600; color: #2c3e50; letter-spacing: -0.5px; }
.nav-cart-badge {
    position: relative;
    display: inline-block;
    margin-left: 12px;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    min-width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #be7454 !important;
    border: none;
    vertical-align: middle;
}

/* 按钮样式 */
.nav-cart-toggle-btn, .nav-checkout-btn {
    background-color: rgb(42, 41, 47);
    border: none;
    font-weight: 600;
    height: 56px;
    border-radius: 0;
    transition: opacity 0.2s ease;
    color: white;
    padding: 0 2rem;
    font-size: 1rem;
}
.nav-cart-toggle-btn:hover, .nav-checkout-btn:hover { opacity: 0.8; }
.nav-cart-toggle-btn:active, .nav-checkout-btn:active { opacity: 0.7; }

.nav-continue-btn {
    /* 使用Bootstrap的btn-outline-dark样式，不覆盖 */
    height: 56px;
    border-radius: 0;
    transition: all 0.2s ease;
    font-weight: 600;
}

/* 购物车商品项 */
.nav-cart-item {
    background-color: transparent;
    transition: all 0.3s ease;
    border-radius: 0 !important;
    padding: 1rem 0 !important;
    border-bottom: 1px solid #f5f5f5;
}
.nav-product-image {
    width: 104px;
    height: 140px;
    flex-shrink: 0;
}
.nav-product-image img {
    border-radius: 0;
    border: none;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 商品详情区域 */
.nav-cart-detail {
    display: flex;
    flex-direction: column;
    height: 140px;
    overflow: hidden;
}
.nav-cart-link {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    min-height: 0;
}
.nav-cart-brandname {
    font-size: 0.9rem;
    font-weight: 300;
    color: #9D9D9D;
    margin-bottom: 0.25rem;
}
.nav-cart-name {
    font-size: 0.9rem;
    font-weight: 300;
    color: #000000;
    line-height: 1.4;
    margin-bottom: 0.25rem;
}
.nav-cart-color-size {
    font-size: 0.9rem;
    color: #000000;
    margin-bottom: 0.25rem;
}
.nav-cart-price {
    font-size: 1rem;
    font-weight: 300;
    color: #000000;
    line-height: 1.2;
    padding-bottom: 6px;
}

/* 数量选择和删除按钮 */
.nav-header-cart-update-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
.nav-order-num {
    width: 120px;
    padding: 4px 20px 4px 16px;
    font-size: 16px;
    line-height: 1.75;
    border: 1px solid rgb(42, 41, 47);
    border-radius: 0;
    background-color: #ffffff;
    color: rgb(42, 41, 47);
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232a292f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px;
}
.nav-order-num:focus { box-shadow: none; outline: none; }
.nav-order-num option:checked, .nav-order-num:focus, .nav-order-num:hover { background-color: #ffffff; color: #2a292f !important; }
.nav-delete-btn {
    color: #000000;
    text-decoration: underline !important;
    text-underline-offset: 9px;
    background: none;
    border: none;
    padding: 0;
}

/* 购物车底部 */
.nav-cart-footer {
    /* 保持Bootstrap的bg-light背景色 */
    border-top: 1px solid #f5f5f5 !important;
}
.nav-cart-total { border-bottom: none; }
.nav-total-label { font-weight: 300 !important; }
.nav-total-price { font-weight: 700 !important; }

/* 空购物车状态 */
.nav-empty-cart {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 300px;
    text-align: center;
    color: #9D9D9D;
}
.nav-empty-cart i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.1;
}
.nav-empty-cart h5 {
    font-size: 1.1rem;
    font-weight: 300;
    margin: 0;
}

/* 滚动条样式 */
.nav-cart-items::-webkit-scrollbar { width: 6px; }
.nav-cart-items::-webkit-scrollbar-track { background: #f1f1f1; }
.nav-cart-items::-webkit-scrollbar-thumb { background: #c1c1c1; border-radius: 3px; }
.nav-cart-items::-webkit-scrollbar-thumb:hover { background: #a8a8a8; }

/* 响应式设计 */
@media (max-width: 991.98px) {
    .nav-cart-sidebar { 
        width: 100vw; 
        /* 确保移动端购物车占满整个视口高度 */
        height: 100vh;
        height: 100dvh; /* 动态视口高度，支持现代浏览器 */
    }
    .nav-cart-title { font-size: 1.5rem; }
    .nav-cart-toggle-btn { padding: 0 1.5rem; font-size: 0.9rem; }
    
    /* 移动端购物车底部固定定位 */
    .nav-cart-footer {
        position: sticky;
        bottom: 0;
        background: #fff;
        border-top: 1px solid #dee2e6;
        /* 添加底部安全区域 */
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
        z-index: 10;
    }
}
@media (max-width: 575.98px) {
    .nav-cart-item { flex-direction: row; align-items: flex-start !important; }
    .nav-product-image { margin-right: 1rem !important; margin-bottom: 0 !important; }
    .nav-cart-detail { flex: 1; min-width: 0; }
    .nav-cart-brandname, .nav-cart-name, .nav-cart-color-size, .nav-cart-price {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .nav-product-actions { align-items: flex-start !important; flex-direction: row !important; gap: 1rem; }
    .nav-cart-total { flex-direction: row; align-items: center !important; justify-content: space-between !important; }
    .nav-total-price { font-size: 1.25rem; }
    
    /* 小屏幕设备底部按钮优化 */
    .nav-cart-actions {
        padding-bottom: 0.5rem;
    }
    .nav-cart-actions .btn {
        min-height: 48px; /* 确保按钮有足够的触摸区域 */
        font-size: 1rem;
    }
}

/* 移动端浏览器兼容性修复 */
@supports (height: 100dvh) {
    @media (max-width: 991.98px) {
        .nav-cart-sidebar {
            height: 100dvh; /* 使用动态视口高度 */
        }
    }
}

/* 针对Chrome移动端的特殊修复 */
@media screen and (max-width: 991.98px) and (-webkit-min-device-pixel-ratio: 1) {
    .nav-cart-sidebar {
        /* 确保在Chrome移动端正确显示 */
        min-height: 100vh;
        min-height: 100dvh;
    }
    
    .nav-cart-content {
        /* 确保内容区域可以滚动 */
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .nav-cart-footer {
        /* 确保底部按钮始终可见 */
        position: sticky;
        bottom: 0;
        background: #fff;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    }
}