/* ================================================================
   代購委託頁 daigou.css
   ================================================================ */
.DGPage {
    background: #f7f8fa;
    min-height: 100vh;
    padding-bottom: 120px;
    color: #1f2937;
}

/* ── Hero ── */
.DGHero {
    background: linear-gradient(135deg, #fff 0%, #fff7f4 100%);
    border-bottom: 1px solid #f0f2f5;
}
.DGHero__inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 24px 32px;
}
.DGEyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #ED5631;
    background: #fff0eb;
    padding: 6px 14px;
    border-radius: 999px;
}
.DGEyebrow-dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: #FF6B47; display: inline-block;
}
.DGTitle {
    margin: 16px 0 8px;
    font-size: 30px;
    font-weight: 800;
    color: #0f172a;
}
.DGSubtitle {
    margin: 0;
    font-size: 15px;
    line-height: 1.7;
    color: #64748b;
    max-width: 640px;
}

/* ── Body ── */
.DGBody {
    max-width: 1100px;
    margin: 0 auto;
    padding: 28px 24px 0;
}

/* ── 注意事項 ── */
.DGNotice {
    display: flex;
    gap: 12px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 12px;
    padding: 16px 18px;
    margin-bottom: 24px;
}
.DGNotice__icon { color: #d97706; font-size: 18px; margin-top: 2px; }
.DGNotice__title { font-weight: 700; margin-bottom: 6px; color: #92400e; }
.DGNotice__list { margin: 0; padding-left: 18px; color: #78716c; font-size: 13.5px; line-height: 1.8; }

/* ── Layout ── */
.DGLayout {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 24px;
    align-items: start;
}
@media (max-width: 880px) {
    .DGLayout { grid-template-columns: 1fr; }
}

.DGCard {
    background: #fff;
    border: 1px solid #eef0f3;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .04);
    min-width: 0; /* 允許 grid 欄縮小，避免超長網址撐寬左欄、擠扁右欄 */
}
.DGCard--cart { position: sticky; top: 84px; }
@media (max-width: 880px) {
    .DGCard--cart { position: static; }
}
.DGCardTitle {
    margin: 0 0 18px;
    font-size: 17px;
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Fields ── */
.DGField { margin-bottom: 16px; }
.DGRow { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.DGLabel { display: block; font-size: 13.5px; font-weight: 600; color: #334155; margin-bottom: 6px; }
.DGReq { color: #ef4444; }
.DGInput {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #d8dde4;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 14px;
    color: #0f172a;
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
}
.DGInput:focus {
    outline: none;
    border-color: #FF6B47;
    box-shadow: 0 0 0 3px rgba(255, 107, 71, .12);
}
.DGTextarea { min-height: 78px; resize: vertical; line-height: 1.6; }
.DGHint { display: block; font-size: 12px; color: #94a3b8; margin-top: 5px; }

/* ── 商品網址 + AI 帶入 ── */
.DGUrlRow { display: flex; gap: 8px; align-items: stretch; }
.DGUrlRow .DGInput { flex: 1; }
.DGAiBtn {
    flex-shrink: 0;
    border: none;
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    color: #fff;
    border-radius: 10px;
    padding: 0 16px;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity .15s, box-shadow .15s;
    box-shadow: 0 4px 12px rgba(124, 58, 237, .22);
}
.DGAiBtn:hover { opacity: .92; }
.DGAiBtn:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
.DGAiStatus {
    margin-top: 10px;
    font-size: 13px;
    line-height: 1.5;
    border-radius: 10px;
    padding: 9px 12px;
}
.DGAiStatus i { margin-right: 5px; }
.DGAiStatus.is-loading { background: #f1f5f9; color: #475569; }
.DGAiStatus.is-ok { background: #dcfce7; color: #15803d; }
.DGAiStatus.is-warn { background: #fef3c7; color: #b45309; }
.DGAiStatus.is-err { background: #fff1f2; color: #be123c; }
.DGManualLink {
    display: inline-block;
    margin-top: 10px;
    font-size: 13px;
    color: #7c3aed;
    text-decoration: none;
    font-weight: 600;
}
.DGManualLink:hover { text-decoration: underline; }

/* ── 確認資訊步驟：已輸入網址列 ── */
.DGUrlConfirm {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 12px;
}
.DGUrlConfirm__link {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    color: #2563eb;
    text-decoration: none;
    word-break: break-all;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.DGUrlConfirm__link i { margin-right: 5px; color: #94a3b8; }
.DGUrlConfirm__link:hover { text-decoration: underline; }
.DGUrlConfirm__edit {
    flex-shrink: 0;
    border: 1px solid #d8dde4;
    background: #fff;
    color: #475569;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all .15s;
}
.DGUrlConfirm__edit:hover { border-color: #FF6B47; color: #ED5631; }
.DGUrlConfirm__edit i { margin-right: 4px; }

/* ── 類型切換 ── */
.DGTypeTabs { display: flex; flex-wrap: wrap; gap: 8px; }
.DGTypeTab {
    border: 1px solid #d8dde4;
    background: #fff;
    color: #475569;
    border-radius: 999px;
    padding: 8px 16px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
}
.DGTypeTab:hover { border-color: #FF6B47; color: #ED5631; }
.DGTypeTab.active {
    background: #FF6B47;
    border-color: #FF6B47;
    color: #fff;
    box-shadow: 0 4px 12px rgba(255, 107, 71, .2);
}

/* ── 規格／變體選單 ── */
.DGVariantGrid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}
.DGVariant { display: flex; flex-direction: column; gap: 5px; }
.DGVariantLabel { font-size: 12.5px; font-weight: 600; color: #475569; }
.DGVariantSelect {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='3'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
    cursor: pointer;
}

/* ── 網頁快照（留證縮圖） ── */
.DGSnapshot {
    position: relative;
    display: inline-block;
    width: 120px;
    height: 120px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
    text-decoration: none;
}
.DGSnapshot__img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
}
.DGSnapshot__open {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 11.5px;
    font-weight: 600;
    color: #fff;
    text-align: center;
    background: rgba(15, 23, 42, 0);
    opacity: 0;
    transition: background .15s, opacity .15s;
}
.DGSnapshot:hover .DGSnapshot__open {
    background: rgba(15, 23, 42, .55);
    opacity: 1;
}

/* ── 上傳 ── */
.DGUpload { display: flex; align-items: center; gap: 12px; }
.DGUploadBtn {
    border: 1px dashed #cbd5e1;
    background: #f8fafc;
    color: #475569;
    border-radius: 10px;
    padding: 9px 16px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
}
.DGUploadBtn:hover { border-color: #FF6B47; color: #ED5631; background: #fff7f4; }
.DGUploadStatus { font-size: 12.5px; color: #94a3b8; }
.DGImagePreview { position: relative; display: inline-block; margin-top: 12px; }
.DGImagePreview img {
    max-width: 140px; max-height: 140px;
    border-radius: 10px; border: 1px solid #e2e8f0; display: block;
}
.DGImageRemove {
    position: absolute; top: -8px; right: -8px;
    width: 24px; height: 24px; border-radius: 50%;
    background: #ef4444; color: #fff; border: 2px solid #fff;
    cursor: pointer; font-size: 11px; line-height: 1;
    display: flex; align-items: center; justify-content: center;
}

/* ── 加入清單 ── */
.DGAddBtn {
    width: 100%;
    border: none;
    background: #0f172a;
    color: #fff;
    border-radius: 10px;
    padding: 12px;
    font-size: 14.5px;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s;
}
.DGAddBtn:hover { background: #1e293b; }

/* ── 清單 ── */
.DGCartCount {
    background: #fff0eb; color: #ED5631;
    font-size: 13px; font-weight: 700;
    border-radius: 999px; padding: 2px 10px;
}
.DGCartList { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.DGCartEmpty { text-align: center; color: #cbd5e1; padding: 32px 0; }
.DGCartEmpty i { font-size: 32px; margin-bottom: 8px; }
.DGCartEmpty p { margin: 0; font-size: 13.5px; }

.DGCartItem {
    border: 1px solid #eef0f3;
    border-radius: 12px;
    padding: 12px;
    display: flex;
    gap: 12px;
}
.DGCartItem__img {
    width: 56px; height: 56px; flex-shrink: 0;
    border-radius: 8px; object-fit: cover; border: 1px solid #e2e8f0; background: #f1f5f9;
}
.DGCartItem__body { flex: 1; min-width: 0; }
.DGCartItem__tag {
    display: inline-block; font-size: 11px; font-weight: 700;
    color: #7c3aed; background: #f3e8ff; border-radius: 6px;
    padding: 1px 8px; margin-bottom: 4px;
}
.DGCartItem__desc {
    font-size: 13px; color: #334155; line-height: 1.5;
    word-break: break-word; margin-bottom: 4px;
}
.DGCartItem__url {
    font-size: 12px; color: #2563eb; text-decoration: none;
    word-break: break-all; display: block; margin-bottom: 4px;
}
.DGCartItem__meta { font-size: 12.5px; color: #64748b; }
.DGCartItem__amount { color: #ED5631; font-weight: 700; }
.DGCartItem__remove {
    align-self: flex-start;
    border: none; background: transparent; color: #cbd5e1;
    cursor: pointer; font-size: 15px; padding: 2px 4px;
}
.DGCartItem__remove:hover { color: #ef4444; }

/* ── 結算 ── */
.DGField--orderRemark { margin-top: 8px; }
.DGSummary {
    position: relative;
    border-top: 1px dashed #e2e8f0;
    padding-top: 16px; margin-top: 4px; margin-bottom: 16px;
}
.DGSummaryRow {
    display: flex; justify-content: space-between; align-items: baseline;
    font-size: 14px; color: #475569;
}
.DGSummaryRow--sub { font-size: 13px; color: #64748b; margin-bottom: 6px; }
.DGSummaryRow--total {
    margin-top: 8px; padding-top: 10px; border-top: 1px solid #f1f5f9; align-items: center;
}
.DGSummaryTotalLabel { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; color: #334155; }
.DGSummaryTotal { font-size: 24px; font-weight: 800; color: #0f172a; }
.DGSummaryNote { margin: 6px 0 0; font-size: 12px; color: #94a3b8; }

/* 金額計算說明 ⓘ */
.DGFeeInfo {
    border: none; background: transparent; color: #94a3b8; cursor: pointer;
    padding: 0; font-size: 14px; line-height: 1; display: inline-flex;
}
.DGFeeInfo:hover { color: #FF6B47; }
.DGFeePopover {
    position: absolute; right: 0; bottom: calc(100% - 6px); z-index: 30;
    width: 280px; max-width: 88vw;
    background: #0f172a; color: #e2e8f0;
    border-radius: 12px; padding: 14px 16px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, .28);
    font-size: 12.5px; line-height: 1.6;
}
.DGFeePopover__title { font-weight: 700; color: #fff; margin-bottom: 8px; font-size: 13.5px; }
.DGFeePopover__list { margin: 0 0 8px; padding-left: 18px; }
.DGFeePopover__list li { margin-bottom: 3px; }
.DGFeePopover__list b { color: #FFB59E; }
.DGFeePopover__note { margin: 0; color: #94a3b8; font-size: 11.5px; }

.DGCheckoutBtn {
    width: 100%;
    border: none;
    background: #FF6B47;
    color: #fff;
    border-radius: 12px;
    padding: 14px;
    font-size: 15.5px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(255, 107, 71, .25);
    transition: background .15s, opacity .15s;
}
.DGCheckoutBtn:hover:not(:disabled) { background: #ED5631; }
.DGCheckoutBtn:disabled { background: #e2e8f0; color: #94a3b8; cursor: not-allowed; box-shadow: none; }
.DGCheckoutHint { margin: 10px 0 0; font-size: 12.5px; color: #94a3b8; text-align: center; }

/* 現場代購提示：交通費用併入訂單 */
.DGOnsiteNotice { display: flex; gap: 12px; align-items: flex-start; margin: 4px 0 18px; padding: 12px 14px;
    background: #fff4ef; border: 1px solid #ffd9c9; border-left: 4px solid #FF6B47; border-radius: 10px; }
.DGOnsiteNotice__icon { color: #FF6B47; font-size: 20px; margin-top: 2px; flex: none; }
.DGOnsiteNotice__title { font-weight: 800; color: #d9480f; font-size: 14px; margin-bottom: 3px; }
.DGOnsiteNotice__text { font-size: 13px; color: #7a4a38; line-height: 1.6; }
.DGOnsiteNotice__text b { color: #d9480f; }
