/* =============================================
   訂單確認 Modal 元件樣式
   觸發方式：JS 呼叫 showOrderModal(orderSummary)
   ============================================= */

/* --- 遮罩層 --- */
.order-confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;

    /* 預設隱藏 */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.order-confirm-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

/* --- Modal 卡片 --- */
.order-confirm-modal {
    background: #fff;
    border-radius: 20px;
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);

    /* 進場動畫：從下方浮起 */
    transform: translateY(24px) scale(0.97);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.order-confirm-overlay.is-open .order-confirm-modal {
    transform: translateY(0) scale(1);
}

/* --- Header --- */
.order-confirm-header {
    background: linear-gradient(135deg, #8b6e5e 0%, #a07860 100%);
    color: #fff;
    text-align: center;
    padding: 28px 24px 22px;
    border-radius: 20px 20px 0 0;
}

.order-confirm-icon {
    font-size: 36px;
    display: block;
    margin-bottom: 8px;
}

.order-confirm-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 4px;
}

.order-confirm-subtitle {
    font-size: 13px;
    opacity: 0.85;
    margin: 0;
}

/* --- Body --- */
.order-confirm-body {
    padding: 20px 24px;
}

/* 訂單基本資訊 */
.order-meta {
    background: #faf8f6;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 18px;
}

.order-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    font-size: 13px;
}

.order-meta-row + .order-meta-row {
    border-top: 1px dashed #ece8e4;
}

.order-meta-label {
    color: #8b7b72;
}

.order-meta-value {
    font-weight: 600;
    color: #3d2e28;
    font-size: 13px;
    text-align: right;
    max-width: 200px;
    word-break: break-all;
}

/* 商品明細標題 */
.order-items-title {
    font-size: 13px;
    font-weight: 700;
    color: #8b7b72;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 10px;
}

/* 商品列表 */
.order-items-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 18px;
}

.order-item-row {
    background: #faf8f6;
    border-radius: 10px;
    padding: 10px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.order-item-info {
    flex: 1;
}

.order-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #3d2e28;
}

.order-item-spec {
    font-size: 12px;
    color: #8b7b72;
    margin-top: 2px;
}

.order-item-price {
    font-size: 14px;
    font-weight: 700;
    color: #8b6e5e;
    white-space: nowrap;
}

/* 總金額 */
.order-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: linear-gradient(135deg, #fdf0eb 0%, #faf8f6 100%);
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    color: #3d2e28;
}

.order-total-amount {
    font-size: 20px;
    font-weight: 800;
    color: #8b6e5e;
}

/* --- Footer --- */
.order-confirm-footer {
    padding: 0 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.copy-order-btn {
    width: 100%;
    padding: 14px;
    background: #8b6e5e;
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
    letter-spacing: 0.03em;
}

.copy-order-btn:hover {
    background: #7a5e50;
    transform: translateY(-1px);
}

.copy-order-btn:active {
    transform: translateY(0);
}

/* 複製成功狀態 */
.copy-order-btn.copied {
    background: #4caf50;
}

.close-order-btn {
    width: 100%;
    padding: 12px;
    background: none;
    color: #8b7b72;
    border: 1px solid #e0d8d4;
    border-radius: 50px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.close-order-btn:hover {
    background: #faf8f6;
}
