/**
 * 购物车页 — 对齐 demo/src/app/pages/CartPage.tsx
 * template/pc/demo/home/store/cart.html
 */

.demo-store-cart {
    position: relative;
    width: 100%;
    min-height: 60vh;
    background: #f8fafc;
    color: #0f172a;
    box-sizing: border-box;
}

.demo-store-cart--fullbleed {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

.demo-store-cart__main {
    max-width: 1280px;
    margin: 0 auto;
    padding: 112px 16px 96px;
    box-sizing: border-box;
}

@media (min-width: 768px) {
    .demo-store-cart__main {
        padding-left: 24px;
        padding-right: 24px;
    }
}

/* 面包屑 */
.demo-store-cart__crumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 14px;
    color: #64748b;
    margin-bottom: 24px;
}

.demo-store-cart__crumb a {
    color: #64748b;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s;
}

.demo-store-cart__crumb a:hover {
    color: #2563eb;
}

.demo-store-cart__crumb-sep {
    font-size: 12px;
    color: #cbd5e1;
}

.demo-store-cart__crumb-current {
    color: #1e293b;
    font-weight: 500;
}

/* 表格卡片 */
.demo-store-cart__card {
    background: #fff;
    border-radius: 24px;
    border: 1px solid #f1f5f9;
    box-shadow: 0 8px 40px -12px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

.demo-store-cart__scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.demo-store-cart__grid {
    min-width: 860px;
}

/* 表头 */
.demo-store-cart__thead {
    display: grid;
    grid-template-columns:
        40px
        96px
        minmax(160px, 2.2fr)
        minmax(100px, 1fr)
        minmax(120px, 1fr)
        minmax(110px, 1fr)
        minmax(72px, 0.8fr);
    gap: 16px;
    align-items: center;
    padding: 20px 32px;
    border-bottom: 1px solid #f1f5f9;
    background: rgba(248, 250, 252, 0.5);
    font-size: 14px;
    font-weight: 700;
    color: #475569;
}

.demo-store-cart__thead > div:nth-child(4),
.demo-store-cart__thead > div:nth-child(6) {
    text-align: right;
}

.demo-store-cart__thead > div:nth-child(5) {
    text-align: center;
}

.demo-store-cart__thead > div:nth-child(7) {
    text-align: center;
}

/* 行 */
.demo-store-cart__row {
    display: grid;
    grid-template-columns:
        40px
        96px
        minmax(160px, 2.2fr)
        minmax(100px, 1fr)
        minmax(120px, 1fr)
        minmax(110px, 1fr)
        minmax(72px, 0.8fr);
    gap: 16px;
    align-items: center;
    padding: 24px 32px;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.2s;
}

.demo-store-cart__row:last-child {
    border-bottom: none;
}

.demo-store-cart__row:hover {
    background: rgba(248, 250, 252, 0.5);
}

.demo-store-cart__row > div:nth-child(4),
.demo-store-cart__row > div:nth-child(6) {
    text-align: right;
}

.demo-store-cart__row > div:nth-child(5) {
    display: flex;
    justify-content: center;
}

.demo-store-cart__row > div:nth-child(7) {
    text-align: center;
}

/* 缩略图 */
.demo-store-cart__thumb {
    display: block;
    width: 80px;
    height: 80px;
    border-radius: 16px;
    overflow: hidden;
    background: #f1f5f9;
    border: 1px solid #f1f5f9;
}

.demo-store-cart__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 标题与规格 */
.demo-store-cart__title {
    margin: 0 0 6px;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.4;
}

.demo-store-cart__title a {
    color: #2563eb;
    text-decoration: none;
    transition: color 0.2s;
}

.demo-store-cart__title a:hover {
    color: #1d4ed8;
}

.demo-store-cart__specs {
    font-size: 13px;
    color: #64748b;
    line-height: 1.5;
}

.demo-store-cart__specs small {
    display: block;
}

/* 单价 / 行总价 */
.demo-store-cart__price-unit,
.demo-store-cart__price-line {
    font-weight: 500;
    color: #ef4444;
}

.demo-store-cart__price-line {
    font-size: 16px;
    font-weight: 700;
}

.demo-store-cart__price-unit p,
.demo-store-cart__pyuan {
    margin: 0;
    font-size: 13px;
    color: #64748b;
}

.demo-store-cart__pyuan span {
    text-decoration: line-through;
}

/* 数量：TouchSpin 圆角输入 */
.demo-store-cart__qty .bootstrap-touchspin {
    display: flex !important;
    align-items: stretch;
    width: auto;
    max-width: 120px;
    height: 36px;
    margin: 0 auto;
    border: 1px solid #e2e8f0;
    border-radius: 9999px;
    overflow: hidden;
    background: #fff;
}

/* 数量步进器（不依赖 touchspin 插件） */
.demo-store-cart__qty-stepper {
    display: inline-flex;
    align-items: center;
    width: 120px;
    height: 36px;
    margin: 0 auto;
    border: 1px solid #e2e8f0;
    border-radius: 9999px;
    overflow: hidden;
    background: #fff;
}

.demo-store-cart__qty-step {
    width: 32px;
    min-width: 32px;
    height: 100%;
    border: none;
    background: transparent;
    color: #94a3b8;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.demo-store-cart__qty-step:hover {
    background: #f8fafc;
    color: #475569;
}

.demo-store-cart__qty-stepper .dr_buy_num {
    flex: 1;
    min-width: 0;
    height: 34px;
    margin: 0;
    padding: 0 8px;
    border: none;
    background: transparent;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    color: #1e293b;
    outline: none;
}

.demo-store-cart__qty .bootstrap-touchspin .form-control,
.demo-store-cart__qty .bootstrap-touchspin input.dr_buy_num {
    flex: 1;
    min-width: 0;
    height: 34px !important;
    margin: 0 !important;
    padding: 0 8px !important;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    color: #1e293b;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
}

.demo-store-cart__qty .bootstrap-touchspin .input-group-btn {
    display: flex;
}

.demo-store-cart__qty .bootstrap-touchspin .demo-store-cart__qty-btn {
    width: 32px;
    min-width: 32px;
    height: 100%;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: #94a3b8 !important;
    font-size: 14px;
    line-height: 34px;
    box-shadow: none !important;
}

.demo-store-cart__qty .bootstrap-touchspin .demo-store-cart__qty-btn:hover {
    background: #f8fafc !important;
    color: #475569 !important;
}

/* 删除链接 */
.demo-store-cart__del {
    font-size: 14px;
    font-weight: 500;
    color: #3b82f6;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    text-decoration: none;
}

.demo-store-cart__del:hover {
    color: #2563eb;
}

/* 自定义圆角复选框（保留原生 input 供表单提交） */
.demo-store-cart__cb {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    cursor: pointer;
    margin: 0;
}

.demo-store-cart__cb-input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
    z-index: 2;
}

