/*
 * PidoGame shared commerce metadata and calculator presentation.
 * Generated from the 1.8.38 monolith and maintained as an independent module.
 */

/* PidoGame 1.8.37 — calculator form and durable order metadata. */
.pido-calculator-purchase .card-body {
    display: grid;
    gap: 1rem;
}

.pido-calculator-purchase .form-group {
    margin: 0 !important;
}

.pido-calculator-field {
    display: grid;
    gap: .45rem;
}

.pido-calculator-field label {
    color: var(--pido-text);
    font-size: .94rem;
    font-weight: var(--pido-font-weight-bold, 700);
    line-height: 1.8;
}

.pido-calculator-field .form-control {
    width: 100%;
    min-height: 46px;
    border-color: var(--pido-border);
    border-radius: var(--pido-radius-control);
    background: var(--pido-control-bg);
    color: var(--pido-text);
    font: inherit;
}

.pido-calculator-total {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
}

.woocommerce-order-details .wc-item-meta,
.woocommerce-table__product-name .wc-item-meta,
.woocommerce-order-details .wc-item-meta ul {
    display: grid;
    gap: .4rem;
    margin: .65rem 0 0;
    padding: 0;
    list-style: none;
}

.woocommerce-order-details .wc-item-meta li,
.woocommerce-table__product-name .wc-item-meta li {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: .3rem .55rem;
    align-items: start;
    color: var(--pido-text-muted);
    font-size: .9rem;
    line-height: 1.9;
}

.woocommerce-order-details .wc-item-meta li strong,
.woocommerce-table__product-name .wc-item-meta li strong {
    color: var(--pido-text);
    font-weight: var(--pido-font-weight-semibold, 600);
}

.woocommerce-order-details .wc-item-meta li p,
.woocommerce-table__product-name .wc-item-meta li p {
    min-width: 0;
    margin: 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

@media (max-width: 575.98px) {
    .woocommerce-order-details .wc-item-meta li,
    .woocommerce-table__product-name .wc-item-meta li {
        grid-template-columns: minmax(0, 1fr);
        gap: .05rem;
    }
}


/* ========================================================================
   Account and order components migrated from legacy template-level styles.
   ======================================================================== */
.pido-account-section-title {
    margin: 0 0 1rem;
    color: var(--pido-text);
    font-size: var(--pido-font-size-lg, 1.125rem);
    font-weight: var(--pido-font-weight-bold, 700);
}

.pido-account-table-scroll,
.custom-orders-table-wrapper {
    width: 100%;
    margin-block: 1.5rem;
    overflow-x: auto;
    border: 1px solid var(--pido-border);
    border-radius: var(--pido-radius-card);
    background: var(--pido-surface);
    -webkit-overflow-scrolling: touch;
}

.pido-account-table-scroll:focus-visible {
    outline: 3px solid rgba(var(--pido-primary-rgb), .2);
    outline-offset: 2px;
}

.order-summary-table,
.custom-orders-table {
    width: 100%;
    min-width: 640px;
    margin: 0;
    border: 0;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--pido-surface);
    color: var(--pido-text);
    direction: rtl;
    font-family: inherit;
    font-size: .9375rem;
    text-align: center;
}

.order-summary-table {
    margin-block: 1.5rem;
    overflow: hidden;
    border: 1px solid var(--pido-border);
    border-radius: var(--pido-radius-card);
}

.order-summary-table thead th,
.custom-orders-table thead th {
    padding: .9rem .75rem;
    border: 0;
    border-bottom: 1px solid var(--pido-border);
    background: var(--pido-surface-strong);
    color: var(--pido-text);
    font-size: .9rem;
    font-weight: var(--pido-font-weight-bold, 700);
    line-height: 1.65;
}

.order-summary-table tbody tr,
.custom-orders-table tbody tr {
    background: var(--pido-surface);
}

.order-summary-table tbody tr:nth-child(even),
.custom-orders-table tbody tr:nth-child(even) {
    background: var(--pido-surface-soft);
}

.order-summary-table td,
.custom-orders-table td {
    padding: .9rem .75rem;
    border: 0;
    border-bottom: 1px solid var(--pido-border);
    color: var(--pido-text-muted);
    font-size: .9rem;
    line-height: 1.75;
    text-align: center;
    vertical-align: middle;
}

.order-summary-table tbody tr:last-child td,
.custom-orders-table tbody tr:last-child td {
    border-bottom: 0;
}

