/**
 * WPFOK Payment Method styles.
 *
 * @package WPFOK
 */

.wpfok-pm-wrap {
    --wpfok-pm-violet: #8f00ff;
    --wpfok-pm-black: #0b0412;
}

.wpfok-pm-add-btn,
.wpfok-pm-primary,
.wpfok-pm-field-add {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 9px 16px;
    border: 0;
    border-radius: 8px;
    background: #8f00ff;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 10px 24px rgba(143, 0, 255, 0.18);
}

.wpfok-pm-add-btn:hover,
.wpfok-pm-primary:hover,
.wpfok-pm-field-add:hover {
    background: #7200cc;
    color: #fff;
}

.wpfok-pm-list-card,
.wpfok-pm-empty-state {
    background: #fff;
    border: 1px solid #e8e2f0;
    border-radius: 10px;
    box-shadow: 0 4px 18px rgba(11, 4, 18, 0.06);
    overflow: hidden;
}

.wpfok-pm-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: rgba(143, 0, 255, 0.08);
    color: #8f00ff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.wpfok-pm-card-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wpfok-pm-table-scroll {
    width: 100%;
    overflow-x: auto;
}

.wpfok-pm-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 680px;
}

.wpfok-pm-table th,
.wpfok-pm-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #eee8f5;
    text-align: left;
    vertical-align: middle;
}

.wpfok-pm-table th {
    background: #fbf9fd;
    color: #544660;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.wpfok-pm-table td {
    color: #20142d;
}

.wpfok-pm-table code {
    display: inline-block;
    max-width: 220px;
    padding: 4px 7px;
    border-radius: 6px;
    background: #f5effc;
    color: #5b00b3;
    overflow-wrap: anywhere;
}

.wpfok-pm-method-cell {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 180px;
}

.wpfok-pm-method-cell strong,
.wpfok-pm-method-cell span {
    display: block;
    overflow-wrap: anywhere;
}

.wpfok-pm-method-cell strong {
    margin-bottom: 3px;
    color: #160d21;
    font-size: 15px;
}

.wpfok-pm-method-cell span {
    color: #7a7185;
    font-size: 12px;
    font-weight: 700;
}

.wpfok-pm-status {
    padding: 4px 9px;
    border-radius: 999px;
    background: #e8f8f0;
    color: #0f8a4b;
    font-size: 12px;
    font-weight: 700;
}

.wpfok-pm-row.is-disabled .wpfok-pm-status {
    background: #f2f0f5;
    color: #7a7185;
}

.wpfok-pm-card-actions {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    align-items: stretch;
}

.wpfok-pm-card-actions a,
.wpfok-pm-card-actions button,
.wpfok-pm-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 8px 14px;
    border: 1px solid #e2d8ee;
    border-radius: 8px;
    background: #fff;
    color: #241631;
    text-decoration: none;
    line-height: 1.2;
    white-space: nowrap;
    font-weight: 700;
    cursor: pointer;
}

.wpfok-pm-card-actions .wpfok-pm-delete {
    color: #dc2626;
}

.wpfok-pm-empty-state {
    grid-column: 1 / -1;
    padding: 44px 20px;
    text-align: center;
}

.wpfok-pm-empty-state .dashicons {
    width: 44px;
    height: 44px;
    font-size: 44px;
    color: #8f00ff;
}

.wpfok-pm-empty-state h2 {
    margin: 14px 0 8px;
}

.wpfok-pm-empty-state p {
    margin: 0;
    color: #6b5f7a;
}

.wpfok-pm-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(11, 4, 18, 0.62);
}

.wpfok-pm-modal.is-open {
    display: flex;
}

.wpfok-pm-modal-panel {
    width: min(920px, 100%);
    max-height: calc(100vh - 40px);
    overflow: auto;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 24px 80px rgba(11, 4, 18, 0.28);
}

.wpfok-pm-modal-head {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 22px;
    background: #0b0412;
    color: #fff;
}

.wpfok-pm-modal-head h2 {
    margin: 0;
    color: #fff;
    font-size: 20px;
}

.wpfok-pm-close {
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
}

.wpfok-pm-form {
    padding: 22px;
}

.wpfok-pm-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.wpfok-pm-form label,
.wpfok-pm-full {
    display: grid;
    gap: 7px;
    color: #2b2037;
    font-weight: 700;
}

.wpfok-pm-form input[type="text"],
.wpfok-pm-form input[type="url"],
.wpfok-pm-form select,
.wpfok-pm-form textarea {
    width: 100%;
    min-height: 42px;
    border: 1px solid #dfd4eb;
    border-radius: 8px;
    background: #fff;
    color: #1a1225;
}

.wpfok-pm-media-field {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}

.wpfok-pm-media-btn {
    min-height: 42px;
    padding: 8px 14px;
    border: 1px solid #dfd4eb;
    border-radius: 8px;
    background: #fbf9fd;
    color: #241631;
    font-weight: 700;
    cursor: pointer;
}

