/* ============ 基础 ============ */
:root {
    --orange: #e8600a;
    --orange-dark: #d9550a;
    --red: #ff0000;
    --text: #222;
    --gray: #666;
    --light-gray: #999;
    --border: #e6e6e6;
    --border-dark: #c8c8c8;
    --serif: "Times New Roman", Georgia, serif;
}
.layui-layer{
    top: 35%!important;
}
* { box-sizing: border-box; }

html, body {
    color: var(--text);
    font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

ul { list-style: none; margin: 0; padding: 0; }

.page {
    width: 100%;
    padding: 40px 24px 80px;
}

.cart-wrap {
    max-width: 1200px;
    min-height: 60vh;
    margin: 0 auto;
    display: flex;
    align-items: flex-start;
    gap: 24px;
}
/* ============ 左侧主区域 ============ */
.cart-main {
    flex: 1 1 auto;
    min-width: 0;
}

.cart-title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: var(--orange);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    position: relative;
    padding-bottom: 10px;
}

.cart-title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 46px;
    height: 4px;
    border-radius: 2px;
    background: var(--orange);
}

.grid-icon {
    display: inline-grid;
    grid-template-columns: repeat(2, 5px);
    grid-auto-rows: 5px;
    gap: 3px;
}

.grid-icon i {
    width: 5px;
    height: 5px;
    border-radius: 1px;
    background: var(--orange);
}

/* 操作栏 */
.cart-toolbar {
    margin-top: 16px;
    display: flex;
    align-items: center;
}

.chk {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    font-size: 14px;
    color: var(--text);
    margin-right: 20px;
}

.chk input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.chk .box {
    width: 16px;
    height: 16px;
    border: 1px solid var(--border-dark);
    border-radius: 3px;
    background: #fff;
    position: relative;
    transition: background .15s, border-color .15s;
    flex: none;
}

.chk input:checked + .box {
    background: var(--orange);
    border-color: var(--orange);
}

.chk input:checked + .box::after {
    content: "✓";
    position: absolute;
    inset: 0;
    color: #fff;
    font-size: 12px;
    line-height: 15px;
    text-align: center;
    font-family: Arial, sans-serif;
}

.btn-ghost {
    border: 1px solid #EBEBEB;
    background: #fff;
    color: #1f1f1f;
    font-size: 13px;
    padding: 6px 18px;
    border-radius: 4px;
    cursor: pointer;
    transition: background .15s, color .15s;
}

.btn-ghost:hover { background: #f5f5f5; }

/* 商品列表 */
.cart-list {
    margin-top: 8px;
    border-top: 1px solid var(--border);

}

.cart-item {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 22px 4px;
    border-bottom: 1px solid var(--border);

}

.cart-item .thumb {
    width: 90px;
    height: 90px;
    border-radius: 6px;
    border: 1px solid var(--border);
    object-fit: cover;
    flex: none;
    background: #f4f6f8;
}

.item-info {
    flex: 1 1 auto;
    min-width: 0;
}

.item-info .name {
    margin: 0;
    font-size: 14px;
    color: var(--text);
    line-height: 1.5;
}

.item-info .spec {
    margin: 6px 0 0;
    font-size: 12px;
    color: #7a7a7a;
}

.price-unit {
    font-family: var(--serif);
    font-size: 20px;
    font-weight: 700;
    color: var(--orange);
    white-space: nowrap;
    flex: none;
}

.price-unit .cur { font-size: 15px;padding-right: 2px; }

/* 数量控制器 */
.stepper {
    display: inline-flex;
    align-items: stretch;
    border: 1px solid var(--border-dark);
    border-radius: 4px;
    overflow: hidden;
    height: 30px;
    flex: none;
}

.stepper button {
    width: 26px;
    height: 100%;
    border: none;
    background: #fff;
    color: #555;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.stepper button:hover { background: #f5f5f5; }

.stepper button:disabled {
    color: #d0d0d0;
    cursor: not-allowed;
}

.stepper .qty {
    width: 55px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    text-align: center;
    border-left: 1px solid var(--border-dark);
    border-right: 1px solid var(--border-dark);
    font-size: 14px;
    color: var(--text);
    background: #fff;
}
.qty[type="number"]::-webkit-outer-spin-button,
.qty[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.delete-link {
    font-size: 13px;
    color: #7a7a7a;
    cursor: pointer;
    flex: none;
    padding: 4px;
}

.delete-link:hover { color: var(--orange); }

/* 空购物车提示 */
.empty-tip {
    padding: 80px 0;
    text-align: center;
    color: var(--light-gray);
    font-size: 15px;
    border-bottom: 1px solid var(--border);
}

/* ============ 右侧结算明细 ============ */
.summary {
    flex: 0 0 320px;
    width: 320px;
    position: sticky;
    top: 100px;
}

.summary-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    background: #fff;
}

.summary-title {
    margin: 0 0 18px;
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}

.preview {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    min-height: 0;
    margin-bottom: 18px;
}

.preview img {
    width: 52px;
    height: 52px;
    border-radius: 5px;
    border: 1px solid var(--border);
    object-fit: cover;
    background: #f4f6f8;
}

.preview .empty {
    font-size: 13px;
    color: var(--light-gray);
    line-height: 52px;
}

.line {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text);
}

.line .value { color: var(--gray); }

.divider {
    height: 1px;
    background: var(--border);
    margin: 14px 0;
}

.line.total { align-items: flex-end; }

.line.total .label {
    font-weight: 700;
    font-size: 14px;
}

.line.total .sum {
    font-family: var(--serif);
    font-weight: 700;
    font-size: 26px;
    color: var(--red);
    line-height: 1;
}

.line.total .sum .cur { font-size: 16px; padding-right: 2px;}

.btn-checkout {
    width: 100%;
    margin-top: 20px;
    height: 44px;
    border: none;
    border-radius: 22px;
    background: var(--orange);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: background .15s;
}

.btn-checkout:hover { background: var(--orange-dark); }

.btn-checkout:disabled { background: #f0c9ac; cursor: not-allowed; }
.summary-input{
    display: flex;
    display: -webkit-flex;
    align-items: center;
    margin-bottom: 15px;
}
.summary-input>span{
    width: 20px;
    text-align: center;
    font-size: 15px;
    color: #ff0000;
}
.summary-input>input{
    width: 100%;
    height: 35px;
    box-sizing: border-box;
    border: 1px solid #e6e6e6;
    outline: none;
    font-size: 13px;
    padding-left: 13px;
}
.summary-input>textarea{
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #e6e6e6;
    outline: none;
    font-size: 13px;
    padding: 13px;
}