/* ══════════════════════════════════════════════════════════
   橘色主題系統
   --brand-orange : #F57C00  (主色，Material Orange 700)
   --brand-orange-dark : #E65100
   --brand-orange-light: #FFB74D
   ══════════════════════════════════════════════════════════ */
:root {
    --brand-orange:       #F57C00;
    --brand-orange-dark:  #E65100;
    --brand-orange-light: #FFB74D;
    --brand-orange-pale:  #FFF3E0;
}

/* ── 全域 ─────────────────────────────────────────────────── */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #f5f7fa;
    font-family: "Noto Sans TC", "Inter", "Microsoft JhengHei", sans-serif;
}

main { flex: 1; }

/* ── Header ──────────────────────────────────────────────── */
.site-header {
    background: #fff;
    padding: 10px 0 0 0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}
.site-header-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 0 32px 10px 32px;
}
.site-logo-link { display: flex; align-items: center; text-decoration: none; }
.site-logo-img  { height: 56px; width: auto; object-fit: contain; }
.site-header-text { display: flex; flex-direction: column; justify-content: center; line-height: 1.25; }
.site-header-title {
    font-size: 1.55rem;
    font-weight: 700;
    color: #1a1a1a;
    letter-spacing: 0.02em;
}
.site-header-subtitle-zh {
    font-size: 1.55rem;
    font-weight: 700;
    color: #1a1a1a;
}
.site-header-subtitle {
    font-size: 0.95rem;
    font-weight: 600;
    color: #555;
    letter-spacing: 0.01em;
}
.site-header-en {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--brand-orange);
    letter-spacing: 0.12em;
}
.site-header-bar {
    height: 4px;
    background: linear-gradient(90deg, var(--brand-orange-dark), var(--brand-orange-light));
}

/* ── Footer ──────────────────────────────────────────────── */
.site-footer {
    background: #fff;
    margin-top: auto;
}
.site-footer-bar {
    height: 4px;
    background: linear-gradient(90deg, var(--brand-orange-dark), var(--brand-orange-light));
}
.site-footer-text {
    padding: 10px 0;
    text-align: center;
    font-size: 0.78rem;
    font-weight: 600;
    color: #444;
    letter-spacing: 0.04em;
}

/* ── 橘色工具類別 ─────────────────────────────────────────── */
.text-orange       { color: var(--brand-orange) !important; }
.text-orange-light { color: var(--brand-orange-light) !important; }
.bg-orange         { background-color: var(--brand-orange) !important; }
.bg-orange-pale    { background-color: var(--brand-orange-pale) !important; }
.bg-orange-light   { background-color: var(--brand-orange-light) !important; }
.border-orange     { border-color: var(--brand-orange) !important; }

/* ── 橘色按鈕 ────────────────────────────────────────────── */
.btn-orange {
    background-color: var(--brand-orange);
    border-color:     var(--brand-orange);
    color: #fff;
    font-weight: 600;
}
.btn-orange:hover, .btn-orange:focus {
    background-color: var(--brand-orange-dark);
    border-color:     var(--brand-orange-dark);
    color: #fff;
}
.btn-orange:disabled {
    background-color: #ffcc80;
    border-color:     #ffcc80;
    color: #fff;
}

/* ── 橘色外框按鈕 ────────────────────────────────────────── */
.btn-outline-orange {
    color:        var(--brand-orange);
    border-color: var(--brand-orange);
    font-weight:  600;
}
.btn-outline-orange:hover,
.btn-outline-orange.active,
.btn-outline-orange:active {
    background-color: var(--brand-orange);
    border-color:     var(--brand-orange);
    color: #fff !important;
}

/* ── 卡片頁首（橘色） ────────────────────────────────────── */
.card-header-orange {
    background-color: var(--brand-orange);
    color: #fff;
}
.card-header-orange .opacity-75 { opacity: 0.85 !important; }

/* ── 卡片頁首（綠色，訂單區） ───────────────────────────── */
.card-header-green {
    background-color: #2e7d32;
    color: #fff;
}

