/**
 * WC Easy Returns – Frontend CSS
 * Dyrektywa UE 2023/2673 – compliance styles
 */

/* ============================================================
   PRZYCISK ODSTĄPIENIA (Moduł 1)
   Spełnia wymóg równorzędnej widoczności z przyciskiem zakupu
   ============================================================ */
.wd-withdrawal-btn {
    background-color: #e2401c !important;
    color: #fff !important;
    border-color: #c53515 !important;
    font-weight: 600;
    letter-spacing: .01em;
    transition: background-color .2s ease, transform .1s ease;
    cursor: pointer;
}

.wd-withdrawal-btn:hover,
.wd-withdrawal-btn:focus {
    background-color: #c53515 !important;
    color: #fff !important;
    outline: 3px solid #f7a899;
    outline-offset: 2px;
}

.wd-withdrawal-wrapper {
    padding: 1.2em;
    background: #fdf5f3;
    border: 1px solid #f5c6bb;
    border-radius: 4px;
    margin-top: 1.5em;
}

.wd-deadline-info {
    font-size: .88em;
    color: #c53515;
    margin: .4em 0 0;
    font-style: italic;
}

/* ============================================================
   FORMULARZ – KROK 1
   ============================================================ */
.wd-withdrawal-form {
    max-width: 720px;
}

.wd-step-indicator {
    color: #666;
    font-size: .9em;
    margin-bottom: 1.5em;
    padding: .5em .8em;
    background: #f0f0f0;
    border-radius: 3px;
    display: inline-block;
}

.wd-order-summary {
    padding: .8em 1em;
    background: #f9f9f9;
    border-left: 4px solid #3498db;
    margin-bottom: 1.5em;
    font-size: .95em;
}

.wd-order-summary .wd-deadline-info {
    display: block;
    margin-top: .3em;
}

.wd-fieldset {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 1em 1.2em;
    margin-bottom: 1.2em;
}

.wd-fieldset legend {
    font-weight: 600;
    font-size: 1em;
    padding: 0 .4em;
    color: #333;
}

.wd-optional {
    font-weight: 400;
    color: #888;
    font-size: .85em;
}

.wd-field-hint {
    font-size: .85em;
    color: #666;
    margin: .3em 0 .8em;
    font-style: italic;
}

/* Lista produktów */
.wd-products-list {
    display: flex;
    flex-direction: column;
    gap: .6em;
}

.wd-product-row {
    display: flex;
    align-items: center;
    gap: .8em;
    padding: .6em;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    transition: background .15s;
}

.wd-product-row:hover {
    background: #f5f5f5;
}

/* Klikalna jest etykieta, nie cały wiersz – wybór ilości leży poza nią. */
.wd-product-main {
    display: flex;
    align-items: center;
    gap: .8em;
    flex: 1 1 auto;
    min-width: 0;
    cursor: pointer;
    margin: 0;
}

.wd-product-row input[type="checkbox"] {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.wd-product-qty-picker {
    display: flex;
    align-items: center;
    gap: .4em;
    flex-shrink: 0;
    font-size: .9em;
}

.wd-product-qty-picker label {
    margin: 0;
    color: #555;
}

.wd-product-qty-picker select {
    padding: .2em .4em;
    min-height: 0;
}

.wd-product-img img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 3px;
}

.wd-product-info {
    display: flex;
    flex-direction: column;
    gap: .15em;
}

.wd-product-name { font-weight: 600; }
.wd-product-sku  { font-size: .8em; color: #888; }
.wd-product-qty  { font-size: .85em; color: #555; }

/* RODO info */
.wd-gdpr-info {
    font-size: .82em;
    color: #777;
    border-top: 1px solid #eee;
    padding-top: .8em;
    margin-top: 1em;
}

/* Przyciski akcji */
.wd-btn-step1 {
    margin-right: .6em;
}

.wd-btn-cancel {
    background: #f7f7f7 !important;
    color: #555 !important;
    border-color: #ccc !important;
}

/* ============================================================
   FORMULARZ – KROK 2 (POTWIERDZENIE)
   ============================================================ */
.wd-summary-box {
    background: #fafafa;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 1.2em;
    margin-bottom: 1.5em;
}

.wd-summary-table {
    width: 100%;
    border-collapse: collapse;
}

.wd-summary-table th,
.wd-summary-table td {
    padding: .5em .7em;
    border-bottom: 1px solid #eee;
    vertical-align: top;
    text-align: left;
}

.wd-summary-table th {
    width: 180px;
    font-weight: 600;
    color: #444;
}

.wd-products-summary {
    margin: 0;
    padding-left: 1.2em;
}

.wd-legal-notice {
    padding: .9em 1em;
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: 4px;
    margin-bottom: 1.5em;
    font-size: .9em;
}

/* Główny przycisk potwierdzenia – KRYTYCZNY DLA DYREKTYWY */
.wd-btn-confirm {
    font-size: 1.05em !important;
    padding: .7em 1.5em !important;
    background-color: #e2401c !important;
    color: #fff !important;
    border-color: #c53515 !important;
    font-weight: 700;
}

.wd-btn-confirm:hover {
    background-color: #c53515 !important;
}

.wd-btn-confirm:disabled {
    opacity: .7;
    cursor: not-allowed;
}

.wd-btn-back {
    margin-left: .6em;
    background: #f7f7f7 !important;
    color: #555 !important;
    border-color: #ccc !important;
}

.wd-confirm-row {
    display: flex;
    align-items: center;
    gap: .5em;
    flex-wrap: wrap;
}

.wd-step2-note {
    font-size: .85em;
    color: #666;
    margin-top: .8em;
    font-style: italic;
}

/* Komunikaty */
.woocommerce-error,
.woocommerce-message {
    margin-bottom: 1em;
}

/* Spinner */
.wd-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: wd-spin .7s linear infinite;
    vertical-align: middle;
    margin-right: .4em;
}

@keyframes wd-spin {
    to { transform: rotate(360deg); }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 600px) {
    .wd-confirm-row {
        flex-direction: column;
        align-items: stretch;
    }
    .wd-btn-back {
        margin-left: 0;
        margin-top: .5em;
    }
    .wd-summary-table th {
        width: 110px;
    }
}