.custom-status,
.order-status-badge {
    display: inline-flex;
    min-width: 7rem;
    min-height: 32px;
    align-items: center;
    justify-content: center;
    padding: .35rem .7rem;
    border-radius: var(--pido-radius-control);
    font-size: .8125rem;
    font-weight: var(--pido-font-weight-semibold, 600);
    line-height: 1.5;
    text-align: center;
}

.status-processing { background: #e9f3ff; color: #1675c1; }
.status-on-hold { background: #fff4cc; color: #8a6700; }
.status-completed { background: #dcf7e5; color: #19753b; }
.status-two-factor { background: #eee8fb; color: #6341b7; }
.status-wrong { background: #fde5eb; color: #b91c45; }
.status-verify { background: #ffeadb; color: #a84d14; }
.status-refunded { background: #f8f6d4; color: #746b00; }
.status-pending,
.status-failed,
.status-cancelled { background: var(--pido-control-bg); color: var(--pido-text-muted); }

html[data-pido-theme="dark"] :where(.status-processing, .status-on-hold, .status-completed, .status-two-factor, .status-wrong, .status-verify, .status-refunded) {
    filter: saturate(.82) brightness(.82);
}

.custom-view-btn,
.custom-view-btn:visited,
.elementor .custom-view-btn,
.elementor .custom-view-btn:visited {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    padding: .45rem .9rem;
    border: 0;
    border-radius: var(--pido-radius-control);
    background: var(--pido-primary);
    color: #fff !important;
    font-size: .875rem;
    font-weight: var(--pido-font-weight-bold, 700);
    line-height: 1.55;
    text-decoration: none !important;
}

.custom-view-btn:hover,
.custom-view-btn:focus-visible,
.elementor .custom-view-btn:hover,
.elementor .custom-view-btn:focus-visible {
    background: color-mix(in srgb, var(--pido-primary) 88%, #000);
    color: #fff !important;
    text-decoration: none !important;
}

.custom-pagination {
    margin-block-start: 1.5rem;
}

.custom-order-actions {
    display: flex;
    justify-content: flex-end;
    margin-block-start: 1.5rem;
}

.product-with-thumb {
    display: inline-flex;
    align-items: center;
    gap: .75rem;
    color: var(--pido-text);
    text-decoration: none;
}

.product-with-thumb img {
    width: 64px;
    height: 64px;
    flex: 0 0 64px;
    border-radius: var(--pido-radius-control);
    object-fit: contain;
    background: var(--pido-surface-soft);
}

.order-meta {
    display: grid;
    gap: .35rem;
    margin: 0;
    padding: 0;
    list-style: none;
    text-align: start;
}

.order-meta li {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: .25rem .45rem;
    line-height: 1.7;
}

.order-meta strong {
    color: var(--pido-text);
    font-weight: var(--pido-font-weight-semibold, 600);
}

.order-notes {
    margin-block: 1.5rem;
    padding: 1rem;
    border: 1px dashed color-mix(in srgb, var(--pido-primary) 65%, var(--pido-border));
    border-radius: var(--pido-radius-card);
    background: color-mix(in srgb, var(--pido-primary) 8%, var(--pido-surface));
}

.order-notes :where(ol, ul) {
    display: grid;
    gap: .75rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.note-content,
.woocommerce-OrderUpdate {
    padding: .8rem .9rem;
    border: 1px solid var(--pido-border);
    border-radius: var(--pido-radius-control);
    background: var(--pido-surface);
}

.note-date,
.woocommerce-OrderUpdate-meta {
    display: block;
    margin-block-end: .35rem;
    color: var(--pido-text-muted);
    font-size: .8125rem;
}

.note-text,
.woocommerce-OrderUpdate-description {
    color: var(--pido-text);
    font-size: .9rem;
    line-height: 1.9;
}

.wallet-used-amount {
    margin-block-start: 1.25rem;
    padding: .75rem .9rem;
    border: 1px solid var(--pido-border);
    border-radius: var(--pido-radius-control);
    background: var(--pido-surface-soft);
}

.pido-account-empty-state {
    padding: 1.25rem;
    border: 1px solid var(--pido-border);
    border-radius: var(--pido-radius-card);
    background: var(--pido-surface-soft);
    color: var(--pido-text-muted);
    text-align: center;
}

.pido-edit-account-form {
    width: 100%;
    margin-block-start: 1.5rem;
    padding: 0;
    color: var(--pido-text);
    direction: rtl;
    font-family: inherit;
}

.pido-edit-account-form .form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.25rem;
}

.pido-edit-account-form .avatar-section {
    padding: 1.25rem;
    border: 1px dashed var(--pido-border);
    border-radius: var(--pido-radius-card);
    background: var(--pido-surface-soft);
    text-align: center;
}

.pido-edit-account-form .avatar-preview {
    display: block;
    width: 100px;
    height: 100px;
    margin: 0 auto .75rem;
    border: 2px solid var(--pido-border);
    border-radius: 50%;
    object-fit: cover;
}

.pido-edit-account-form .avatar-upload-wrapper {
    display: flex;
    align-items: center;
    flex-direction: column;
    gap: .5rem;
}

.pido-edit-account-form .field {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: .4rem;
}

.pido-edit-account-form :where(.field label, .avatar-upload-wrapper label) {
    color: var(--pido-text);
    font-size: .9rem;
    font-weight: var(--pido-font-weight-semibold, 600);
}

.pido-edit-account-form :where(.field input, input[type="file"]) {
    width: 100%;
    min-height: 46px;
    padding: .65rem .8rem;
    border: 1px solid var(--pido-border);
    border-radius: var(--pido-radius-control);
    background: var(--pido-control-bg);
    color: var(--pido-text);
    font-size: .9375rem;
}

.pido-edit-account-form .field input:disabled {
    cursor: not-allowed;
    opacity: .72;
}

.pido-edit-account-form button[type="submit"] {
    display: flex;
    width: min(100%, 280px);
    min-height: 46px;
    align-items: center;
    justify-content: center;
    margin: 1.5rem auto 0;
    padding: .7rem 1rem;
    border: 0;
    border-radius: var(--pido-radius-control);
    background: var(--pido-primary);
    color: #fff;
    font-size: .9375rem;
    font-weight: var(--pido-font-weight-bold, 700);
}

.pido-notice {
    margin-block-end: 1.25rem;
    padding: .8rem 1rem;
    border: 1px solid var(--pido-border);
    border-radius: var(--pido-radius-control);
    font-size: .9rem;
    line-height: 1.8;
    text-align: center;
}

.pido-notice.success {
    border-color: #86c99c;
    background: #e4f6ea;
    color: #155d2e;
}

.pido-notice.error {
    border-color: #e6a3af;
    background: #fde8ec;
    color: #8f1830;
}

html[data-pido-theme="dark"] .pido-notice.success {
    background: #183425;
    color: #b7edc7;
}

html[data-pido-theme="dark"] .pido-notice.error {
    background: #3b1c24;
    color: #ffc1cc;
}

.gift-sku {
    display: inline-flex;
    padding: .2rem .45rem;
    border-radius: var(--pido-radius-control);
    background: var(--pido-control-bg);
    color: var(--pido-text);
    direction: ltr;
    unicode-bidi: isolate;
    font-feature-settings: normal;
}

@media (min-width: 768px) {
    .pido-edit-account-form .form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1.5rem;
    }

    .pido-edit-account-form .avatar-section {
        grid-column: 1 / -1;
    }
}

@media (max-width: 767.98px) {
    .pido-account-table-scroll,
    .custom-orders-table-wrapper {
        overflow: visible;
        border: 0;
        background: transparent;
    }

    .order-summary-table,
    .custom-orders-table {
        display: block;
        min-width: 0;
        border: 0;
        background: transparent;
    }

    .order-summary-table thead,
    .custom-orders-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        clip-path: inset(50%);
        white-space: nowrap;
    }

    .order-summary-table tbody,
    .custom-orders-table tbody,
    .order-summary-table tr,
    .custom-orders-table tr,
    .order-summary-table td,
    .custom-orders-table td {
        display: block;
        width: 100%;
    }

    .order-summary-table tr,
    .custom-orders-table tr {
        margin-block-end: .8rem;
        overflow: hidden;
        border: 1px solid var(--pido-border);
        border-radius: var(--pido-radius-card);
        background: var(--pido-surface);
    }

    .order-summary-table td,
    .custom-orders-table td {
        display: grid;
        grid-template-columns: minmax(7rem, 38%) minmax(0, 1fr);
        gap: .75rem;
        align-items: center;
        padding: .75rem .85rem;
        text-align: start;
    }

    .order-summary-table td::before,
    .custom-orders-table td::before {
        content: attr(data-label);
        color: var(--pido-text);
        font-size: .875rem;
        font-weight: var(--pido-font-weight-bold, 700);
        text-align: start;
    }

    .custom-status,
    .order-status-badge {
        min-width: 0;
        justify-self: start;
    }

    .custom-order-actions {
        justify-content: stretch;
    }

    .custom-order-actions .custom-view-btn {
        width: 100%;
    }
}
