/**
 * Printing Page Styles
 * Template: page-printing.php
 */

/* ── 步骤进度条（核心样式） ── */
.print-steps { position: relative; }
.print-steps-track {
    position: absolute; top: 38px; left: calc(10% + 11px); right: calc(10% + 11px);
    height: 2px; background: rgba(0,0,0,0.1); border-radius: 3px; z-index: 0;
}
.print-steps-bar {
    height: 100%; background: var(--primary-color);
    border-radius: 2px; transition: width 0.45s cubic-bezier(.4,0,.2,1); width: 0%;
}
.print-steps-items { display: flex; justify-content: space-between; position: relative; z-index: 1; }
.print-step-item { display: flex; flex-direction: column; align-items: center; gap: 8px; flex: 1; cursor: default; }

/* 步骤圆点 */
.step-dot {
    width: 80px; height: 80px; border-radius: 50%; background: white;
    border: 2px solid rgba(0,0,0,0.1); display: flex; align-items: center; justify-content: center;
    font-size: 2.4rem; font-weight: 700; color: rgba(0,0,0,0.5); transition: all 0.35s ease; position: relative;
}
.print-step-item.active .step-dot{ border-color: var(--primary-color); border-width: .4rem;}
.print-step-item.done .step-dot .fa-check:before{ display: block;}
.print-step-item .step-dot .fa-check:before,
.print-step-item.active .step-dot .fa-check:before { display: none; }
.print-step-item.done .step-dot { border-color: var(--primary-color); background: var(--primary-color); color: white; }
.step-icon-active, .step-icon-done, .step-num { position: absolute; transition: opacity 0.2s ease; }
.step-icon-active, .step-icon-done { opacity: 0; }
.step-num {  opacity: 1; font-size: 2.5rem; }
.print-step-item.active .step-num{ color: var(--primary-color);}
.print-step-item.active .step-num,
.print-step-item.active .step-icon-active ,
.print-step-item.done .step-icon-done     { opacity: 1; }
.print-step-item.done .step-num, .print-step-item.done .step-icon-active { opacity: 0; }

.step-label { font-size: 1rem; color: rgba(0,0,0,0.4); font-weight: 400; white-space: nowrap; transition: color 0.3s; }
.print-step-item.active .step-label, .print-step-item.done .step-label { color: var(--primary-color); font-weight: 600; }

/* ── 面板（Bootstrap Card 增强） ── */
@keyframes panelIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

.panel-num {
    font-size: 2.8rem; font-weight: 600; line-height: .8; min-width: 54px; letter-spacing: -2px; color:var(--black); margin: 0 .6rem 0 0;
}

/* ── 上传区 ── */
.upload-area {
    border: 2px dashed var(--primary-color); border-radius: 12px;
    background: color-mix(in srgb, var(--primary-color) 10%, transparent); cursor: pointer; transition: all 0.3s; overflow: hidden;
}
.upload-area:hover, .upload-area.drag-over { background: white; box-shadow: 0 0 0 4px var(--primary-color); }
.upload-area-inner { padding: 2rem; text-align: center; }
.upload-area-inner i { font-size: 3.6rem; color: var(--primary-color); display: block; margin-bottom: 0.75rem; }