/* ── 服飾類型按鈕列 ──────────────────────────────────────── */
#clothingTypeBtns .clothing-type-btn {
    min-width: 80px;
    transition: all 0.2s;
}
#clothingTypeBtns .clothing-type-btn.active {
    background-color: var(--brand-orange) !important;
    border-color:     var(--brand-orange) !important;
    color: #fff !important;
    box-shadow: 0 2px 6px rgba(245,124,0,0.4);
}

/* ── T-恤容器 ─────────────────────────────────────────────── */
.tshirt-wrapper {
    border-radius: 8px;
    line-height: 0;
}

@media (max-width: 500px) {
    .tshirt-wrapper {
        transform: scale(0.82);
        transform-origin: top center;
    }
}

/* ── 印刷區域 ─────────────────────────────────────────────── */
#printArea {
    border-radius: 2px;
    transition: background 0.2s;
}
#printArea:hover {
    background: rgba(245, 124, 0, 0.08) !important;
}

/* ── 拖曳圖案 ─────────────────────────────────────────────── */
#userImage {
    outline: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    transition: box-shadow 0.15s;
}
#userImage:active {
    box-shadow: 0 5px 16px rgba(245,124,0,0.45);
}

/* ── 對齊按鈕（啟用狀態） ───────────────────────────────── */
.align-btn.active-align {
    background-color: var(--brand-orange);
    border-color:     var(--brand-orange);
    color: #fff;
}

/* ── 下拉選單載入動畫 ─────────────────────────────────────── */
select:disabled { opacity: 0.55; }

/* ── 製作單 ──────────────────────────────────────────────── */
.section-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: #495057;
    border-bottom: 2px solid var(--brand-orange);
    padding-bottom: 4px;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.order-table th {
    background-color: #fafafa;
    font-weight: 600;
    font-size: 0.8rem;
}
.table td, .table th {
    vertical-align: middle;
    font-size: 0.875rem;
}

/* ── 精靈步驟條（現代簡約版） ──────────────────────────────── */
.wizard-progress {
    display: flex;
    align-items: flex-start;
    position: relative;
    padding: 0 8px;
}
.wizard-progress::before {
    content: '';
    position: absolute;
    top: 13px;
    left: calc(100% / 12);
    right: calc(100% / 12);
    height: 1px;
    background: #e0e0e0;
    z-index: 0;
}
.wizard-step-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
}
.wizard-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #d0d0d0;
    color: #bbb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.78rem;
    transition: all 0.25s;
    position: relative;
    z-index: 1;
}
.wizard-step-item.active .wizard-dot {
    background: var(--brand-orange);
    border-color: var(--brand-orange);
    color: #fff;
    box-shadow: 0 0 0 3px rgba(245,124,0,0.18);
}
.wizard-step-item.completed .wizard-dot {
    background: #fff;
    border-color: var(--brand-orange);
    color: var(--brand-orange);
    font-size: 0;
}
.wizard-step-item.completed .wizard-dot::after { content: '✓'; font-size: 0.78rem; color: var(--brand-orange); }
.wizard-step-item.completed::after {
    content: '';
    position: absolute;
    top: 13px;
    left: 50%;
    right: -50%;
    height: 1px;
    background: var(--brand-orange);
    z-index: 0;
    opacity: 0.4;
}
.wizard-label {
    font-size: 0.65rem;
    color: #bbb;
    margin-top: 5px;
    text-align: center;
    white-space: nowrap;
    letter-spacing: 0.02em;
}
.wizard-step-item.active    .wizard-label { color: var(--brand-orange); font-weight: 700; }
.wizard-step-item.completed .wizard-label { color: var(--brand-orange); font-weight: 500; opacity: 0.7; }

/* ── 步驟卡片容器（現代簡約白卡） ───────────────────────────── */
.wizard-step-card {
    background: #fff;
    border-radius: 16px;
    padding: 28px 28px 24px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.04);
}
.wizard-step-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1a1a1a;
    letter-spacing: 0.01em;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--brand-orange);
    display: inline-block;
}

