/* DS Withdrawal — WooCommerce plugin styles */

/* ── Wrapper ────────────────────────────────────────────────────── */
.ds-withdrawal-wrapper {
    max-width: 800px;
    margin: 0 auto;
    font-size: 15px;
}

/* ── Progress stepper ───────────────────────────────────────────── */
.ds-withdrawal-steps {
    margin: 0 0 28px;
}

.ds-steps {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0;
}

.ds-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
}

.ds-step--separator {
    flex: 1 1 auto;
    height: 2px;
    background: #ddd;
    margin: -14px 0 0;
}

.ds-step__num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #777;
    font-weight: 700;
    font-size: 15px;
    border: 2px solid #ddd;
    transition: background .2s, color .2s, border-color .2s;
}

.ds-step__label {
    font-size: 12px;
    color: #999;
    white-space: nowrap;
    transition: color .2s;
}

.ds-step--active .ds-step__num {
    background: #0073ea;
    color: #fff;
    border-color: #0073ea;
}

.ds-step--active .ds-step__label {
    color: #0073ea;
    font-weight: 600;
}

.ds-step--done .ds-step__num {
    background: #2ecc71;
    color: #fff;
    border-color: #2ecc71;
}

.ds-step--done .ds-step__label {
    color: #2ecc71;
}

/* ── Section card ───────────────────────────────────────────────── */
.ds-withdrawal-section {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 24px;
    margin-bottom: 20px;
}

.ds-section-title {
    margin: 0 0 20px;
    font-size: 18px;
    font-weight: 600;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 12px;
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.ds-section-title small {
    font-size: 13px;
    font-weight: 400;
    color: #888;
}

/* ── Form rows ──────────────────────────────────────────────────── */
.ds-withdrawal-form .form-row {
    margin-bottom: 16px;
}

.ds-form-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    padding-top: 8px;
    border-top: 1px solid #f0f0f0;
}

/* ── Product items (step 2) ─────────────────────────────────────── */
.ds-withdrawal-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.ds-withdrawal-item-wrap {
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    overflow: hidden;
    transition: border-color .15s;
}

.ds-withdrawal-item-wrap:has(.ds-withdrawal-item-check:checked) {
    border-color: #0073ea;
    box-shadow: 0 0 0 2px rgba(0,115,234,.12);
}

.ds-withdrawal-item-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: #fff;
}

.ds-withdrawal-item-check-col {
    flex: 0 0 auto;
}

.ds-withdrawal-item-check {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #0073ea;
}

.ds-withdrawal-item-img {
    flex: 0 0 auto;
}

.ds-withdrawal-item-img img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #eee;
}

.ds-withdrawal-item-info {
    flex: 1 1 auto;
}

.ds-item-name {
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: block;
    margin-bottom: 4px;
}

.ds-item-meta {
    font-size: 12px;
    color: #777;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.ds-item-already-ret {
    color: #e67e22;
}

.ds-withdrawal-item-qty-col {
    flex: 0 0 auto;
}

/* ── Qty stepper ────────────────────────────────────────────────── */
.ds-qty-stepper {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    width: 108px;
}

.ds-qty-btn {
    flex: 0 0 32px;
    width: 32px;
    height: 36px;
    border: none;
    background: #f7f7f7;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    transition: background .1s;
    color: #333;
}

.ds-qty-btn:hover:not(:disabled) {
    background: #eaeaea;
}

.ds-qty-btn:disabled {
    opacity: .4;
    cursor: default;
}

.ds-qty-input {
    flex: 1 1 auto;
    width: 44px;
    height: 36px;
    border: none;
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
    text-align: center;
    font-size: 14px;
    padding: 0;
    -moz-appearance: textfield;
}

.ds-qty-input::-webkit-inner-spin-button,
.ds-qty-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
}

.ds-qty-input:disabled {
    background: #f9f9f9;
    color: #bbb;
}

/* ── Reason block ───────────────────────────────────────────────── */
.ds-item-reason-block {
    padding: 10px 16px 14px;
    background: #fafafa;
    border-top: 1px solid #f0f0f0;
}

.ds-reason-select,
.ds-reason-custom {
    width: 100%;
    max-width: 480px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    background: #fff;
}

.ds-placeholder {
    color: #999;
}

/* ── Intro / hints ──────────────────────────────────────────────── */
.ds-withdrawal-intro {
    margin-bottom: 20px;
}

.ds-withdrawal-login-hint {
    margin-top: 12px;
    font-size: 13px;
}

/* ── Confirm page ───────────────────────────────────────────────── */
.ds-confirm-customer {
    background: #f9f9f9;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 20px;
}

.ds-confirm-customer h3 {
    margin: 0 0 10px;
    font-size: 15px;
}

.ds-confirm-customer dl {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 6px 12px;
    margin: 0;
}

.ds-confirm-customer dt {
    color: #666;
    font-size: 13px;
}

.ds-confirm-customer dd {
    margin: 0;
    font-size: 13px;
}

.ds-confirm-items {
    margin-bottom: 20px;
}

.ds-confirm-items h3 {
    margin: 0 0 10px;
    font-size: 15px;
}

.ds-confirm-items-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.ds-confirm-items-table th {
    background: #f5f5f5;
    padding: 8px 10px;
    text-align: left;
    border-bottom: 2px solid #ddd;
    font-weight: 600;
}

