/* WooCommerce Confirm Payment — Frontend Styles */
:root {
    --wcp-primary:   #2563eb;
    --wcp-success:   #16a34a;
    --wcp-danger:    #dc2626;
    --wcp-warning:   #d97706;
    --wcp-border:    #e2e8f0;
    --wcp-bg:        #f8fafc;
    --wcp-radius:    12px;
    --wcp-shadow:    0 2px 12px rgba(0,0,0,.08);
}

/* ===== CARD ===== */
.wcp-wrap { margin: 32px 0; font-family: inherit; }

.wcp-card {
    background: #fff;
    border: 1px solid var(--wcp-border);
    border-radius: var(--wcp-radius);
    padding: 28px;
    box-shadow: var(--wcp-shadow);
    max-width: 720px;
}

.wcp-card-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--wcp-border);
}
.wcp-card-header .wcp-icon { font-size: 2rem; line-height: 1; }
.wcp-card-header h3 { margin: 0 0 4px; font-size: 1.25rem; color: #1e293b; }
.wcp-card-header p  { margin: 0; color: #64748b; font-size: .9rem; }

/* ===== BANK INFO ===== */
.wcp-bank-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: calc(var(--wcp-radius) * 0.7);
    padding: 14px 18px;
    margin-bottom: 24px;
    font-size: .9rem;
    color: #1e3a8a;
    line-height: 1.6;
}
.wcp-bank-info strong { display: block; margin-bottom: 6px; }

/* ===== BACS Account Cards ===== */
.wcp-bacs-list { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }

.wcp-bacs-item {
    background: #fff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 10px 14px;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 2px 12px;
    font-size: .875rem;
}

.wcp-bacs-bank {
    grid-column: 1 / -1;
    font-weight: 600;
    color: #1e3a8a;
    font-size: .9rem;
    margin-bottom: 2px;
}

.wcp-bacs-name  { color: #374151; }
.wcp-bacs-number {
    font-family: monospace;
    font-size: .95rem;
    color: #1e3a8a;
    font-weight: 600;
    letter-spacing: .5px;
}

.wcp-bacs-meta { color: #64748b; font-size: .8rem; }

/* ===== ORDER SUMMARY ===== */
.wcp-order-summary {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: calc(var(--wcp-radius) * 0.85);
    padding: 16px 20px;
    margin-bottom: 20px;
}
.wcp-order-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px dashed #cbd5e1;
}
.wcp-order-label {
    display: block;
    font-size: .7rem;
    color: #94a3b8;
    margin-bottom: 2px;
    text-transform: uppercase;
    letter-spacing: .5px;
    font-weight: 500;
}
.wcp-order-number {
    font-size: 1.35rem;
    color: var(--wcp-primary);
    font-weight: 700;
    line-height: 1.2;
}
.wcp-order-date-val { font-size: .9rem; color: #475569; font-weight: 500; }

.wcp-order-items { margin-bottom: 12px; font-size: .875rem; }
.wcp-order-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
    color: #475569;
}
.wcp-item-name  { flex: 1; }
.wcp-item-qty   { color: #94a3b8; margin-left: 4px; }
.wcp-item-price { font-weight: 500; color: #1e293b; white-space: nowrap; }
.wcp-order-shipping { color: #64748b; font-size: .825rem; }

.wcp-order-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid #cbd5e1;
}
.wcp-order-total span { font-size: .9rem; color: #64748b; }
.wcp-order-amount {
    font-size: 1.5rem;
    color: var(--wcp-success);
    font-weight: 700;
}

/* ===== FORM ===== */
.wcp-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}
@media (max-width: 600px) { .wcp-row { grid-template-columns: 1fr; } }

.wcp-field        { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.wcp-field.wcp-full { grid-column: 1 / -1; }
.wcp-field label  { font-weight: 600; font-size: .875rem; color: #374151; }
.wcp-field .req   { color: var(--wcp-danger); }

.wcp-field input,
.wcp-field select,
.wcp-field textarea {
    padding: 10px 14px;
    border: 1.5px solid var(--wcp-border);
    border-radius: 8px;
    font-size: .95rem;
    color: #1e293b;
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
    width: 100%;
    box-sizing: border-box;
}
.wcp-field input:focus,
.wcp-field select:focus,
.wcp-field textarea:focus {
    outline: none;
    border-color: var(--wcp-primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

/* ===== UPLOAD AREA ===== */
.wcp-upload-area {
    border: 2px dashed #93c5fd;
    border-radius: 10px;
    padding: 28px 20px;
    text-align: center;
    background: #f0f9ff;
    cursor: pointer;
    transition: all .2s;
    position: relative;
}
.wcp-upload-area:hover, .wcp-upload-area.drag-over {
    border-color: var(--wcp-primary);
    background: #dbeafe;
}
.wcp-upload-area input[type="file"] {
    position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
}
.wcp-upload-icon { font-size: 2rem; margin-bottom: 8px; }
.wcp-upload-area p { margin: 4px 0; color: #475569; font-size: .9rem; }
.wcp-browse { color: var(--wcp-primary); text-decoration: underline; font-weight: 600; }
.wcp-hint { font-size: .8rem !important; color: #94a3b8 !important; }

/* ══════════════════════════════════════════════════════
   Upload / Drop Zone — Design v2
   ══════════════════════════════════════════════════════ */

/* Drop Zone = <label> เพื่อ trigger input[type=file] */
.wcp-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 36px 24px;
    border: 2px dashed #bfdbfe;
    border-radius: calc(var(--wcp-radius) * 0.85);
    background: #eff6ff;
    cursor: pointer;
    transition: border-color .2s, background .2s;
    text-align: center;
    user-select: none;
}

.wcp-dropzone:hover,
.wcp-dropzone--over {
    border-color: var(--wcp-primary);
    background: rgba(37,99,235,.06);
}

.wcp-dropzone__icon { color: var(--wcp-primary); opacity: .7; }

.wcp-dropzone__text {
    font-size: .9rem;
    color: #475569;
}

.wcp-dropzone__link {
    color: var(--wcp-primary);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-style: dotted;
}

.wcp-dropzone__hint {
    font-size: .78rem;
    color: #94a3b8;
}

/* ── Slip Preview Box ── */
.wcp-slip-preview {
    display: none;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border: 1px solid #e2e8f0;
    border-radius: calc(var(--wcp-radius) * 0.85);
    background: #f8fafc;
}

.wcp-slip-preview__thumb {
    flex-shrink: 0;
    width: 90px;
    height: 90px;
    border-radius: 8px;
    overflow: hidden;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wcp-slip-preview__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wcp-slip-preview__pdf-icon {
    display: none;
    align-items: center;
    justify-content: center;
    color: #dc2626;
}

.wcp-slip-preview__info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.wcp-slip-preview__name {
    font-size: .9rem;
    font-weight: 600;
    color: #1e293b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wcp-slip-preview__size {
    font-size: .8rem;
    color: #64748b;
}

.wcp-slip-preview__remove {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 8px;
    background: none;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 5px 12px;
    font-size: .8rem;
    color: #64748b;
    cursor: pointer;
    transition: all .2s;
    width: fit-content;
}

.wcp-slip-preview__remove:hover {
    border-color: #dc2626;
    color: #dc2626;
    background: #fff5f5;
}

/* ══════════════════════════════════════════════════════
   Bank Cards — Design v2 (no color-mix dependency)
   ══════════════════════════════════════════════════════ */

.wcp-bank-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}

.wcp-bank-card {
    display: flex;
    border-radius: calc(var(--wcp-radius) * 0.85);
    overflow: hidden;
    background: #fff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
    min-height: 86px;
}

/* ── Sash (left color block) ── */
.wcp-bank-card__sash {
    flex-shrink: 0;
    width: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 10px;
    /* สี set via inline style="background:{color}" */
}

.wcp-bank-card__logo {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255,255,255,.2);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    overflow: hidden;
}

.wcp-bank-card__logo svg,
.wcp-bank-card__logo .wcp-bank-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.wcp-bank-card__initials {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255,255,255,.22);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    font-size: 1rem;
    letter-spacing: .5px;
}

/* ── Info Body (right) ── */
.wcp-bank-card__body {
    flex: 1;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    /* สี bg set via inline style="background:{tint}" */
}

.wcp-bank-card__dl {
    margin: 0;
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 14px;
    row-gap: 4px;
    font-size: .85rem;
    width: 100%;
}

.wcp-bank-card__dl dt {
    color: #64748b;
    font-weight: 500;
    white-space: nowrap;
}

.wcp-bank-card__dl dt::after { content: ':'; }

.wcp-bank-card__dl dd {
    margin: 0;
    color: #1e293b;
    font-weight: 500;
}

.wcp-bank-card__num {
    font-family: monospace;
    font-size: .95rem;
    font-weight: 700;
    letter-spacing: .5px;
    /* สีตาม bank set via inline style */
}

/* ── Empty state ── */
.wcp-bank-empty {
    color: #64748b;
    font-size: .875rem;
    margin: 0;
}

/* ── Responsive ── */
@media (max-width: 480px) {
    .wcp-bank-card__sash { width: 64px; }
    .wcp-bank-card__logo,
    .wcp-bank-card__initials { width: 40px; height: 40px; }
    .wcp-bank-card__body { padding: 12px 14px; }
    .wcp-bank-card__dl { font-size: .8rem; column-gap: 10px; }

    .wcp-slip-preview { flex-direction: column; align-items: flex-start; gap: 12px; }
    .wcp-slip-preview__thumb { width: 100%; height: 160px; }
}

/* ══════════════════════════════════════════════════════
   Destination Bank Selector (เลือกบัญชีปลายทาง)
   ══════════════════════════════════════════════════════ */
.wcp-dest-banks {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wcp-dest-bank-option {
    cursor: pointer;
    display: block;
}

.wcp-dest-bank-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.wcp-dest-bank-card {
    display: flex;
    border: 2px solid #e2e8f0;
    border-radius: calc(var(--wcp-radius) * 0.75);
    overflow: hidden;
    transition: border-color .15s, box-shadow .15s;
    min-height: 72px;
}

.wcp-dest-bank-option input:checked + .wcp-dest-bank-card {
    border-color: var(--dest-color, var(--wcp-primary));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--dest-color, var(--wcp-primary)) 18%, transparent);
}

/* Fallback สำหรับ browser ที่ไม่รองรับ color-mix */
@supports not (color: color-mix(in srgb, red, blue)) {
    .wcp-dest-bank-option input:checked + .wcp-dest-bank-card {
        box-shadow: 0 0 0 3px rgba(37,99,235,.18);
    }
}

.wcp-dest-bank-card__sash {
    flex-shrink: 0;
    width: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

.wcp-dest-bank-card__logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,.2);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
    overflow: hidden;
}

.wcp-dest-bank-card__logo svg { width: 100%; height: 100%; }

.wcp-dest-bank-card__initials {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,.22);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; color: #fff; font-size: .85rem;
}

.wcp-dest-bank-card__body {
    flex: 1;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    background: #f8fafc;
}

.wcp-dest-bank-card__bank {
    font-size: .8rem;
    color: #64748b;
    font-weight: 500;
}

.wcp-dest-bank-card__name {
    font-size: .9rem;
    font-weight: 600;
    color: #1e293b;
}

.wcp-dest-bank-card__num {
    font-family: monospace;
    font-size: .85rem;
    font-weight: 700;
    letter-spacing: .5px;
}

/* ══════════════════════════════════════════════════════
   Admin Note — สำหรับลูกค้า
   ══════════════════════════════════════════════════════ */
.wcp-rejected-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 16px;
    padding: 14px 16px;
    background: #fff5f5;
    border: 1px solid #fecaca;
    border-left: 4px solid var(--wcp-danger);
    border-radius: calc(var(--wcp-radius) * 0.6);
    color: #7f1d1d;
}

.wcp-rejected-note strong { display: block; margin-bottom: 4px; font-size: .9rem; }
.wcp-rejected-note p { margin: 0; font-size: .875rem; line-height: 1.5; }

.wcp-admin-note {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 10px 14px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: calc(var(--wcp-radius) * 0.6);
    color: #0c4a6e;
    font-size: .875rem;
}
