/**
 * AI Bulk Actions – Admin Styles
 * Products list: confirm dialog (.wtofe-bulk-modal) and progress notices
 * (.wtofe-bulk-notice).
 */

/* ── Confirm dialog ───────────────────────────────────────────────────────── */

body.wtofe-bulk-modal-open {
    overflow: hidden;
}

.wtofe-bulk-modal {
    position: fixed;
    inset: 0;
    z-index: 100050;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wtofe-bulk-modal[hidden] {
    display: none;
}

.wtofe-bulk-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.wtofe-bulk-modal__dialog {
    position: relative;
    box-sizing: border-box;
    width: 480px;
    max-width: calc(100% - 32px);
    max-height: calc(100% - 64px);
    overflow: auto;
    padding: 20px 24px;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 3px 30px rgba(0, 0, 0, 0.2);
}

.wtofe-bulk-modal__dialog:focus {
    outline: none;
}

.wtofe-bulk-modal__title {
    margin: 0 0 8px;
    font-size: 1.3em;
}

.wtofe-bulk-modal__options label {
    display: block;
    margin: 6px 0;
}

.wtofe-bulk-modal__options fieldset {
    margin: 0 0 8px;
}

.wtofe-bulk-modal__options legend {
    font-weight: 600;
    margin-bottom: 2px;
}

.wtofe-bulk-modal__options label[for="wtofe-bulk-tone"] {
    font-weight: 600;
    margin-bottom: 4px;
}

.wtofe-bulk-modal__options .description,
.wtofe-bulk-modal__backup {
    margin: 0 0 8px;
}

.wtofe-bulk-modal__estimate {
    margin-top: 12px;
    padding: 8px 12px;
    background: #f6f7f7;
    border: 1px solid #dcdcde;
    border-radius: 4px;
}

.wtofe-bulk-modal__estimate p,
.wtofe-bulk-modal__skips {
    margin: 4px 0;
}

.wtofe-bulk-modal__skips:empty,
.wtofe-bulk-modal__limit:empty {
    display: none;
}

.wtofe-bulk-modal__skips li {
    margin: 0;
    color: #50575e;
}

.wtofe-bulk-modal__cost {
    font-weight: 600;
}

.wtofe-bulk-modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
}

/* ── Progress notices ─────────────────────────────────────────────────────── */

.wtofe-bulk-notice .wtofe-bulk-counts {
    margin-left: 4px;
    color: #50575e;
}

.wtofe-bulk-bar {
    max-width: 480px;
    height: 6px;
    margin: 0 0 8px;
    overflow: hidden;
    background: #dcdcde;
    border-radius: 3px;
}

.wtofe-bulk-bar span {
    display: block;
    height: 100%;
    background: #2271b1;
    transition: width 0.3s ease;
}

.wtofe-bulk-details {
    margin: 0 0 6px;
}

.wtofe-bulk-details summary {
    cursor: pointer;
}

.wtofe-bulk-details ul {
    margin: 4px 0 0 18px;
    list-style: disc;
}

.wtofe-bulk-fix-links {
    margin-left: 4px;
}

.wtofe-bulk-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

/* ── Review window ────────────────────────────────────────────────────────── */

.wtofe-bulk-review__dialog {
    display: flex;
    flex-direction: column;
    width: 960px;
    height: calc(100% - 64px);
    padding: 0;
    overflow: hidden;
}

.wtofe-bulk-review__header {
    padding: 20px 24px 8px;
    border-bottom: 1px solid #dcdcde;
}

.wtofe-bulk-review__summary {
    margin: 0 0 4px;
    color: #50575e;
}

.wtofe-bulk-review__list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 16px 24px;
    background: #f6f7f7;
}

.wtofe-bulk-review__dialog .wtofe-bulk-modal__footer {
    margin: 0;
    padding: 12px 24px;
    border-top: 1px solid #dcdcde;
}

.wtofe-bulk-review__spacer {
    flex: 1;
}

.wtofe-review-card {
    margin: 0 0 12px;
    padding: 12px 16px;
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 4px;
}

.wtofe-review-card:last-child {
    margin-bottom: 0;
}

.wtofe-review-card--done {
    border-left: 4px solid #00a32a;
}

.wtofe-review-card--rejected,
.wtofe-review-card--failed,
.wtofe-review-card--cancelled,
.wtofe-review-card--interrupted {
    border-left: 4px solid #d63638;
}

.wtofe-review-card__header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.wtofe-review-card__name {
    font-weight: 600;
    font-size: 14px;
}

.wtofe-review-card__status {
    flex-shrink: 0;
    color: #50575e;
    font-size: 12px;
}

.wtofe-review-card__field h3 {
    margin: 12px 0 6px;
    font-size: 13px;
}

.wtofe-review-card__compare {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 10px;
}

.wtofe-review-card__compare figure {
    margin: 0;
}

.wtofe-review-card__compare figcaption,
.wtofe-review-card__caption {
    display: block;
    margin-bottom: 4px;
    color: #50575e;
    font-size: 12px;
    font-weight: 600;
}

.wtofe-review-card__compare img {
    display: block;
    width: 100%;
    max-width: 240px;
    height: auto;
    border: 1px solid #dcdcde;
    border-radius: 2px;
}

.wtofe-review-card__empty {
    color: #787c82;
    font-style: italic;
}

.wtofe-review-card__compare figure .wtofe-review-card__empty {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 240px;
    aspect-ratio: 1;
    background: #f6f7f7;
    border: 1px dashed #c3c4c7;
    border-radius: 2px;
}

.wtofe-review-card__text {
    max-height: 180px;
    overflow-y: auto;
    padding: 8px 10px;
    background: #f6f7f7;
    border: 1px solid #dcdcde;
    border-radius: 2px;
    font-size: 13px;
}

/* Admin styles strip list markers; show them as the storefront would. */
.wtofe-review-card__text ul,
.wtofe-review-card__text ol {
    margin: 0.5em 0 0.5em 1.5em;
}

.wtofe-review-card__text ul {
    list-style: disc;
}

.wtofe-review-card__text ol {
    list-style: decimal;
}

.wtofe-review-card__text > :first-child {
    margin-top: 0;
}

.wtofe-review-card__text > :last-child {
    margin-bottom: 0;
}

.wtofe-review-card__message {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 8px 0 0;
    color: #50575e;
}

.wtofe-review-card__message .spinner {
    float: none;
    margin: 0;
}

.wtofe-review-card__error {
    margin: 8px 0 0;
    color: #d63638;
}

.wtofe-review-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

@media screen and (max-width: 600px) {
    /* Text needs the width; the two images still fit side by side. */
    .wtofe-review-card__compare:not(.wtofe-review-card__compare--images) {
        grid-template-columns: 1fr;
    }

    .wtofe-bulk-review__header,
    .wtofe-bulk-review__list,
    .wtofe-bulk-review__dialog .wtofe-bulk-modal__footer {
        padding-left: 16px;
        padding-right: 16px;
    }
}