.ds-confirm-items-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

.ds-confirm-item-name {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ds-confirm-thumb {
    object-fit: cover;
    border-radius: 3px;
    border: 1px solid #eee;
}

.ds-confirm-note {
    margin: 12px 0;
    padding: 10px 14px;
    background: #fffbea;
    border-left: 3px solid #f0c040;
    font-size: 13px;
    border-radius: 0 4px 4px 0;
}

.ds-confirm-declaration {
    margin: 20px 0;
}

.ds-confirm-declaration details > summary {
    cursor: pointer;
    color: #0073ea;
    font-size: 13px;
    padding: 8px 0;
    user-select: none;
}

.ds-declaration-content {
    background: #f9f9f9;
    border: 1px solid #e8e8e8;
    border-radius: 4px;
    padding: 16px;
    font-size: 13px;
    line-height: 1.7;
    margin-top: 8px;
}

.ds-confirm-legal {
    margin: 16px 0;
    font-size: 13px;
}

.ds-confirm-actions {
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.ds-btn-confirm {
    background: #0073ea !important;
    color: #fff !important;
    border-color: #0073ea !important;
}

.ds-btn-back {
    color: #555 !important;
    border-color: #ccc !important;
}

/* ── Success page ───────────────────────────────────────────────── */
.ds-withdrawal-success {
    text-align: center;
    padding: 40px 20px;
}

.ds-success-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #2ecc71;
    color: #fff;
    font-size: 28px;
    margin-bottom: 20px;
    font-weight: 700;
}

.ds-withdrawal-success h2 {
    font-size: 22px;
    margin: 0 0 12px;
}

.ds-success-ref {
    font-size: 16px;
    color: #555;
    margin-bottom: 12px;
}

.ds-success-items {
    text-align: left;
    max-width: 400px;
    margin: 16px auto;
    background: #f9f9f9;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    padding: 16px;
}

.ds-success-items h3 {
    margin: 0 0 8px;
    font-size: 14px;
}

.ds-success-items ul {
    margin: 0;
    padding: 0 0 0 18px;
    font-size: 13px;
    line-height: 1.8;
}

.ds-success-legal {
    max-width: 560px;
    margin: 20px auto;
    font-size: 13px;
    text-align: left;
}

.ds-success-links {
    margin-top: 24px;
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ── My withdrawals (account endpoint) ─────────────────────────── */
.ds-mywithdrawals h2 {
    margin-bottom: 16px;
}

.ds-mywithdrawals-new {
    margin-bottom: 20px;
}

.ds-withdrawal-card {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    margin-bottom: 16px;
    overflow: hidden;
}

.ds-withdrawal-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: #f9f9f9;
    border-bottom: 1px solid #e8e8e8;
    flex-wrap: wrap;
    gap: 8px;
}

.ds-withdrawal-card__meta {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
    font-size: 13px;
}

.ds-withdrawal-card__meta strong {
    font-size: 14px;
}

.ds-card-order,
.ds-card-date {
    color: #666;
}

.ds-status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.ds-status-new {
    background: #fff3cd;
    color: #856404;
}

.ds-status-accepted {
    background: #cfe2ff;
    color: #084298;
}

.ds-status-completed {
    background: #d1e7dd;
    color: #0a3622;
}

.ds-withdrawal-card__body {
    padding: 16px 18px;
}

.ds-withdrawal-products-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.ds-withdrawal-products-table th {
    padding: 6px 8px;
    text-align: left;
    border-bottom: 1px solid #e8e8e8;
    font-weight: 600;
    color: #555;
}

.ds-withdrawal-products-table td {
    padding: 8px;
    border-bottom: 1px solid #f5f5f5;
    vertical-align: middle;
}

.ds-product-col {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ds-product-col img {
    border-radius: 3px;
    object-fit: cover;
    border: 1px solid #eee;
}

.ds-withdrawal-card__history {
    padding: 10px 18px 14px;
    background: #fafafa;
    border-top: 1px solid #f0f0f0;
}

.ds-history-item {
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 12px;
    color: #555;
    padding: 4px 0;
    border-bottom: 1px solid #f0f0f0;
}

.ds-history-date {
    color: #999;
    width: 120px;
    flex-shrink: 0;
}

.ds-history-note {
    color: #888;
    font-style: italic;
}

/* ── Order page button ──────────────────────────────────────────── */
.ds-withdrawal-order-block {
    margin-top: 16px;
}

.ds-withdrawal-btn--order {
    display: inline-block;
    padding: 8px 16px;
    background: #f7f7f7;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    font-size: 13px;
    transition: background .15s;
}

.ds-withdrawal-btn--order:hover {
    background: #eee;
    color: #000;
}

/* ── Error ──────────────────────────────────────────────────────── */
.ds-withdrawal-error {
    margin-bottom: 16px;
}

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .ds-steps {
        flex-wrap: wrap;
        gap: 8px;
    }
    .ds-step--separator {
        display: none;
    }
    .ds-confirm-customer dl {
        grid-template-columns: 1fr;
    }
    .ds-withdrawal-item-row {
        flex-wrap: wrap;
    }
    .ds-withdrawal-card__header {
        flex-direction: column;
        align-items: flex-start;
    }
    .ds-confirm-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .ds-success-links {
        flex-direction: column;
    }
}