.wpfok-pm-full {
    margin-top: 16px;
}

.wpfok-pm-switch-row {
    display: flex !important;
    grid-template-columns: none !important;
    flex-direction: row;
    align-items: center;
    margin: 16px 0;
}

.wpfok-pm-builder {
    border: 1px solid #e8e2f0;
    border-radius: 10px;
    overflow: hidden;
}

.wpfok-pm-builder-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    background: #fbf9fd;
}

.wpfok-pm-builder-head h3 {
    margin: 0;
}

.wpfok-pm-field-row {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) 130px 110px 38px;
    gap: 10px;
    align-items: end;
    padding: 14px 16px;
    border-top: 1px solid #eee8f5;
}

.wpfok-pm-field-remove {
    width: 38px;
    height: 38px;
    border: 1px solid #f2c7c7;
    border-radius: 8px;
    background: #fff5f5;
    color: #dc2626;
    cursor: pointer;
}

.wpfok-pm-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.wpfok-pm-checkout-box {
    margin: 10px 0 0;
}

.wpfok-pm-checkout-note {
    padding: 10px 12px;
    border: 1px solid #e3d2f8;
    border-radius: 8px;
    background: #fbf7ff;
    color: #251532;
}

.wpfok-pm-account-card {
    display: grid;
    gap: 6px;
    justify-items: start;
    margin: 10px 0;
}

.wpfok-pm-number-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.wpfok-pm-number-label {
    color: #2b2037;
    font-size: 13px;
    font-weight: 800;
}

.wpfok-pm-copy {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
    padding: 8px 10px;
    border: 1px solid #d9c6ee;
    border-radius: 8px;
    background: #fff;
    color: #0b0412;
    font-weight: 700;
    cursor: pointer;
}

.wpfok-pm-copy span:first-child {
    overflow-wrap: anywhere;
}

.wpfok-pm-field input[type="file"] {
    width: 100%;
    max-width: 100%;
}

.wpfok-pm-order-details {
    margin: 12px 0;
    padding: 14px;
    border: 1px solid #e4d8f0;
    border-radius: 8px;
    background: #fbf9fd;
}

.wpfok-pm-order-details h3 {
    margin: 0 0 10px;
    color: #1a1225;
}

.wpfok-pm-order-details dl {
    display: grid;
    grid-template-columns: minmax(110px, 38%) minmax(0, 1fr);
    gap: 8px 12px;
    margin: 0;
}

.wpfok-pm-order-details dt {
    color: #6b5f7a;
    font-weight: 700;
}

.wpfok-pm-order-details dd {
    margin: 0;
    overflow-wrap: anywhere;
}

@media screen and (max-width: 782px) {
    .wpfok-pm-form-grid,
    .wpfok-pm-field-row,
    .wpfok-pm-order-details dl {
        grid-template-columns: 1fr;
    }

    .wpfok-pm-table,
    .wpfok-pm-table thead,
    .wpfok-pm-table tbody,
    .wpfok-pm-table tr,
    .wpfok-pm-table th,
    .wpfok-pm-table td {
        display: block;
    }

    .wpfok-pm-table {
        min-width: 0;
    }

    .wpfok-pm-table thead {
        display: none;
    }

    .wpfok-pm-table tr {
        padding: 14px;
        border-bottom: 1px solid #eee8f5;
    }

    .wpfok-pm-table td {
        display: grid;
        grid-template-columns: 110px minmax(0, 1fr);
        gap: 10px;
        padding: 8px 0;
        border-bottom: 0;
    }

    .wpfok-pm-table td::before {
        content: attr(data-label);
        color: #7a7185;
        font-size: 12px;
        font-weight: 800;
        text-transform: uppercase;
    }

    .wpfok-pm-table td:nth-child(2),
    .wpfok-pm-table td:nth-child(3),
    .wpfok-pm-table td:nth-child(4) {
        display: none;
    }

    .wpfok-pm-table td:first-child,
    .wpfok-pm-table td:last-child {
        display: block;
    }

    .wpfok-pm-table td:first-child::before,
    .wpfok-pm-table td:last-child::before {
        content: none;
    }

    .wpfok-pm-method-cell {
        min-width: 0;
    }

    .wpfok-pm-card-actions {
        align-items: stretch;
        flex-wrap: nowrap;
    }

    .wpfok-pm-card-actions a,
    .wpfok-pm-card-actions button {
        flex: 1 1 0;
        text-align: center;
    }

    .wpfok-pm-media-field {
        grid-template-columns: 1fr;
    }

    .wpfok-pm-modal {
        padding: 10px;
        align-items: flex-start;
    }

    .wpfok-pm-modal-panel {
        max-height: calc(100vh - 20px);
    }

    .wpfok-pm-modal-actions {
        flex-direction: column-reverse;
    }

    .wpfok-pm-modal-actions button {
        width: 100%;
    }
}
