/* ============================================
   购物车页面 - 惠果云风格
   ============================================ */

* { box-sizing: border-box; }

.cart-page {
    background: #f5f6f8;
    min-height: 100vh;
    padding: 150px 0 60px;
}
.cart-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 通用标签 */

/* ============================================
   一级导航
   ============================================ */
.cart-nav-level1 {
    margin-bottom: 16px;
}
.cart-nav-level1-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.cart-nav-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 14px 18px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    color: #4b5563;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.cart-nav-tab:hover {
    border-color: #3b82f6;
    color: #3b82f6;
    text-decoration: none;
}
.cart-nav-tab.active {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}
.cart-nav-tab.active:hover {
    color: #fff;
}
.cart-nav-tab-icon svg {
    display: block;
}
.cart-nav-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 10px;
}
.cart-nav-label-icon {
    color: #9ca3af;
}

/* ============================================
   二级导航
   ============================================ */
.cart-nav-level2 {
    margin-bottom: 16px;
}
.cart-nav-level2-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.cart-nav-level2-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    color: #4b5563;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.2s ease;
}
.cart-nav-level2-item:hover {
    border-color: #3b82f6;
    color: #3b82f6;
    text-decoration: none;
}
.cart-nav-level2-item.active {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}
.cart-nav-level2-item.active:hover {
    color: #fff;
}
.cart-nav-flag {
    width: 22px;
    height: 16px;
    object-fit: cover;
    border-radius: 2px;
    flex-shrink: 0;
}
.cart-nav-level2-name {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

/* ============================================
   当前区域说明
   ============================================ */
.cart-area-info {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-left: 3px solid #2563eb;
    border-radius: 6px;
    padding: 14px 18px;
    margin-bottom: 20px;
}
.cart-area-name {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 6px 0;
    line-height: 1.4;
}
.cart-area-desc {
    margin: 0;
    font-size: 13px;
    color: #6b7280;
    line-height: 1.6;
}

/* ============================================
   产品卡片网格
   ============================================ */
.cart-products-wrap {
    /* wrapper */
}
.cart-products {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

/* 产品卡片 */
.product-card {
    position: relative;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.product-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    border-color: #93c5fd;
}

/* 热销标签 */
.product-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 3px 10px;
    background: linear-gradient(135deg, #f97316, #ef4444);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    border-radius: 4px;
    z-index: 2;
}

/* 卡片头部 */
.product-card-head {
    margin-bottom: 16px;
}
.product-card-title {
    margin: 0 0 6px 0;
    font-size: 18px;
    font-weight: 700;
    color: #2563eb;
    line-height: 1.3;
}
.product-card-subtitle {
    margin: 0;
    font-size: 13px;
    color: #9ca3af;
    line-height: 1.5;
}

/* 规格区域 - 默认纯文本样式 */
.product-card-specs {
    flex: 1;
    padding: 12px 0;
    border-top: 1px solid #f3f4f6;
    border-bottom: 1px solid #f3f4f6;
    margin-bottom: 16px;
    font-size: 13px;
    line-height: 1.8;
    color: #6b7280;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow: hidden;
}
/* 规格区域 - 有 li 列表时的网格+图标样式 */
.product-card-specs.has-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 16px;
    white-space: normal;
}
.product-card-specs.has-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: contents;
}
.product-card-specs.has-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    line-height: 1.5;
    color: #6b7280;
}
.product-card-specs.has-list li .spec-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: #eff6ff;
    border-radius: 6px;
    flex-shrink: 0;
}
.product-card-specs.has-list li .spec-label {
    color: #9ca3af;
    font-size: 12px;
}
.product-card-specs.has-list li .spec-value {
    color: #374151;
    font-weight: 500;
}

