/* Simple Refund modal — toile-core */

body.toile-simple-refund-modal-open {
    overflow: hidden !important;
}

.toile-simple-refund__overlay {
    position: fixed !important;
    inset: 0 !important;
    z-index: 999999 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(0, 0, 0, 0.55) !important;
    padding: 16px !important;
}

.toile-simple-refund__overlay[aria-hidden="true"] {
    display: none !important;
}

.toile-simple-refund__dialog {
    width: 100%;
    max-width: 520px;
    max-height: calc(100vh - 32px);
    outline: none;
}

.toile-simple-refund__card {
    background: #fff;
    width: 100%;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.toile-simple-refund__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
}

.toile-simple-refund__title {
    font-size: 17px !important;
    font-weight: 600 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    line-height: 1.3 !important;
}

.toile-simple-refund__close {
    background: transparent !important;
    border: none !important;
    font-size: 20px !important;
    line-height: 1 !important;
    cursor: pointer !important;
    padding: 6px 8px !important;
    color: #6b7280 !important;
    outline: none !important;
    flex-shrink: 0;
}

.toile-simple-refund__close:hover {
    color: #111 !important;
}

.toile-simple-refund__body {
    padding: 24px;
}

/* Type radio group */
.toile-simple-refund__type-group {
    display: flex;
    gap: 24px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.toile-simple-refund__radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 400;
    margin: 0;
}

.toile-simple-refund__radio-label input[type="radio"] {
    margin: 0;
    cursor: pointer;
}

/* Items list */
.toile-simple-refund__items-wrap {
    margin-bottom: 20px;
    border: 1px solid #e5e7eb;
}

.toile-simple-refund__items-list {
    max-height: 220px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.toile-simple-refund__item-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 400;
    margin: 0;
    border-bottom: 1px solid #f3f4f6;
}

.toile-simple-refund__item-label:last-child {
    border-bottom: none;
}

.toile-simple-refund__item-label input[type="checkbox"] {
    flex-shrink: 0;
    margin: 0;
    cursor: pointer;
}

.toile-simple-refund__item-label--disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.toile-simple-refund__item-label--disabled input {
    cursor: not-allowed !important;
}

.toile-simple-refund__item-name {
    flex: 1;
    min-width: 0;
}

.toile-simple-refund__item-qty {
    color: #6b7280;
    white-space: nowrap;
    font-size: 13px;
    flex-shrink: 0;
}

.toile-simple-refund__item-note {
    font-size: 11px;
    color: #ef4444;
    white-space: nowrap;
    flex-shrink: 0;
}

.toile-simple-refund__items-msg {
    padding: 12px 16px;
    font-size: 14px;
    color: #6b7280;
    margin: 0;
}

/* Loading */
.toile-simple-refund__loading {
    text-align: center;
    padding: 14px 16px;
    font-size: 14px;
    color: #6b7280;
}

/* Reason */
.toile-simple-refund__reason-group {
    margin-bottom: 20px;
}

.toile-simple-refund__label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
}

.toile-simple-refund__textarea {
    width: 100% !important;
    padding: 10px 12px !important;
    border: 1px solid #d1d5db !important;
    font-size: 14px !important;
    resize: vertical !important;
    font-family: inherit !important;
    box-sizing: border-box !important;
    min-height: 90px;
    line-height: 1.5;
}

.toile-simple-refund__textarea:focus {
    outline: none !important;
    border-color: #111 !important;
    box-shadow: none !important;
}

.toile-simple-refund__file {
    display: block;
    width: 100%;
    padding: 12px 14px;
    border: 1px dashed #cbd5e1;
    background: #f8fafc;
    color: #111827;
    font-size: 14px;
    line-height: 1.4;
    box-sizing: border-box;
    cursor: pointer;
    transition: border-color .2s ease, background-color .2s ease;
}

.toile-simple-refund__file:hover {
    border-color: #94a3b8;
    background: #f1f5f9;
}

.toile-simple-refund__file:focus {
    outline: none !important;
    border-color: #111 !important;
    background: #fff !important;
    box-shadow: none !important;
}