.demo-store-cart__cb-face {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #cbd5e1;
    background: #fff;
    transition: border-color 0.2s, background 0.2s;
    pointer-events: none;
}

.demo-store-cart__cb-face .fa-check {
    font-size: 10px;
    color: #fff;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.15s;
}

.demo-store-cart__cb-input:checked + .demo-store-cart__cb-face {
    background: #2563eb;
    border-color: #2563eb;
}

.demo-store-cart__cb-input:checked + .demo-store-cart__cb-face .fa-check {
    opacity: 1;
}

.demo-store-cart__cb:hover .demo-store-cart__cb-input:not(:checked) + .demo-store-cart__cb-face {
    border-color: #60a5fa;
}

/* 底部操作条 */
.demo-store-cart__footer {
    margin-top: 24px;
    padding: 16px 32px;
    background: #fff;
    border-radius: 24px;
    border: 1px solid #f1f5f9;
    box-shadow: 0 8px 40px -12px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    position: sticky;
    bottom: 24px;
    z-index: 40;
}

.demo-store-cart__footer-left {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 24px;
}

.demo-store-cart__footer-right {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 24px;
}

.demo-store-cart__footer-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #64748b;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: color 0.2s;
}

.demo-store-cart__footer-link:hover {
    color: #0f172a;
}

.demo-store-cart__footer-total {
    font-size: 14px;
    color: #475569;
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px;
}

.demo-store-cart__footer-total strong {
    font-size: 24px;
    font-weight: 900;
    color: #ef4444;
    letter-spacing: -0.02em;
}

.demo-store-cart__btn-checkout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 46px;
    padding: 0 32px;
    border-radius: 9999px;
    border: none;
    background: #2563eb;
    color: #fff !important;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 14px -4px rgba(37, 99, 235, 0.5);
    transition: background 0.2s, opacity 0.2s;
}

.demo-store-cart__btn-checkout:hover:not(:disabled) {
    background: #1d4ed8;
}

.demo-store-cart__btn-checkout:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
}

/* 空状态 */
.demo-store-cart__empty {
    background: #fff;
    border-radius: 24px;
    border: 1px solid #f1f5f9;
    box-shadow: 0 8px 40px -12px rgba(0, 0, 0, 0.04);
    padding: 64px 24px;
    text-align: center;
}

.demo-store-cart__empty-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    border-radius: 20px;
    background: #eff6ff;
    color: #3b82f6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
}

.demo-store-cart__empty h2 {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
}

.demo-store-cart__empty p {
    margin: 0 0 24px;
    font-size: 14px;
    color: #64748b;
}

.demo-store-cart__empty a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 9999px;
    background: #2563eb;
    color: #fff !important;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s;
}

.demo-store-cart__empty a:hover {
    background: #1d4ed8;
}