/* 文件列表 */
.file-list-items {
    border-bottom: 1px solid color-mix(in srgb, var(--primary-color) 30%, transparent);
    background: color-mix(in srgb, var(--primary-color) 10%, transparent);
    max-height: 400px;
    overflow-y: auto;
}
.file-list { border-top: 1px solid color-mix(in srgb, var(--primary-color) 30%, transparent); overflow: hidden; }
.file-item { display: flex; align-items: center; gap: 0.5rem; border-bottom: 1px solid color-mix(in srgb, var(--primary-color) 30%, transparent); font-size: 0.875rem; }
.file-item:last-child { border-bottom: none; }
.file-item-name { flex: 1; word-break: break-all; min-width: 0; }
.file-item-size { color: #6c757d; white-space: nowrap; }
.file-item-del  { color: var(--red); cursor: pointer; padding: 2px 6px; border-radius: 4px; transition: all 0.2s; }
.file-item-del:hover { background-color:var(--white); }
.upload-reqs i{ width: 1.4rem; text-align: center;}

/* ── 选项芯片（Bootstrap Button Group 风格） ── */
.option-chip {
    display: flex; flex-direction: column; align-items: center; padding: 0.65rem 1.2rem;
    border: 2px solid #e9ecef; border-radius: 10px;
    color: var(--black); cursor: pointer; transition: all 0.2s; user-select: none; background: white; min-width: 80px; text-align: center;
}
.option-chip:hover { border-color: var(--primary-color); background: color-mix(in srgb, var(--primary-color) 10%, transparent); color: var(--primary-color); }
.qtyGroup .selected .option-chip { border-color: var(--primary-color); background: var(--primary-color); color: white; }
.qtyGroup .selected .option-chip .chip-sub { color: rgba(255,255,255,0.8); }
.chip-sub { font-size: 0.8rem; font-weight: 400; color: #6c757d; margin-top: 2px; display: block; }
.option-chip .chip-sub{ color: var(--primary-color);}

/* ── 加工选项 ── */
.finishing-check {
    display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.9rem;
    border: 2px solid #e9ecef; border-radius: 8px; cursor: pointer;
    font-size: 1rem; transition: all 0.2s; user-select: none; background: white;
}
.finishing-check:hover { border-color: var(--primary-color); background: color-mix(in srgb, var(--primary-color) 10%, transparent); }
.finishing-check input[type=checkbox],
.finishing-check input[type=radio] { accent-color: var(--primary-color); width: 15px; height: 15px; }
.finishing-check:has(input:checked) { border-color: var(--primary-color); background: color-mix(in srgb, var(--primary-color) 10%, transparent); }
.finishing-check .finishing-price { color: var(--medium-gray); font-weight: 200; }
.finishing-check:has(input:checked) .finishing-price { color: var(--primary-color); }

/* ── 第二步：抽屉式分组配置（简化版） ── */

/* 文件计数徽章 */
#step2FileCount {
    font-size: 0.875rem;
    padding: 0.4rem 0.8rem;
}

/* 抽屉式卡片列表容器 */
.v965-drawer-list {
    display: flex;
    flex-direction: column;
    border-top: 1px solid color-mix(in srgb, var(--black) 10%, transparent);
}

/* ── 文件归属列表（左栏）── 卡片模式 ── */

/* 文件信息区 */
.fg-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}
.fg-name {
    font-weight: 500;
    color: #212529;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.3;
}
.fg-size { color: #adb5bd; font-size: 0.72rem; }

/* 配置信息 badges */
.fg-config {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem;
    margin-top: 0.15rem;
}
.fg-badge {
    display: inline-block;
    padding: 0.1rem 0.35rem;
    border-radius: 0.25rem;
    font-size: 0.68rem;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}
.fg-size-badge { background: #e3f2fd; color: #1565c0; }
.fg-material-badge { background: #e8f5e9; color: #2e7d32; }
.fg-finish-badge { background: #fff3e0; color: #e65100; }
.fg-qty-badge { background: #f3e5f5; color: #7b1fa2; }
.fg-none-badge { background: #f8f9fa; color: #adb5bd; border: 1px dashed #dee2e6; }

/* ── Step 2 空状态提示 ── */
#step2EmptyHint {
    display: flex;
}

/* ── 分组手风琴卡（重写样式） ── */
.v965-step2-accordion {
    overflow: hidden;
}

/* 移动端优化：抽屉卡片更紧凑 */
@media (max-width: 767.98px) {
    .v965-drawer-list {
        gap: 0.75rem;
    }
    .v965-group-card {
        border-top: 1px solid #e9ecef;
        overflow: hidden;
    }
    .group-header-btn {
        padding: 0.75rem;
        font-size: 0.9rem;
    }

    /* 选项芯片移动端适配 */
    .option-chip {
        min-width: 70px;
        padding: 0.6rem 0.8rem;
        font-size: 0.85rem;
    }
    .chip-sub {
        font-size: 0.7rem;
    }
}

.v965-group-card {
    border-bottom: 1px solid color-mix(in srgb, var(--black) 10%, transparent);
}

/* 分组标题按钮 */
.group-header-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1.6rem;
    background: color-mix(in srgb, var(--black) 2%, white);
    border: none;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s;
}
.group-header-btn:focus { outline: none; box-shadow: none; }
.group-header-btn:not(.collapsed) {
    background: color-mix(in srgb, var(--primary-color) 20%, transparent);
    border-top: 2px solid color-mix(in srgb, var(--primary-color) 30%, transparent);
    border-bottom: 2px solid color-mix(in srgb, var(--primary-color) 30%, transparent);
}

.group-name-wrap {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 20%;
}
/* 分组卡片头部文件缩略图 */
.group-card-thumb-wrap {
    width: 220px;
    height: 120px;
}
.group-card-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.group-card-icon {
    color: #adb5bd;
}

.group-name:hover { background: #e9ecef; }
.group-name-input {
    font-weight: 700;
    font-size: 0.9rem;
    border: 1px solid var(--primary-color);
    border-radius: 4px;
    padding: 2px 4px;
    width: 120px;
}

.group-file-badge {
    font-size: 0.7rem;
    font-weight: 600;
}

.group-subtotal {
    font-size: 0.75rem;
    font-weight: 700;
}

.group-delete-btn {
    font-size: 1.2rem;
    padding: 2px 4px;
    border-radius: 4px;
    transition: background 0.15s;
}
.group-delete-btn:hover { background: #fff0f0; }

/* 箭头 */
.v965-sec-arrow {
    transition: transform 0.25s ease;
}
.group-header-btn:not(.collapsed) .v965-sec-arrow {
    transform: rotate(180deg);
}

/* 分组内容区 */
.v965-sec-body {
    display: none;
}
.group-header-btn:not(.collapsed) + .v965-sec-body {
    display: block;
    animation: fadeSlideIn 0.2s ease-out;
}
@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* 分组合计行 */
.group-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ── 订单摘要 ── */
.order-summary { background: color-mix(in srgb, var(--primary-color) 30%, transparent); border: 1px solid var(--primary-color); border-radius: 12px; padding: 1.5rem; }
.order-summary-title { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--primary-color); margin-bottom: 1rem; }
.summary-row { display: flex; justify-content: space-between; font-size: 0.875rem; padding: 0.4rem 0; }
.summary-key { color: #6c757d; }
.summary-val { font-weight: 500; color: #212529; text-align: right; max-width: 60%; word-break: break-all; }
.summary-divider { border-top: 1px dashed rgba(0,0,0,0.15); margin: 0.75rem 0; }
.summary-total-row { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 1rem; padding-top: 0.4rem; }
.summary-total-price { font-size: 1.75rem; font-weight: 900; color: var(--primary-color); }

/* 分组摘要 */
.summary-group-block {
    padding: 0.75rem;
    background: var(--white);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    border-left: 3px solid var(--primary-color);
}
.summary-group-block[data-color="1"] { border-left-color: #2e7d32; }
.summary-group-block[data-color="2"] { border-left-color: #e65100; }
.summary-group-block[data-color="3"] { border-left-color: #7b1fa2; }
.summary-group-block[data-color="4"] { border-left-color: #1565c0; }
.summary-group-title {
    font-weight: 700;
    font-size: 0.85rem;
    color: #212529;
    margin-bottom: 0.35rem;
}
.summary-group-title .badge {
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: 0.4rem;
}
.summary-group-detail {
    font-size: 0.8rem;
    color: #6c757d;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.75rem;
}
.summary-group-price {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-left: auto;
}

/* ── 成功动画 ── */
.success-icon i { font-size: 4rem; color: var(--primary-color); animation: pop 0.5s cubic-bezier(.46,.07,.19,.97) both; }
@keyframes pop { 0% { transform: scale(0.5); opacity: 0; } 80% { transform: scale(1.1); } 100% { transform: scale(1); opacity: 1; } }
@media (max-width: 576px) {
    .panel-num { font-size: 1.8rem; min-width: 40px; }
    .option-chip { min-width: 60px; padding: 0.5rem 0.8rem; font-size: 0.85rem; }
    .summary-total-price { font-size: 1.4rem; }
    .step-label { font-size: 0.8rem; }
    .print-steps-track { top: 24px; }
    .step-dot { width: 50px; height: 50px; border: 2px solid rgba(0,0,0,0.1);font-size: 1.4rem; }
    .step-num { font-size: 1.5rem; }
}

/* ── 价格摘要（印刷页面） ── */
.price-summary {
    background: #f8f9fa;
    border-radius: 0.75rem;
    padding: 1rem;
}

.price-summary .text-secondary {
    color: #6c757d !important;
}

.price-summary .border-top {
    border-color: #dee2e6 !important;
}

/* ── 价格公式化展示（单产品页） ── */
.price-formula-wrap {
    background: #f8f9fa;
}
.price-formula-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-family: var(--font-body-en, 'Open Sans'), sans-serif;
}
.formula-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 60px;
}
.formula-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--heading-color, #444);
    line-height: 1.2;
}
.formula-label {
    font-size: 0.7rem;
    color: #999;
    white-space: nowrap;
    margin-top: 2px;
}
.formula-operator {
    font-size: 1.1rem;
    font-weight: 700;
    color: #a2a2a2;
    padding-bottom: 16px;
}
.formula-total {
    padding: 6px 14px 4px;
}
/* ── 垂直滚轮选择器（通用） ── */
.vertical-picker-container {
    display: flex;
    height: 260px;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    border: 1px solid #dee2e6;
}

.vertical-picker-column {
    flex: 1;
    position: relative;
    overflow: hidden;
    border-right: 1px solid #e0e0e0;
}

.vertical-picker-column:last-child {
    border-right: none;
}

.vertical-picker-column::before {
    content: attr(data-title);
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 13px;
    color: #666;
    background: #fff;
    padding: 10px 0;
    z-index: 2;
}

.vertical-picker-scroll {
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-snap-type: y mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-top: 104px;
    padding-bottom: 104px;
}

.vertical-picker-scroll::-webkit-scrollbar {
    display: none;
}

.vertical-picker-item {
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    scroll-snap-align: center;
    cursor: pointer;
    transition: all 0.2s;
    color: #333;
    user-select: none;
}

.vertical-picker-item:hover {
    background: #f5f5f5;
}
.vertical-picker-item.selected {
    background: var(--black);
    color: #fff;
    font-weight: 600;
}

.vertical-picker-column::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 52px;
    transform: translateY(-50%);
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
    pointer-events: none;
    z-index: 1;
}

@media (max-width: 576px) {
    .vertical-picker-container {
        height: 260px;
    }

    .vertical-picker-item {
        height: 52px;
        font-size: 14px;
    }

    .vertical-picker-column::after {
        height: 52px;
    }
}

/* ── 价格摘要（印刷页面） ── */
.price-summary {
    background: #f8f9fa;
    border-radius: 0.75rem;
    padding: 1rem;
}

.price-summary .text-secondary {
    color: #6c757d !important;
}

.price-summary .border-top {
    border-color: #dee2e6 !important;
}

/* ── 价格公式化展示（单产品页） ── */
.price-formula-wrap {
    background: #f8f9fa;
}
.price-formula-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-family: var(--font-body-en, 'Open Sans'), sans-serif;
}
.formula-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 60px;
}
.formula-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--heading-color, #444);
    line-height: 1.2;
}
.formula-label {
    font-size: 0.7rem;
    color: #999;
    white-space: nowrap;
    margin-top: 2px;
}
.formula-operator {
    font-size: 1.1rem;
    font-weight: 700;
    color: #a2a2a2;
    padding-bottom: 16px;
}
.formula-total {
    padding: 6px 14px 4px;
}
.formula-total-value {
    color: var(--primary-color) !important;
    font-size: 1.4rem !important;
}
.formula-total .formula-label {
    color: #999;
}


/* ── 文件摘要横幅 ── */
.file-summary-banner {
    background: #f8f9fa;
    border-radius: 0.75rem;
    padding: 1rem;
}

.file-summary-banner .badge {
    font-weight: 500;
}