.toile-simple-refund__file::file-selector-button {
    margin-right: 12px;
    padding: 8px 14px;
    border: none;
    background: #111827;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.toile-simple-refund__file::-webkit-file-upload-button {
    margin-right: 12px;
    padding: 8px 14px;
    border: none;
    background: #111827;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.toile-simple-refund__file-help {
    margin: 8px 0 0;
    font-size: 12px;
    color: #6b7280;
    line-height: 1.5;
}

.toile-simple-refund__file-meta {
    margin: 10px 0 0;
    padding: 10px 12px;
    font-size: 13px;
    color: #1f2937;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
}

/* Error */
.toile-simple-refund__error {
    font-size: 13px;
    color: #dc2626;
    margin-bottom: 14px;
    padding: 10px 14px;
    background: #fef2f2;
    border: 1px solid #fecaca;
}

/* Actions */
.toile-simple-refund__actions {
    display: flex;
}

.toile-simple-refund__submit {
    flex: 1;
    text-align: center;
}

/* Success state */
.toile-simple-refund__success {
    text-align: center;
    padding: 32px 24px;
}

.toile-simple-refund__success-icon {
    width: 52px;
    height: 52px;
    line-height: 52px;
    font-size: 26px;
    color: #fff;
    background: #22c55e;
    border-radius: 50%;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toile-simple-refund__success-msg {
    margin-bottom: 24px;
    font-size: 15px;
    color: #374151;
    line-height: 1.6;
}

.toile-simple-refund__close-success {
    min-width: 120px;
}

/* Detail page button wrapper */
.toile-simple-refund-detail-wrap {
    margin-top: 16px;
}

.toile-refund-already-submitted {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
}

/* ── My Account: Returns & Refunds history page ───────────────────────── */

.toile-refund-history__title {
    margin-bottom: 20px;
}

.toile-refund-history__empty {
    color: #6b7280;
    font-size: 15px;
}

.toile-refund-history__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.toile-refund-history__table th,
.toile-refund-history__table td {
    text-align: left;
    padding: 12px 14px;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: middle;
}

.toile-refund-history__table thead th {
    background: #f9fafb;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #374151;
}

.toile-refund-history__table tbody tr:last-child td {
    border-bottom: none;
}

.toile-refund-history__table a {
    font-weight: 600;
}

.toile-refund-proof-cell {
    min-width: 120px;
}

/* Status badges */
.toile-refund-status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .03em;
    white-space: nowrap;
    position: relative;
}

.toile-refund-status[data-tooltip] {
    cursor: help;
}

.toile-refund-status[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 10px);
    transform: translateX(-50%) translateY(4px);
    min-width: 180px;
    max-width: 240px;
    padding: 8px 10px;
    border-radius: 8px;
    background: #111827;
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
    text-align: center;
    white-space: normal;
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
    z-index: 20;
    box-shadow: 0 10px 24px rgba(17, 24, 39, 0.2);
}

.toile-refund-status[data-tooltip]::before {
    content: "";
    position: absolute;
    left: 50%;
    bottom: calc(100% + 4px);
    transform: translateX(-50%) translateY(4px);
    border-width: 6px 6px 0 6px;
    border-style: solid;
    border-color: #111827 transparent transparent transparent;
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
    z-index: 20;
}

.toile-refund-status[data-tooltip]:hover::after,
.toile-refund-status[data-tooltip]:hover::before,
.toile-refund-status[data-tooltip]:focus-visible::after,
.toile-refund-status[data-tooltip]:focus-visible::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.toile-refund-status--pending {
    background: #fef9c3;
    color: #854d0e;
}

.toile-refund-status--approved {
    background: #dcfce7;
    color: #166534;
}

.toile-refund-status--cancelled {
    background: #f3f4f6;
    color: #6b7280;
}

.toile-refund-vendor-review {
    display: grid;
    gap: 8px;
}

.toile-refund-vendor-review__badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.toile-refund-vendor-review__badge--pending {
    background: #fff7ed;
    color: #9a3412;
}

.toile-refund-vendor-review__badge--approved {
    background: #dcfce7;
    color: #166534;
}

