/**
 * WooCommerce Simple Returns – style frontendu
 * Działa w obrębie "Moje konto" WooCommerce.
 */

/* ── Wrapper ──────────────────────────────────────────────── */
.wcsr-wrapper {
    max-width: 840px;
}

/* ── Podsumowanie zamówienia ──────────────────────────────── */
.wcsr-order-summary {
    background: #f8f8f8;
    padding: 16px 20px;
    border-left: 4px solid #96588a;
    margin-bottom: 28px;
    border-radius: 0 4px 4px 0;
}
.wcsr-order-summary p {
    margin: 4px 0;
}

/* ── Tabela produktów ─────────────────────────────────────── */
.wcsr-items-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 28px;
}
.wcsr-items-table th,
.wcsr-items-table td {
    padding: 10px 12px;
    border: 1px solid #ddd;
    vertical-align: middle;
}
.wcsr-items-table thead th {
    background: #f1f1f1;
    font-weight: 600;
    text-align: left;
}
.wcsr-col-check {
    width: 50px;
    text-align: center;
}
.wcsr-col-qty {
    width: 120px;
    text-align: center;
}
.wcsr-item-checkbox {
    cursor: pointer;
    width: 18px;
    height: 18px;
}
.wcsr-qty-input {
    width: 72px;
    text-align: center;
    padding: 5px;
}
.wcsr-qty-input:disabled {
    background: #f5f5f5;
    color: #aaa;
    cursor: not-allowed;
}

/* ── Pola formularza ──────────────────────────────────────── */
.wcsr-form-field {
    margin-bottom: 22px;
}
.wcsr-form-field label {
    display: block;
    margin-bottom: 6px;
    font-weight: normal;
}
.wcsr-form-field select,
.wcsr-form-field textarea,
.wcsr-form-field input[type="text"] {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid #ccc;
    border-radius: 3px;
    box-sizing: border-box;
    font-size: 1em;
    line-height: 1.4;
}
.wcsr-form-field select:focus,
.wcsr-form-field textarea:focus,
.wcsr-form-field input[type="text"]:focus {
    outline: none;
    border-color: #96588a;
    box-shadow: 0 0 0 2px rgba(150, 88, 138, .15);
}
.wcsr-field-note {
    color: #666;
    font-size: 0.875em;
    display: block;
    margin-top: 5px;
}
.wcsr-optional {
    font-weight: normal;
    font-style: italic;
    color: #888;
    margin-left: 4px;
}
.wcsr-hint {
    color: #666;
    font-style: italic;
    margin-bottom: 16px;
}

/* ── Przyciski akcji ──────────────────────────────────────── */
.wcsr-form-actions {
    display: flex;
    gap: 12px;
    margin-top: 28px;
    flex-wrap: wrap;
    align-items: center;
}

/* ── Powiadomienia ────────────────────────────────────────── */
.wcsr-notice {
    padding: 14px 18px;
    border-radius: 4px;
    margin-bottom: 24px;
    border: 1px solid transparent;
}
.wcsr-notice p {
    margin: 0;
}
.wcsr-notice--success {
    background: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}
.wcsr-notice--error {
    background: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

/* ── Lista zgłoszeń ───────────────────────────────────────── */
.wcsr-returns-list {
    width: 100%;
}

/* ── Odznaczniki statusu ──────────────────────────────────── */
.wcsr-status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.82em;
    font-weight: 600;
    white-space: nowrap;
}
.wcsr-status--pending   { background: #fff3cd; color: #856404; }
.wcsr-status--approved  { background: #d4edda; color: #155724; }
.wcsr-status--rejected  { background: #f8d7da; color: #721c24; }
.wcsr-status--completed { background: #cce5ff; color: #004085; }

/* ── Responsive ───────────────────────────────────────────── */
@media ( max-width: 600px ) {
    .wcsr-items-table thead {
        display: none;
    }
    .wcsr-items-table tr {
        display: grid;
        grid-template-columns: 40px 1fr;
        border-bottom: 2px solid #ddd;
        margin-bottom: 8px;
    }
    .wcsr-items-table td {
        border: none;
        padding: 6px 8px;
    }
    .wcsr-col-check {
        grid-row: span 2;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .wcsr-form-actions {
        flex-direction: column;
    }
    .wcsr-form-actions .button {
        width: 100%;
        text-align: center;
    }
}

/* ── Data odbioru przesyłki ───────────────────────────────── */
.wcsr-date-input {
    padding: 9px 11px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 1em;
    width: 200px;
    box-sizing: border-box;
}
.wcsr-date-input:focus {
    outline: none;
    border-color: #96588a;
    box-shadow: 0 0 0 2px rgba(150, 88, 138, .15);
}

/* ── Już zwrócona ilość ───────────────────────────────────── */
.wcsr-already-returned {
    display: inline-block;
    background: #fff3cd;
    color: #856404;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 0.85em;
    font-weight: 600;
}

/* ── Wyszarzony przycisk zwrotu (termin upłynął) ──────────── */
.wcsr-return-button--expired,
a[href="#wcsr-expired"].button,
.wcsr_return_expired.button {
    opacity: 0.45 !important;
    cursor: not-allowed !important;
    pointer-events: auto !important; /* musi być auto, żeby JS mógł przechwycić klik */
    user-select: none;
    background-color: #ccc !important;
    color: #555 !important;
    border-color: #bbb !important;
    box-shadow: none !important;
    text-decoration: none !important;
}

/* ── Popup (informacja o wygasłym terminie) ───────────────── */
.wcsr-popup {
    position: absolute;
    z-index: 99999;
    background: #333;
    color: #fff;
    padding: 12px 36px 12px 14px;
    border-radius: 5px;
    font-size: 0.875em;
    line-height: 1.5;
    max-width: 300px;
    box-shadow: 0 4px 14px rgba(0,0,0,.25);
    pointer-events: auto;
}
.wcsr-popup__close {
    position: absolute;
    top: 6px;
    right: 8px;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.2em;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
    opacity: 0.7;
}
.wcsr-popup__close:hover {
    opacity: 1;
}