/* ── 返回按鈕（頂部，極簡） ──────────────────────────────────── */
.wizard-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: #888;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 4px 0;
    margin-bottom: 14px;
    cursor: pointer;
    letter-spacing: 0.01em;
    transition: color 0.15s;
    font-family: inherit;
}
.wizard-back-btn:hover { color: var(--brand-orange); }

/* ── 可選卡片（類型 / 品牌 / 型號） ─────────────────────────── */
.wizard-select-card {
    padding: 20px 8px 16px;
    border: 1.5px solid #ebebeb;
    border-radius: 12px;
    background: #fafafa;
    transition: all 0.18s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.wizard-select-card:hover {
    border-color: var(--brand-orange);
    background: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(245,124,0,0.15);
}
.wizard-select-card.selected {
    border-color: var(--brand-orange);
    background: var(--brand-orange-pale);
    box-shadow: 0 0 0 3px rgba(245,124,0,0.18);
}
.wizard-card-icon  { font-size: 2rem; line-height: 1; }
.wizard-card-label { font-size: 0.85rem; font-weight: 600; color: #333; letter-spacing: 0.01em; }

/* ── 顏色 chip ───────────────────────────────────────────────── */
.color-chip {
    padding: 6px 18px;
    border: 1.5px solid #e0e0e0;
    border-radius: 20px;
    background: #fafafa;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}
.color-chip:hover    { border-color: var(--brand-orange); background: #fff; }
.color-chip.selected { border-color: var(--brand-orange); background: var(--brand-orange); color: #fff; }

/* ── 已選摘要麵包屑 ──────────────────────────────────────────── */
.selection-crumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0 2px 12px;
    font-size: 0.82rem;
    color: #999;
    font-weight: 500;
}
.crumb-sep { color: #d0d0d0; margin: 0 4px; font-size: 0.75rem; }

/* ── 圖案圖層（多圖拖曳 + 縮放） ────────────────────────────── */
.img-layer {
    position: absolute;
    cursor: move;
    user-select: none;
    -webkit-user-select: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    z-index: 3;
}
.img-layer.selected {
    outline: 2px solid #F57C00;
    outline-offset: 1px;
    z-index: 10;
}
.img-layer img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    pointer-events: none;
}
/* 縮放角落控制點 */
.rh {
    display: none;
    position: absolute;
    width: 11px;
    height: 11px;
    background: #F57C00;
    border: 2px solid #fff;
    border-radius: 2px;
    z-index: 11;
    box-shadow: 0 1px 4px rgba(0,0,0,0.35);
}
.img-layer.selected .rh { display: block; }
.rh-nw { top: -6px; left: -6px;  cursor: nw-resize; }
.rh-ne { top: -6px; right: -6px; cursor: ne-resize; }
.rh-sw { bottom: -6px; left: -6px;  cursor: sw-resize; }
.rh-se { bottom: -6px; right: -6px; cursor: se-resize; }
/* 刪除按鈕 */
.img-del-btn {
    display: none;
    position: absolute;
    top: -11px;
    right: -11px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #e53935;
    color: #fff;
    border: 2px solid #fff;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    z-index: 12;
    padding: 0;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
.img-layer.selected .img-del-btn { display: flex; }
/* 圖案計數器徽章 */
#imgCounter {
    font-size: 0.78rem;
    color: var(--brand-orange-dark);
    font-weight: 600;
    margin-bottom: 6px;
}

/* ── 步驟面板淡入 ────────────────────────────────────────────── */
.wizard-panel { animation: wFadeIn 0.2s ease; }
@keyframes wFadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ── 列印樣式 ─────────────────────────────────────────────── */
@media print {
    body {
        background: white !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .no-print { display: none !important; }
    nav, footer { display: none !important; }
    main { padding: 0 !important; }

    .container { max-width: 100% !important; padding: 0 !important; }
    #orderPage { padding: 0 !important; }
    .print-card { box-shadow: none !important; border: 1px solid #333 !important; }

    .table-warning td, .table-warning th { background-color: #fff3cd !important; }
    .table-danger  td, .table-danger  th { background-color: #f8d7da !important; }
    .table-secondary th                   { background-color: #e2e3e5 !important; }
    .section-title { border-bottom-color: #F57C00 !important; }
}