.toile-refund-vendor-review__badge--rejected {
    background: #fee2e2;
    color: #991b1b;
}

.toile-refund-vendor-review__reason,
.toile-refund-vendor-review__meta {
    font-size: 12px;
    line-height: 1.5;
    color: #4b5563;
}

.toile-refund-vendor-action {
    display: grid;
    gap: 10px;
    min-width: 240px;
}

.toile-refund-vendor-action__choices {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-start;
}

.toile-refund-vendor-action__choice-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 1px;
    height: 1px;
}

.toile-refund-vendor-action__choice {
    display: inline-block !important;
    margin: 0;
    cursor: pointer;
    user-select: none;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 999px;
    background: #fff;
    color: #111827;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
}

.toile-refund-vendor-action__choice span {
    display: inline-flex;
    align-items: center;
}

.toile-refund-vendor-action__choice-indicator {
    width: 14px;
    height: 14px;
    margin-right: 8px;
    border: 1px solid #9ca3af;
    border-radius: 999px;
    position: relative;
    flex-shrink: 0;
}

.toile-refund-vendor-action__choice-indicator::after {
    content: "";
    position: absolute;
    inset: 3px;
    border-radius: 999px;
    background: #111827;
    opacity: 0;
}

.toile-refund-vendor-action__choice-input:checked + .toile-refund-vendor-action__choice {
    border-color: #111827;
    background: #f9fafb;
}

.toile-refund-vendor-action__choice-input:checked + .toile-refund-vendor-action__choice .toile-refund-vendor-action__choice-indicator {
    border-color: #111827;
}

.toile-refund-vendor-action__choice-input:checked + .toile-refund-vendor-action__choice .toile-refund-vendor-action__choice-indicator::after {
    opacity: 1;
}

.toile-refund-vendor-action__reason-wrap {
    display: none;
    gap: 6px;
    width: 100%;
    margin-top: 4px;
}

.toile-refund-vendor-action__choice-input--rejected:checked ~ .toile-refund-vendor-action__reason-wrap {
    display: grid;
}

.toile-refund-vendor-action__label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    margin: 0;
}

.toile-refund-vendor-action__reason {
    width: 100%;
    min-height: 88px;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    resize: vertical;
    box-sizing: border-box;
}

.toile-refund-vendor-action__footer {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toile-refund-vendor-action.is-submitting {
    opacity: .72;
    pointer-events: none;
}

.toile-refund-vendor-action__feedback,
.toile-refund-vendor-action__message {
    font-size: 12px;
    line-height: 1.5;
    padding: 8px 10px;
    border-radius: 6px;
}

.toile-refund-vendor-action__feedback--info {
    background: #eff6ff;
    color: #1d4ed8;
}

.toile-refund-vendor-action__feedback--success,
.toile-refund-vendor-action__message--approved {
    background: #ecfdf5;
    color: #166534;
}

.toile-refund-vendor-action__feedback--error,
.toile-refund-vendor-action__message--rejected {
    background: #fef2f2;
    color: #991b1b;
}

.toile-refund-vendor-action__locked {
    display: inline-block;
    font-size: 12px;
    color: #6b7280;
}

@media (max-width: 600px) {
    .toile-refund-history__table thead {
        display: none;
    }

    .toile-refund-history__table tr {
        display: block;
        border-bottom: 1px solid #e5e7eb;
        padding: 10px 0;
    }

    .toile-refund-history__table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: none;
        padding: 6px 0;
        font-size: 13px;
    }

    .toile-refund-history__table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #374151;
        font-size: 12px;
        flex-shrink: 0;
        margin-right: 12px;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .toile-simple-refund__overlay {
        padding: 0 !important;
        align-items: flex-end !important;
    }

    .toile-simple-refund__dialog {
        max-width: 100%;
        max-height: 92vh;
    }

    .toile-simple-refund__card {
        max-height: 92vh;
        border-radius: 14px 14px 0 0;
    }

    .toile-simple-refund__type-group {
        flex-direction: column;
        gap: 12px;
    }
}