/* 卡片底部 */
.product-card-foot {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 10px;
    align-content: flex-end;
}
.product-card-foot .product-price-box {
    order: 1;
}
.product-card-foot .product-trial-price {
    order: 2;
}
.product-card-foot .product-stock {
    order: 3;
}
.product-card-foot .product-buy-btn {
    order: 4;
}
.product-price-box {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 2px;
}
.product-price-symbol {
    font-size: 16px;
    font-weight: 700;
    color: #2563eb;
}
.product-price-num {
    font-size: 28px;
    font-weight: 800;
    color: #2563eb;
    line-height: 1;
}
.product-price-unit {
    font-size: 13px;
    color: #6b7280;
    margin-left: 2px;
}
.product-price-original {
    font-size: 12px;
    color: #9ca3af;
    text-decoration: line-through;
    margin-left: 6px;
}
.product-badge-trial {
    left: auto !important;
    right: 12px !important;
    background: linear-gradient(135deg, #10b981, #059669);
}
.product-trial-price {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    border-radius: 6px;
    margin-top: 6px;
    margin-bottom: 6px;
}
.product-trial-price .trial-label {
    font-size: 11px;
    font-weight: 600;
    color: #059669;
    background: #fff;
    padding: 1px 6px;
    border-radius: 3px;
}
.product-trial-price .trial-amount {
    font-size: 16px;
    font-weight: 700;
    color: #059669;
}
.product-trial-price .trial-unit {
    font-size: 12px;
    color: #10b981;
}
.product-stock {
    font-size: 12px;
    color: #f97316;
    background: #fff7ed;
    padding: 3px 8px;
    border-radius: 4px;
}
.product-buy-btn {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    padding: 8px 18px;
    background: #2563eb;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.2s ease;
    white-space: nowrap;
}
.product-buy-btn:hover {
    background: #1d4ed8;
    color: #fff;
    text-decoration: none;
}
.product-buy-btn-disabled {
    background: #d1d5db;
    color: #6b7280;
    cursor: not-allowed;
}
.product-buy-btn-disabled:hover {
    background: #d1d5db;
    color: #6b7280;
}

/* 空数据 */
.cart-no-data {
    grid-column: 1 / -1;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 60px 20px;
    text-align: center;
}
.cart-no-data img {
    width: 120px;
    opacity: 0.5;
    margin-bottom: 16px;
}
.cart-no-data p {
    color: #9ca3af;
    font-size: 14px;
    margin: 0;
}

/* ============================================
   配置页面兼容样式
   ============================================ */
.configoption_form {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 15px;
}
.card-back {
    background-color: #fff;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
}
.card-title-h4 {
    height: 56px;
    background: #f9fafb;
    border-bottom: 1px solid #f3f4f6;
}
.title-h4 {
    padding: 0 20px;
    color: #111827;
    line-height: 56px;
    font-weight: 700;
    font-size: 16px;
}
.configoption_total {
    padding: 16px 20px;
    background-color: #f9fafb;
}
table.table.mb-5.mt-2.ordersummary tr {
    border-bottom: 1px solid #f3f4f6;
    height: 40px;
    line-height: 40px;
    color: #6b7280;
}
.mobile-hide td.color-999 {
    color: #111827;
    font-size: 14px;
    font-weight: 600;
}
td.font-weight-bold.text-dark.text-right {
    font-size: 22px;
    font-weight: 700;
    color: #2563eb !important;
}
button#addToCartBtn {
    border-radius: 6px;
    font-size: 14px;
    height: 40px;
    line-height: 40px;
    padding: 0 28px;
    color: #fff;
    border: none;
    background: #2563eb;
    cursor: pointer;
    transition: background 0.2s ease;
}
button#addToCartBtn:hover {
    background: #1d4ed8;
}
.btn-primary:not(:disabled):not(.disabled).active,
.btn-primary:not(:disabled):not(.disabled):active,
.show > .btn-primary.dropdown-toggle,
.btn-custom-group .active {
    background: #2563eb !important;
    border-color: #2563eb !important;
    color: #fff !important;
}
.btn-primary {
    color: #495057;
    border-color: #e5e7eb;
    background: #f9fafb;
    border-radius: 6px;
}
.btn-group-sm > .btn, .btn-sm {
    padding: 6px 16px;
}
.cycle-select-discount {
    position: absolute;
    top: -10px;
    right: 0;
    display: inline-block;
    padding: 0 6px;
    height: 16px;
    background: #ef4444;
    border-radius: 4px;
    color: #fff;
    font-size: 11px;
    text-align: center;
    line-height: 16px;
}

/* ============================================
   配置页面 - 表单行布局修复
   ============================================ */

/* 表单行统一间距 */
.configoption_form .form-group,
.configoption_form .row.form-group,
.configoption_form .form-row {
    margin-bottom: 20px;
    align-items: center !important;
}

/* 标签列统一对齐 */
.configoption_form label.col-form-label,
.configoption_form .col-form-label {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    text-align: right;
    padding-right: 16px;
    line-height: 38px;
}

/* 控件列内容垂直居中 */
.configoption_form .form-group > div:last-child,
.configoption_form .form-row > div:last-child {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 38px;
}

/* ============================================
   配置页面 - 操作系统行修复（红框区域）
   ============================================ */

