/* Checkout Page - Optimized Styles */

/* 结算页面专用字体 - 限制作用域 */
.checkout-page * { font-weight: 300; }

/* Font Awesome */
.fas, .far, .fab, .fa {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands", "FontAwesome";
    font-weight: 900;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
.far, .fab { font-weight: 400; }

/* 字体文件 */
@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");
}

/* 基础布局 - 限制作用域 */
.checkout-page { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }

/* 页面头部 */
.nav-checkout-title { 
    font-size: 1.75rem; 
    font-weight: 600; 
    color: #2c3e50; 
    letter-spacing: -0.5px; 
}

/* 购物车商品项 */
.nav-cart-item {
    background-color: transparent;
    transition: all 0.3s ease;
    border-radius: 0;
    padding: 1rem 0;
    border-bottom: 1px solid #f5f5f5;
}

.nav-product-image {
    width: 104px;
    height: 140px;
    flex-shrink: 0;
}

.nav-product-image img {
    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;
    color: #9D9D9D;
    margin-bottom: 0.25rem;
}

.nav-cart-name,
.nav-cart-color-size {
    font-size: 0.9rem;
    color: #000;
    margin-bottom: 0.25rem;
}

.nav-cart-name {
    line-height: 1.4;
}

.nav-cart-price {
    font-size: 1rem;
    color: #000;
    line-height: 1.2;
}

/* 数量选择和删除按钮 */
.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 #2a292f;
    border-radius: 0;
    background-color: #fff;
    color: #2a292f;
    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: #fff; 
    color: #2a292f; 
}

.nav-delete-btn {
    color: #9D9D9D;
    text-decoration: underline;
    text-underline-offset: 9px;
    background: none;
    border: none;
    padding: 0;
    font-size: 0.8rem;
}

/* 礼品包装选项 - Bootstrap折叠组件样式 */
.nav-gift-packaging {
    background-color: #f5f5f5;
    border: none;
    height: 86px;
    border-radius: 0;
    box-shadow: none;
}

.nav-gift-packaging:focus,
.nav-gift-packaging:not(.collapsed),
.nav-gift-packaging:hover,
.nav-gift-packaging:active {
    background-color: #f5f5f5;
    box-shadow: none;
}

/* 隐藏默认的折叠箭头 */
.nav-gift-packaging::after {
    display: none;
}

/* 添加自定义加号图标 */
.nav-gift-packaging::before {
    content: '';
    display: inline-block;
    width: 25px;
    height: 25px;
    background-image: url("data:image/svg+xml,%3Csvg clip-rule='evenodd' fill-rule='evenodd' stroke-linejoin='round' stroke-miterlimit='2' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m11 11h-7.25c-.414 0-.75.336-.75.75s.336.75.75.75h7.25v7.25c0 .414.336.75.75.75s.75-.336.75-.75v-7.25h7.25c.414 0 .75-.336.75-.75s-.336-.75-.75-.75h-7.25v-7.25c0-.414-.336-.75-.75-.75s-.75.336-.75.75z' fill-rule='nonzero' fill='%231a1a1a'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    transition: transform 0.3s ease;
}

/* 展开状态时旋转加号 */
.nav-gift-packaging:not(.collapsed)::before {
    transform: translateY(-50%) rotate(45deg);
}
.nav-gift-text {
    font-size: 20px;
    color: #000;
    letter-spacing: 0.08em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.nav-gift-image {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
}
.nav-gift-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
}

/* 礼品包装折叠组件整体样式 */
#giftPackagingAccordion .accordion-item,
#giftPackagingAccordion .accordion-button,
#giftPackagingAccordion .accordion-collapse {
    border-radius: 0;
}

#giftPackagingAccordion .accordion-item {
    border: none;
}

#giftPackagingAccordion .accordion-collapse {
    background-color: #f5f5f5;
}

/* 礼品包装选项样式 */
.nav-gift-option {
    border-radius: 0;
    background-color: white;
}

.nav-gift-option-image {
    flex-shrink: 0;
    width: auto;
    height: 80px;
}

.nav-gift-option-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.nav-gift-option h6 {
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.nav-gift-option p {
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}

/* 添加到购物车按钮样式 */
.nav-gift-option .btn-dark {
    width: 280px;
    height: 45px;
    border-radius: 0;
    font-size: 0.9rem;
    font-weight: 300 !important;
}

/* 礼品包装商品的下拉框禁用样式 */
.nav-order-num:disabled {
    background-color: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
    opacity: 0.7;
}

/* 订单摘要 */
.nav-order-summary {
    position: sticky;
    top: 2rem;
    border: 1px solid #d9d9d9;
    border-radius: 0;
}

.nav-order-total {
    border-bottom: 1px solid #f5f5f5;
    padding-bottom: 1rem;
}

.nav-total-label { 
    font-size: 24px;
}

.nav-total-price { 
    font-weight: 700; 
    font-size: 1.25rem; 
}

/* 价格明细 */
.nav-breakdown-label,
.nav-breakdown-value {
    font-size: 0.9rem;
    color: #000;
}

/* 说明文字 */
.nav-note {
    font-size: 0.9rem;
    color: #9D9D9D;
}

/* 区块标题 */
.nav-section-title {
    font-size: 24px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 1rem;
}

/* 会员客户区块 */
.nav-member-section {
    margin-top: 50px;
}

/* 表单控件 */
.form-control {
    border-radius: 0;
    border: 1px solid #dee2e6;
    font-size: 0.9rem;
    padding: 0.75rem;
    height: 55px;
}

.form-control:focus {
    border-color: #2a292f;
    box-shadow: 0 0 0 0.2rem rgba(42, 41, 47, 0.25);
}

/* 链接样式 */
.nav-link-text {
    font-size: 0.8rem;
    color: #555;
    text-decoration: none;
}

.nav-link-text:hover {
    color: #333;
    text-decoration: underline;
}

/* 按钮样式 */
.nav-login-btn, 
.nav-register-btn {
    background-color: #2a292f;
    border: none;
    color: white;
    font-weight: 300 !important;
    height: 60px;
    border-radius: 0;
    transition: opacity 0.2s ease;
}

.nav-login-btn:hover, 
.nav-register-btn:hover {
    background-color: #2a292f;
    opacity: 0.8;
    color: white;
}

.nav-guest-btn {
    border: 1px solid #2a292f;
    background-color: #fff;
    color: #2a292f;
    font-weight: 300 !important;
    height: 60px;
    border-radius: 0;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.nav-guest-btn:hover {
    background-color: #2a292f;
    color: white;
}

/* 响应式设计 */
@media (max-width: 991.98px) {
    .nav-checkout-title { 
        font-size: 1.5rem; 
    }
    .nav-order-summary { 
        position: static; 
        margin-top: 2rem; 
    }
}

@media (max-width: 575.98px) {
    .nav-cart-item { 
        flex-direction: row; 
        align-items: flex-start; 
    }
    .nav-product-image { 
        margin-right: 1rem; 
        margin-bottom: 0; 
    }
    .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-gift-packaging { 
        flex-direction: column; 
        align-items: flex-start; 
    }
    .nav-gift-icons { 
        margin-bottom: 0.5rem; 
    }
}
