.sofilu-reorder-wrap {
    max-width: 900px;
}

.sofilu-reorder-header h2 {
    margin-bottom: 5px;
}

.sofilu-reorder-header p {
    color: #666;
    margin-bottom: 25px;
    font-size: 14px;
}

.sofilu-reorder-select-all {
    margin-bottom: 15px;
    padding: 10px 15px;
    background: #f8f8f8;
    border-radius: 6px;
}

.sofilu-reorder-select-all label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 600;
}

.sofilu-reorder-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sofilu-reorder-item {
    padding: 15px;
    border: 2px solid #e8e8e8;
    border-radius: 8px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.sofilu-reorder-item:hover {
    border-color: #ccc;
}

.sofilu-reorder-item.selected {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
    background: #f0f7fc;
}

/* Top row: checkbox + image + product details */
.sofilu-item-top {
    display: grid;
    grid-template-columns: 30px 60px 1fr;
    gap: 12px;
    align-items: center;
    cursor: pointer;
}

.sofilu-item-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.sofilu-item-image img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #eee;
}

.sofilu-item-details {
    min-width: 0;
}

.sofilu-item-name {
    margin: 0 0 4px 0;
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sofilu-item-sku,
.sofilu-item-last-ordered {
    display: block;
    font-size: 12px;
    color: #888;
}

/* Variations area */
.sofilu-item-variations {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #eee;
    margin-left: 42px;
}

.sofilu-variation-rows {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sofilu-variation-row {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    padding: 8px 10px;
    background: #fafafa;
    border-radius: 6px;
    flex-wrap: wrap;
}

.sofilu-reorder-item.selected .sofilu-variation-row {
    background: #e8f0f8;
}

.sofilu-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sofilu-field label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: #666;
}

.sofilu-qty-input {
    width: 65px;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    text-align: center;
}

.sofilu-attr-select {
    min-width: 170px;
    max-width: 250px;
    width: auto;
    padding: 8px 30px 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23666' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.sofilu-size-input {
    width: 150px;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.sofilu-remove-row {
    background: none;
    border: none;
    font-size: 20px;
    color: #cc0000;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    border-radius: 4px;
    align-self: flex-end;
    margin-bottom: 4px;
}

.sofilu-remove-row:hover {
    background: #fee;
}

.sofilu-add-row {
    margin-top: 8px;
    background: none;
    border: 1px dashed #bbb;
    color: #555;
    padding: 6px 14px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s, border-color 0.2s;
}

.sofilu-add-row:hover {
    background: #f0f0f0;
    border-color: #999;
}

/* Notes */
.sofilu-reorder-notes {
    margin-top: 20px;
}

.sofilu-reorder-notes label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 14px;
}

.sofilu-reorder-notes textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    resize: vertical;
}

/* Submit */
.sofilu-reorder-submit {
    margin-top: 25px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.sofilu-submit-btn {
    padding: 12px 30px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    background: #2271b1 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 6px !important;
    cursor: pointer;
    transition: background 0.2s;
}

.sofilu-submit-btn:hover {
    background: #135e96 !important;
}

.sofilu-submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.sofilu-selected-count {
    font-size: 14px;
    color: #666;
}

/* Success */
.sofilu-success-message {
    text-align: center;
    padding: 40px 20px;
    background: #f0fdf4;
    border: 2px solid #86efac;
    border-radius: 12px;
}

.sofilu-success-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: #22c55e;
    color: #fff;
    border-radius: 50%;
    font-size: 30px;
    margin-bottom: 15px;
}

.sofilu-success-message h3 {
    font-size: 22px;
    margin: 0 0 10px 0;
}

.sofilu-success-message p {
    color: #555;
    font-size: 15px;
    max-width: 400px;
    margin: 0 auto 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .sofilu-item-variations {
        margin-left: 0;
    }

    .sofilu-item-image img {
        width: 50px;
        height: 50px;
    }

    .sofilu-variation-row {
        gap: 8px;
    }

    .sofilu-attr-select,
    .sofilu-size-input {
        min-width: 130px;
    }
}

@media (max-width: 480px) {
    .sofilu-item-top {
        grid-template-columns: 25px 45px 1fr;
        gap: 8px;
    }

    .sofilu-variation-row {
        flex-direction: column;
        align-items: stretch;
    }

    .sofilu-qty-input,
    .sofilu-attr-select,
    .sofilu-size-input {
        width: 100%;
    }

    .sofilu-remove-row {
        align-self: flex-end;
    }

    .sofilu-reorder-submit {
        flex-direction: column;
        align-items: stretch;
    }

    .sofilu-selected-count {
        text-align: center;
    }
}