/* OS 行的两个下拉框容器 - flex 布局确保对齐 */
.configoption_form .form-group .col-sm-8,
.configoption_form .form-group .col-md-8,
.configoption_form .form-group .col-lg-8,
.configoption_form .form-group .col-sm-9,
.configoption_form .form-group .col-md-9,
.configoption_form .form-group .col-lg-9 {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

/* 下拉框组 - 统一高度和对齐 */
.configoption_form .btn-group,
.configoption_form .dropdown {
    display: inline-flex !important;
    align-items: center !important;
    height: 38px;
}

/* 下拉按钮统一高度 */
.configoption_form .btn-group .btn,
.configoption_form .dropdown .btn,
.configoption_form .btn-group-sm > .btn {
    height: 38px !important;
    line-height: 26px !important;
    padding: 5px 14px !important;
    font-size: 13px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px;
    border-radius: 6px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 第一个下拉框（OS类型）固定宽度 */
.configoption_form .form-group .btn-group:nth-child(1),
.configoption_form .form-group .dropdown:nth-child(1) {
    min-width: 120px;
    flex-shrink: 0;
}

/* 第二个下拉框（OS版本）自适应，确保文字不被截断 */
.configoption_form .form-group .btn-group:nth-child(2),
.configoption_form .form-group .dropdown:nth-child(2) {
    min-width: 180px;
    flex: 1 1 auto;
    max-width: 320px;
}

/* 下拉菜单文字不截断 */
.configoption_form .btn-group .btn .text,
.configoption_form .dropdown .btn .text,
.configoption_form .btn-group .btn span,
.configoption_form .dropdown .btn span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* OS 图标固定尺寸 */
.configoption_form .btn-group img,
.configoption_form .dropdown img {
    width: 18px;
    height: 18px;
    object-fit: contain;
    flex-shrink: 0;
}

/* 下拉菜单展开列表样式 */
.configoption_form .dropdown-menu {
    min-width: 200px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    padding: 4px 0;
}

.configoption_form .dropdown-item {
    padding: 8px 14px;
    font-size: 13px;
    color: #4b5563;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.configoption_form .dropdown-item:hover,
.configoption_form .dropdown-item:focus {
    background: #eff6ff;
    color: #2563eb;
}

/* ============================================
   配置页面 - 滑块行修复
   ============================================ */

/* 滑块容器布局 */
.configoption_form .form-group input[type="range"],
.configoption_form .form-group input[type="number"] {
    height: 38px;
}

/* 数值显示框与单位对齐 */
.configoption_form .input-group {
    display: inline-flex !important;
    align-items: center;
    height: 38px;
}

.configoption_form .input-group .form-control,
.configoption_form .input-group .input-group-text {
    height: 38px;
    line-height: 36px;
    font-size: 14px;
}

.configoption_form .input-group .input-group-text {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-left: none;
    color: #6b7280;
    font-size: 13px;
    font-weight: 500;
    padding: 0 12px;
}

.configoption_form .input-group .form-control {
    border-right: none;
    text-align: center;
    font-weight: 600;
    color: #2563eb;
}

/* ============================================
   配置页面 - 密码行修复
   ============================================ */

.configoption_form .input-group .input-group-append .btn {
    height: 38px;
    line-height: 26px;
    border: 1px solid #e5e7eb;
    border-left: none;
    background: #f9fafb;
    color: #6b7280;
    padding: 0 10px;
}

.configoption_form .input-group .input-group-append .btn:hover {
    background: #eff6ff;
    color: #2563eb;
}

/* ============================================
   配置页面 - 周期选择修复
   ============================================ */

.configoption_form .btn-group-toggle,
.configoption_form .btn-custom-group {
    display: inline-flex !important;
    gap: 0;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

.configoption_form .btn-group-toggle .btn,
.configoption_form .btn-custom-group .btn {
    border-radius: 0 !important;
    border: none !important;
    border-right: 1px solid #e5e7eb !important;
    height: 38px !important;
    line-height: 26px !important;
    padding: 5px 18px !important;
    font-size: 14px !important;
}

.configoption_form .btn-group-toggle .btn:last-child,
.configoption_form .btn-custom-group .btn:last-child {
    border-right: none !important;
}

/* ============================================
   配置页面 - 响应式
   ============================================ */
@media (max-width: 768px) {
    .configoption_form {
        margin: 15px auto;
        padding: 0 10px;
    }
    .configoption_form label.col-form-label,
    .configoption_form .col-form-label {
        text-align: left;
        padding-right: 0;
        line-height: 1.6;
        margin-bottom: 6px;
    }
    .configoption_form .form-group > div:last-child,
    .configoption_form .form-row > div:last-child {
        width: 100%;
    }
    .configoption_form .form-group .btn-group:nth-child(2),
    .configoption_form .form-group .dropdown:nth-child(2) {
        max-width: 100%;
    }
}

/* ============================================
   响应式
   ============================================ */
@media (max-width: 1024px) {
    .cart-products {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 768px) {
    .cart-page {
        padding: 100px 0 40px;
    }
    .cart-nav-level1-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 4px;
    }
    .cart-nav-level2-card {
        flex-wrap: nowrap;
        overflow-x: auto;
    }
    .cart-nav-tab {
        flex-shrink: 0;
        padding: 8px 14px;
        font-size: 13px;
    }
    .cart-products {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .product-card {
        padding: 16px;
    }
    .product-price-num {
        font-size: 24px;
    }
    .product-buy-btn {
        width: 100%;
        justify-content: center;
        margin-left: 0;
    }
    .product-card-foot {
        flex-direction: column;
        align-items: stretch;
    }
    .product-price-box {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .product-card-specs {
        font-size: 12px;
        line-height: 1.7;
    }
    .product-card-specs.has-list {
        grid-template-columns: 1fr;
    }
}